mirror of
https://github.com/home-assistant/core.git
synced 2025-08-09 15:45:08 +02:00
Add setup type hints to sisyphus
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
"""Support for the light on the Sisyphus Kinetic Art Table."""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
import aiohttp
|
||||
|
||||
from homeassistant.components.light import SUPPORT_BRIGHTNESS, LightEntity
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from . import DATA_SISYPHUS
|
||||
|
||||
@@ -14,8 +19,15 @@ _LOGGER = logging.getLogger(__name__)
|
||||
SUPPORTED_FEATURES = SUPPORT_BRIGHTNESS
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up a single Sisyphus table."""
|
||||
if not discovery_info:
|
||||
return
|
||||
host = discovery_info[CONF_HOST]
|
||||
try:
|
||||
table_holder = hass.data[DATA_SISYPHUS][host]
|
||||
|
@@ -1,4 +1,6 @@
|
||||
"""Support for track controls on the Sisyphus Kinetic Art Table."""
|
||||
from __future__ import annotations
|
||||
|
||||
import aiohttp
|
||||
from sisyphus_control import Track
|
||||
|
||||
@@ -21,7 +23,10 @@ from homeassistant.const import (
|
||||
STATE_PAUSED,
|
||||
STATE_PLAYING,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
from . import DATA_SISYPHUS
|
||||
|
||||
@@ -40,8 +45,15 @@ SUPPORTED_FEATURES = (
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
async def async_setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up a media player entity for a Sisyphus table."""
|
||||
if not discovery_info:
|
||||
return
|
||||
host = discovery_info[CONF_HOST]
|
||||
try:
|
||||
table_holder = hass.data[DATA_SISYPHUS][host]
|
||||
|
Reference in New Issue
Block a user