Add constructor return type in integrations T-Z (#50899)
parent
c650deef98
commit
9eecd90afc
|
@ -106,7 +106,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle a option flow for tado."""
|
"""Handle a option flow for tado."""
|
||||||
|
|
||||||
def __init__(self, config_entry: config_entries.ConfigEntry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ UPDATE_FIELDS = {
|
||||||
class TagIDExistsError(HomeAssistantError):
|
class TagIDExistsError(HomeAssistantError):
|
||||||
"""Raised when an item is not found."""
|
"""Raised when an item is not found."""
|
||||||
|
|
||||||
def __init__(self, item_id: str):
|
def __init__(self, item_id: str) -> None:
|
||||||
"""Initialize tag ID exists error."""
|
"""Initialize tag ID exists error."""
|
||||||
super().__init__(f"Tag with ID {item_id} already exists.")
|
super().__init__(f"Tag with ID {item_id} already exists.")
|
||||||
self.item_id = item_id
|
self.item_id = item_id
|
||||||
|
|
|
@ -224,7 +224,7 @@ class SensorTemplate(TemplateEntity, SensorEntity):
|
||||||
device_class: str | None,
|
device_class: str | None,
|
||||||
attribute_templates: dict[str, template.Template],
|
attribute_templates: dict[str, template.Template],
|
||||||
unique_id: str | None,
|
unique_id: str | None,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
attribute_templates=attribute_templates,
|
attribute_templates=attribute_templates,
|
||||||
|
|
|
@ -33,7 +33,7 @@ class _TemplateAttribute:
|
||||||
validator: Callable[[Any], Any] = None,
|
validator: Callable[[Any], Any] = None,
|
||||||
on_update: Callable[[Any], None] | None = None,
|
on_update: Callable[[Any], None] | None = None,
|
||||||
none_on_template_error: bool | None = False,
|
none_on_template_error: bool | None = False,
|
||||||
):
|
) -> None:
|
||||||
"""Template attribute."""
|
"""Template attribute."""
|
||||||
self._entity = entity
|
self._entity = entity
|
||||||
self._attribute = attribute
|
self._attribute = attribute
|
||||||
|
|
|
@ -29,7 +29,7 @@ class TriggerEntity(update_coordinator.CoordinatorEntity):
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
coordinator: TriggerUpdateCoordinator,
|
coordinator: TriggerUpdateCoordinator,
|
||||||
config: dict,
|
config: dict,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ class TeslaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
"""Initialize the tesla flow."""
|
"""Initialize the tesla flow."""
|
||||||
self.username = None
|
self.username = None
|
||||||
self.reauth = False
|
self.reauth = False
|
||||||
|
|
|
@ -188,7 +188,7 @@ class TimerStorageCollection(collection.StorageCollection):
|
||||||
class Timer(RestoreEntity):
|
class Timer(RestoreEntity):
|
||||||
"""Representation of a timer."""
|
"""Representation of a timer."""
|
||||||
|
|
||||||
def __init__(self, config: dict):
|
def __init__(self, config: dict) -> None:
|
||||||
"""Initialize a timer."""
|
"""Initialize a timer."""
|
||||||
self._config: dict = config
|
self._config: dict = config
|
||||||
self.editable: bool = True
|
self.editable: bool = True
|
||||||
|
|
|
@ -27,7 +27,7 @@ class ToonDataUpdateCoordinator(DataUpdateCoordinator[Status]):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, hass: HomeAssistant, *, entry: ConfigEntry, session: OAuth2Session
|
self, hass: HomeAssistant, *, entry: ConfigEntry, session: OAuth2Session
|
||||||
):
|
) -> None:
|
||||||
"""Initialize global Toon data updater."""
|
"""Initialize global Toon data updater."""
|
||||||
self.session = session
|
self.session = session
|
||||||
self.entry = entry
|
self.entry = entry
|
||||||
|
|
|
@ -58,7 +58,7 @@ class ToonLocalOAuth2Implementation(config_entry_oauth2_flow.LocalOAuth2Implemen
|
||||||
name: str,
|
name: str,
|
||||||
tenant_id: str,
|
tenant_id: str,
|
||||||
issuer: str | None = None,
|
issuer: str | None = None,
|
||||||
):
|
) -> None:
|
||||||
"""Local Toon Oauth Implementation."""
|
"""Local Toon Oauth Implementation."""
|
||||||
self._name = name
|
self._name = name
|
||||||
self.tenant_id = tenant_id
|
self.tenant_id = tenant_id
|
||||||
|
|
|
@ -32,7 +32,7 @@ class SmartDevices:
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, lights: list[SmartDevice] = None, switches: list[SmartDevice] = None
|
self, lights: list[SmartDevice] = None, switches: list[SmartDevice] = None
|
||||||
):
|
) -> None:
|
||||||
"""Initialize device holder."""
|
"""Initialize device holder."""
|
||||||
self._lights = lights or []
|
self._lights = lights or []
|
||||||
self._switches = switches or []
|
self._switches = switches or []
|
||||||
|
|
|
@ -46,7 +46,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry, async_add_entitie
|
||||||
class SmartPlugSwitch(SwitchEntity):
|
class SmartPlugSwitch(SwitchEntity):
|
||||||
"""Representation of a TPLink Smart Plug switch."""
|
"""Representation of a TPLink Smart Plug switch."""
|
||||||
|
|
||||||
def __init__(self, smartplug: SmartPlug):
|
def __init__(self, smartplug: SmartPlug) -> None:
|
||||||
"""Initialize the switch."""
|
"""Initialize the switch."""
|
||||||
self.smartplug = smartplug
|
self.smartplug = smartplug
|
||||||
self._sysinfo = None
|
self._sysinfo = None
|
||||||
|
|
|
@ -60,7 +60,7 @@ class ActionTrace:
|
||||||
config: dict[str, Any],
|
config: dict[str, Any],
|
||||||
blueprint_inputs: dict[str, Any],
|
blueprint_inputs: dict[str, Any],
|
||||||
context: Context,
|
context: Context,
|
||||||
):
|
) -> None:
|
||||||
"""Container for script trace."""
|
"""Container for script trace."""
|
||||||
self._trace: dict[str, deque[TraceElement]] | None = None
|
self._trace: dict[str, deque[TraceElement]] | None = None
|
||||||
self._config: dict[str, Any] = config
|
self._config: dict[str, Any] = config
|
||||||
|
|
|
@ -83,7 +83,7 @@ class TuyaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
|
||||||
VERSION = 1
|
VERSION = 1
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
"""Initialize flow."""
|
"""Initialize flow."""
|
||||||
self._country_code = None
|
self._country_code = None
|
||||||
self._password = None
|
self._password = None
|
||||||
|
@ -151,7 +151,7 @@ class TuyaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Handle a option flow for Tuya."""
|
"""Handle a option flow for Tuya."""
|
||||||
|
|
||||||
def __init__(self, config_entry: config_entries.ConfigEntry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
self._conf_devs_id = None
|
self._conf_devs_id = None
|
||||||
|
|
|
@ -47,7 +47,7 @@ class TwinklyLight(LightEntity):
|
||||||
self,
|
self,
|
||||||
conf: ConfigEntry,
|
conf: ConfigEntry,
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize a TwinklyLight entity."""
|
"""Initialize a TwinklyLight entity."""
|
||||||
self._id = conf.data[CONF_ENTRY_ID]
|
self._id = conf.data[CONF_ENTRY_ID]
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
|
|
|
@ -54,7 +54,7 @@ async def async_get_scanner(hass, config):
|
||||||
class UPCDeviceScanner(DeviceScanner):
|
class UPCDeviceScanner(DeviceScanner):
|
||||||
"""This class queries a router running UPC ConnectBox firmware."""
|
"""This class queries a router running UPC ConnectBox firmware."""
|
||||||
|
|
||||||
def __init__(self, connect_box: ConnectBox):
|
def __init__(self, connect_box: ConnectBox) -> None:
|
||||||
"""Initialize the scanner."""
|
"""Initialize the scanner."""
|
||||||
self.connect_box: ConnectBox = connect_box
|
self.connect_box: ConnectBox = connect_box
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class UpCloudConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
class UpCloudOptionsFlow(config_entries.OptionsFlow):
|
class UpCloudOptionsFlow(config_entries.OptionsFlow):
|
||||||
"""UpCloud options flow."""
|
"""UpCloud options flow."""
|
||||||
|
|
||||||
def __init__(self, config_entry: config_entries.ConfigEntry):
|
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||||
"""Initialize options flow."""
|
"""Initialize options flow."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,9 @@ RESPONSE_SCHEMA = vol.Schema(
|
||||||
class Updater:
|
class Updater:
|
||||||
"""Updater class for data exchange."""
|
"""Updater class for data exchange."""
|
||||||
|
|
||||||
def __init__(self, update_available: bool, newest_version: str, release_notes: str):
|
def __init__(
|
||||||
|
self, update_available: bool, newest_version: str, release_notes: str
|
||||||
|
) -> None:
|
||||||
"""Initialize attributes."""
|
"""Initialize attributes."""
|
||||||
self.update_available = update_available
|
self.update_available = update_available
|
||||||
self.release_notes = release_notes
|
self.release_notes = release_notes
|
||||||
|
|
|
@ -212,7 +212,9 @@ DeviceType = TypeVar("DeviceType", bound=veraApi.VeraDevice)
|
||||||
class VeraDevice(Generic[DeviceType], Entity):
|
class VeraDevice(Generic[DeviceType], Entity):
|
||||||
"""Representation of a Vera device entity."""
|
"""Representation of a Vera device entity."""
|
||||||
|
|
||||||
def __init__(self, vera_device: DeviceType, controller_data: ControllerData):
|
def __init__(
|
||||||
|
self, vera_device: DeviceType, controller_data: ControllerData
|
||||||
|
) -> None:
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
self.vera_device = vera_device
|
self.vera_device = vera_device
|
||||||
self.controller = controller_data.controller
|
self.controller = controller_data.controller
|
||||||
|
|
|
@ -37,7 +37,7 @@ class VeraBinarySensor(VeraDevice[veraApi.VeraBinarySensor], BinarySensorEntity)
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, vera_device: veraApi.VeraBinarySensor, controller_data: ControllerData
|
self, vera_device: veraApi.VeraBinarySensor, controller_data: ControllerData
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the binary_sensor."""
|
"""Initialize the binary_sensor."""
|
||||||
self._state = False
|
self._state = False
|
||||||
VeraDevice.__init__(self, vera_device, controller_data)
|
VeraDevice.__init__(self, vera_device, controller_data)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class VeraThermostat(VeraDevice[veraApi.VeraThermostat], ClimateEntity):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, vera_device: veraApi.VeraThermostat, controller_data: ControllerData
|
self, vera_device: veraApi.VeraThermostat, controller_data: ControllerData
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the Vera device."""
|
"""Initialize the Vera device."""
|
||||||
VeraDevice.__init__(self, vera_device, controller_data)
|
VeraDevice.__init__(self, vera_device, controller_data)
|
||||||
self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)
|
self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)
|
||||||
|
|
|
@ -67,7 +67,7 @@ def options_data(user_input: dict) -> dict:
|
||||||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||||
"""Options for the component."""
|
"""Options for the component."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry):
|
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||||
"""Init object."""
|
"""Init object."""
|
||||||
self.config_entry = config_entry
|
self.config_entry = config_entry
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class VeraCover(VeraDevice[veraApi.VeraCurtain], CoverEntity):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, vera_device: veraApi.VeraCurtain, controller_data: ControllerData
|
self, vera_device: veraApi.VeraCurtain, controller_data: ControllerData
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the Vera device."""
|
"""Initialize the Vera device."""
|
||||||
VeraDevice.__init__(self, vera_device, controller_data)
|
VeraDevice.__init__(self, vera_device, controller_data)
|
||||||
self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)
|
self.entity_id = ENTITY_ID_FORMAT.format(self.vera_id)
|
||||||
|
|
|
@ -44,7 +44,7 @@ class VeraLight(VeraDevice[veraApi.VeraDimmer], LightEntity):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, vera_device: veraApi.VeraDimmer, controller_data: ControllerData
|
self, vera_device: veraApi.VeraDimmer, controller_data: ControllerData
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the light."""
|
"""Initialize the light."""
|
||||||
self._state = False
|
self._state = False
|
||||||
self._color = None
|
self._color = None
|
||||||
|
|
|
@ -41,7 +41,9 @@ async def async_setup_entry(
|
||||||
class VeraLock(VeraDevice[veraApi.VeraLock], LockEntity):
|
class VeraLock(VeraDevice[veraApi.VeraLock], LockEntity):
|
||||||
"""Representation of a Vera lock."""
|
"""Representation of a Vera lock."""
|
||||||
|
|
||||||
def __init__(self, vera_device: veraApi.VeraLock, controller_data: ControllerData):
|
def __init__(
|
||||||
|
self, vera_device: veraApi.VeraLock, controller_data: ControllerData
|
||||||
|
) -> None:
|
||||||
"""Initialize the Vera device."""
|
"""Initialize the Vera device."""
|
||||||
self._state = None
|
self._state = None
|
||||||
VeraDevice.__init__(self, vera_device, controller_data)
|
VeraDevice.__init__(self, vera_device, controller_data)
|
||||||
|
|
|
@ -30,7 +30,9 @@ async def async_setup_entry(
|
||||||
class VeraScene(Scene):
|
class VeraScene(Scene):
|
||||||
"""Representation of a Vera scene entity."""
|
"""Representation of a Vera scene entity."""
|
||||||
|
|
||||||
def __init__(self, vera_scene: veraApi.VeraScene, controller_data: ControllerData):
|
def __init__(
|
||||||
|
self, vera_scene: veraApi.VeraScene, controller_data: ControllerData
|
||||||
|
) -> None:
|
||||||
"""Initialize the scene."""
|
"""Initialize the scene."""
|
||||||
self.vera_scene = vera_scene
|
self.vera_scene = vera_scene
|
||||||
self.controller = controller_data.controller
|
self.controller = controller_data.controller
|
||||||
|
|
|
@ -44,7 +44,7 @@ class VeraSensor(VeraDevice[veraApi.VeraSensor], SensorEntity):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, vera_device: veraApi.VeraSensor, controller_data: ControllerData
|
self, vera_device: veraApi.VeraSensor, controller_data: ControllerData
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self.current_value = None
|
self.current_value = None
|
||||||
self._temperature_units = None
|
self._temperature_units = None
|
||||||
|
|
|
@ -40,7 +40,7 @@ class VeraSwitch(VeraDevice[veraApi.VeraSwitch], SwitchEntity):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, vera_device: veraApi.VeraSwitch, controller_data: ControllerData
|
self, vera_device: veraApi.VeraSwitch, controller_data: ControllerData
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the Vera device."""
|
"""Initialize the Vera device."""
|
||||||
self._state = False
|
self._state = False
|
||||||
VeraDevice.__init__(self, vera_device, controller_data)
|
VeraDevice.__init__(self, vera_device, controller_data)
|
||||||
|
|
|
@ -53,7 +53,7 @@ class VerisureSmartcam(CoordinatorEntity, Camera):
|
||||||
coordinator: VerisureDataUpdateCoordinator,
|
coordinator: VerisureDataUpdateCoordinator,
|
||||||
serial_number: str,
|
serial_number: str,
|
||||||
directory_path: str,
|
directory_path: str,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize Verisure File Camera component."""
|
"""Initialize Verisure File Camera component."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
Camera.__init__(self)
|
Camera.__init__(self)
|
||||||
|
|
|
@ -111,7 +111,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
|
||||||
class VersionData:
|
class VersionData:
|
||||||
"""Get the latest data and update the states."""
|
"""Get the latest data and update the states."""
|
||||||
|
|
||||||
def __init__(self, api: HaVersion):
|
def __init__(self, api: HaVersion) -> None:
|
||||||
"""Initialize the data object."""
|
"""Initialize the data object."""
|
||||||
self.api = api
|
self.api = api
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ class VersionData:
|
||||||
class VersionSensor(SensorEntity):
|
class VersionSensor(SensorEntity):
|
||||||
"""Representation of a Home Assistant version sensor."""
|
"""Representation of a Home Assistant version sensor."""
|
||||||
|
|
||||||
def __init__(self, data: VersionData, name: str):
|
def __init__(self, data: VersionData, name: str) -> None:
|
||||||
"""Initialize the Version sensor."""
|
"""Initialize the Version sensor."""
|
||||||
self.data = data
|
self.data = data
|
||||||
self._name = name
|
self._name = name
|
||||||
|
|
|
@ -131,7 +131,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||||
class WemoDispatcher:
|
class WemoDispatcher:
|
||||||
"""Dispatch WeMo devices to the correct platform."""
|
"""Dispatch WeMo devices to the correct platform."""
|
||||||
|
|
||||||
def __init__(self, config_entry: ConfigEntry):
|
def __init__(self, config_entry: ConfigEntry) -> None:
|
||||||
"""Initialize the WemoDispatcher."""
|
"""Initialize the WemoDispatcher."""
|
||||||
self._config_entry = config_entry
|
self._config_entry = config_entry
|
||||||
self._added_serial_numbers = set()
|
self._added_serial_numbers = set()
|
||||||
|
|
|
@ -480,7 +480,7 @@ class ConfigEntryWithingsApi(AbstractWithingsApi):
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
implementation: AbstractOAuth2Implementation,
|
implementation: AbstractOAuth2Implementation,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize object."""
|
"""Initialize object."""
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
self._config_entry = config_entry
|
self._config_entry = config_entry
|
||||||
|
@ -564,7 +564,7 @@ class DataManager:
|
||||||
api: ConfigEntryWithingsApi,
|
api: ConfigEntryWithingsApi,
|
||||||
user_id: int,
|
user_id: int,
|
||||||
webhook_config: WebhookConfig,
|
webhook_config: WebhookConfig,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the data manager."""
|
"""Initialize the data manager."""
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
self._api = api
|
self._api = api
|
||||||
|
|
|
@ -102,7 +102,7 @@ class WLEDDataUpdateCoordinator(DataUpdateCoordinator[WLEDDevice]):
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
*,
|
*,
|
||||||
host: str,
|
host: str,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize global WLED data updater."""
|
"""Initialize global WLED data updater."""
|
||||||
self.wled = WLED(host, session=async_get_clientsession(hass))
|
self.wled = WLED(host, session=async_get_clientsession(hass))
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,7 @@ async def async_setup_entry(
|
||||||
class WLEDMasterLight(LightEntity, WLEDDeviceEntity):
|
class WLEDMasterLight(LightEntity, WLEDDeviceEntity):
|
||||||
"""Defines a WLED master light."""
|
"""Defines a WLED master light."""
|
||||||
|
|
||||||
def __init__(self, entry_id: str, coordinator: WLEDDataUpdateCoordinator):
|
def __init__(self, entry_id: str, coordinator: WLEDDataUpdateCoordinator) -> None:
|
||||||
"""Initialize WLED master light."""
|
"""Initialize WLED master light."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
entry_id=entry_id,
|
entry_id=entry_id,
|
||||||
|
@ -177,7 +177,7 @@ class WLEDSegmentLight(LightEntity, WLEDDeviceEntity):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, entry_id: str, coordinator: WLEDDataUpdateCoordinator, segment: int
|
self, entry_id: str, coordinator: WLEDDataUpdateCoordinator, segment: int
|
||||||
):
|
) -> None:
|
||||||
"""Initialize WLED segment light."""
|
"""Initialize WLED segment light."""
|
||||||
self._rgbw = coordinator.data.info.leds.rgbw
|
self._rgbw = coordinator.data.info.leds.rgbw
|
||||||
self._segment = segment
|
self._segment = segment
|
||||||
|
|
|
@ -135,7 +135,7 @@ class WLEDSyncSendSwitch(WLEDSwitch):
|
||||||
class WLEDSyncReceiveSwitch(WLEDSwitch):
|
class WLEDSyncReceiveSwitch(WLEDSwitch):
|
||||||
"""Defines a WLED sync receive switch."""
|
"""Defines a WLED sync receive switch."""
|
||||||
|
|
||||||
def __init__(self, entry_id: str, coordinator: WLEDDataUpdateCoordinator):
|
def __init__(self, entry_id: str, coordinator: WLEDDataUpdateCoordinator) -> None:
|
||||||
"""Initialize WLED sync receive switch."""
|
"""Initialize WLED sync receive switch."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
coordinator=coordinator,
|
coordinator=coordinator,
|
||||||
|
|
|
@ -74,7 +74,7 @@ class WUSensorConfig:
|
||||||
icon: str = "mdi:gauge",
|
icon: str = "mdi:gauge",
|
||||||
extra_state_attributes=None,
|
extra_state_attributes=None,
|
||||||
device_class=None,
|
device_class=None,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize sensor configuration.
|
"""Initialize sensor configuration.
|
||||||
|
|
||||||
:param friendly_name: Friendly name
|
:param friendly_name: Friendly name
|
||||||
|
@ -106,7 +106,7 @@ class WUCurrentConditionsSensorConfig(WUSensorConfig):
|
||||||
icon: str | None = "mdi:gauge",
|
icon: str | None = "mdi:gauge",
|
||||||
unit_of_measurement: str | None = None,
|
unit_of_measurement: str | None = None,
|
||||||
device_class=None,
|
device_class=None,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize current conditions sensor configuration.
|
"""Initialize current conditions sensor configuration.
|
||||||
|
|
||||||
:param friendly_name: Friendly name of sensor
|
:param friendly_name: Friendly name of sensor
|
||||||
|
@ -133,7 +133,9 @@ class WUCurrentConditionsSensorConfig(WUSensorConfig):
|
||||||
class WUDailyTextForecastSensorConfig(WUSensorConfig):
|
class WUDailyTextForecastSensorConfig(WUSensorConfig):
|
||||||
"""Helper for defining sensor configurations for daily text forecasts."""
|
"""Helper for defining sensor configurations for daily text forecasts."""
|
||||||
|
|
||||||
def __init__(self, period: int, field: str, unit_of_measurement: str | None = None):
|
def __init__(
|
||||||
|
self, period: int, field: str, unit_of_measurement: str | None = None
|
||||||
|
) -> None:
|
||||||
"""Initialize daily text forecast sensor configuration.
|
"""Initialize daily text forecast sensor configuration.
|
||||||
|
|
||||||
:param period: forecast period number
|
:param period: forecast period number
|
||||||
|
@ -170,7 +172,7 @@ class WUDailySimpleForecastSensorConfig(WUSensorConfig):
|
||||||
ha_unit: str | None = None,
|
ha_unit: str | None = None,
|
||||||
icon=None,
|
icon=None,
|
||||||
device_class=None,
|
device_class=None,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize daily simple forecast sensor configuration.
|
"""Initialize daily simple forecast sensor configuration.
|
||||||
|
|
||||||
:param friendly_name: friendly_name of the sensor
|
:param friendly_name: friendly_name of the sensor
|
||||||
|
@ -213,7 +215,7 @@ class WUDailySimpleForecastSensorConfig(WUSensorConfig):
|
||||||
class WUHourlyForecastSensorConfig(WUSensorConfig):
|
class WUHourlyForecastSensorConfig(WUSensorConfig):
|
||||||
"""Helper for defining sensor configurations for hourly text forecasts."""
|
"""Helper for defining sensor configurations for hourly text forecasts."""
|
||||||
|
|
||||||
def __init__(self, period: int, field: int):
|
def __init__(self, period: int, field: int) -> None:
|
||||||
"""Initialize hourly forecast sensor configuration.
|
"""Initialize hourly forecast sensor configuration.
|
||||||
|
|
||||||
:param period: forecast period number
|
:param period: forecast period number
|
||||||
|
@ -280,7 +282,7 @@ class WUAlmanacSensorConfig(WUSensorConfig):
|
||||||
unit_of_measurement: str,
|
unit_of_measurement: str,
|
||||||
icon: str,
|
icon: str,
|
||||||
device_class=None,
|
device_class=None,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize almanac sensor configuration.
|
"""Initialize almanac sensor configuration.
|
||||||
|
|
||||||
:param friendly_name: Friendly name
|
:param friendly_name: Friendly name
|
||||||
|
@ -303,7 +305,7 @@ class WUAlmanacSensorConfig(WUSensorConfig):
|
||||||
class WUAlertsSensorConfig(WUSensorConfig):
|
class WUAlertsSensorConfig(WUSensorConfig):
|
||||||
"""Helper for defining field configuration for alerts."""
|
"""Helper for defining field configuration for alerts."""
|
||||||
|
|
||||||
def __init__(self, friendly_name: str | Callable):
|
def __init__(self, friendly_name: str | Callable) -> None:
|
||||||
"""Initialiize alerts sensor configuration.
|
"""Initialiize alerts sensor configuration.
|
||||||
|
|
||||||
:param friendly_name: Friendly name
|
:param friendly_name: Friendly name
|
||||||
|
@ -1120,7 +1122,9 @@ async def async_setup_platform(
|
||||||
class WUndergroundSensor(SensorEntity):
|
class WUndergroundSensor(SensorEntity):
|
||||||
"""Implementing the WUnderground sensor."""
|
"""Implementing the WUnderground sensor."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, rest, condition, unique_id_base: str):
|
def __init__(
|
||||||
|
self, hass: HomeAssistant, rest, condition, unique_id_base: str
|
||||||
|
) -> None:
|
||||||
"""Initialize the sensor."""
|
"""Initialize the sensor."""
|
||||||
self.rest = rest
|
self.rest = rest
|
||||||
self._condition = condition
|
self._condition = condition
|
||||||
|
|
|
@ -14,7 +14,7 @@ class AsyncConfigEntryAuth(AuthenticationManager):
|
||||||
self,
|
self,
|
||||||
websession: ClientSession,
|
websession: ClientSession,
|
||||||
oauth_session: config_entry_oauth2_flow.OAuth2Session,
|
oauth_session: config_entry_oauth2_flow.OAuth2Session,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize xbox auth."""
|
"""Initialize xbox auth."""
|
||||||
# Leaving out client credentials as they are handled by Home Assistant
|
# Leaving out client credentials as they are handled by Home Assistant
|
||||||
super().__init__(websession, "", "", "")
|
super().__init__(websession, "", "", "")
|
||||||
|
|
|
@ -12,7 +12,9 @@ from .const import DOMAIN
|
||||||
class XboxBaseSensorEntity(CoordinatorEntity):
|
class XboxBaseSensorEntity(CoordinatorEntity):
|
||||||
"""Base Sensor for the Xbox Integration."""
|
"""Base Sensor for the Xbox Integration."""
|
||||||
|
|
||||||
def __init__(self, coordinator: XboxUpdateCoordinator, xuid: str, attribute: str):
|
def __init__(
|
||||||
|
self, coordinator: XboxUpdateCoordinator, xuid: str, attribute: str
|
||||||
|
) -> None:
|
||||||
"""Initialize Xbox binary sensor."""
|
"""Initialize Xbox binary sensor."""
|
||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self.xuid = xuid
|
self.xuid = xuid
|
||||||
|
|
|
@ -74,7 +74,7 @@ class XboxSource(MediaSource):
|
||||||
|
|
||||||
name: str = "Xbox Game Media"
|
name: str = "Xbox Game Media"
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, client: XboxLiveClient):
|
def __init__(self, hass: HomeAssistant, client: XboxLiveClient) -> None:
|
||||||
"""Initialize Xbox source."""
|
"""Initialize Xbox source."""
|
||||||
super().__init__(DOMAIN)
|
super().__init__(DOMAIN)
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
class YamahaConfigInfo:
|
class YamahaConfigInfo:
|
||||||
"""Configuration Info for Yamaha Receivers."""
|
"""Configuration Info for Yamaha Receivers."""
|
||||||
|
|
||||||
def __init__(self, config: None, discovery_info: None):
|
def __init__(self, config: None, discovery_info: None) -> None:
|
||||||
"""Initialize the Configuration Info for Yamaha Receiver."""
|
"""Initialize the Configuration Info for Yamaha Receiver."""
|
||||||
self.name = config.get(CONF_NAME)
|
self.name = config.get(CONF_NAME)
|
||||||
self.host = config.get(CONF_HOST)
|
self.host = config.get(CONF_HOST)
|
||||||
|
|
|
@ -316,7 +316,7 @@ class YeelightScanner:
|
||||||
cls._scanner = cls(hass)
|
cls._scanner = cls(hass)
|
||||||
return cls._scanner
|
return cls._scanner
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant):
|
def __init__(self, hass: HomeAssistant) -> None:
|
||||||
"""Initialize class."""
|
"""Initialize class."""
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
self._seen = {}
|
self._seen = {}
|
||||||
|
@ -573,7 +573,7 @@ class YeelightDevice:
|
||||||
class YeelightEntity(Entity):
|
class YeelightEntity(Entity):
|
||||||
"""Represents single Yeelight entity."""
|
"""Represents single Yeelight entity."""
|
||||||
|
|
||||||
def __init__(self, device: YeelightDevice, entry: ConfigEntry):
|
def __init__(self, device: YeelightDevice, entry: ConfigEntry) -> None:
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
self._device = device
|
self._device = device
|
||||||
self._unique_id = entry.entry_id
|
self._unique_id = entry.entry_id
|
||||||
|
|
|
@ -176,7 +176,7 @@ class Channels:
|
||||||
class ChannelPool:
|
class ChannelPool:
|
||||||
"""All channels of an endpoint."""
|
"""All channels of an endpoint."""
|
||||||
|
|
||||||
def __init__(self, channels: Channels, ep_id: int):
|
def __init__(self, channels: Channels, ep_id: int) -> None:
|
||||||
"""Initialize instance."""
|
"""Initialize instance."""
|
||||||
self._all_channels: ChannelsDict = {}
|
self._all_channels: ChannelsDict = {}
|
||||||
self._channels: Channels = channels
|
self._channels: Channels = channels
|
||||||
|
|
|
@ -258,7 +258,7 @@ class RadioType(enum.Enum):
|
||||||
return radio.name
|
return radio.name
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
def __init__(self, description: str, controller_cls: CALLABLE_T):
|
def __init__(self, description: str, controller_cls: CALLABLE_T) -> None:
|
||||||
"""Init instance."""
|
"""Init instance."""
|
||||||
self._desc = description
|
self._desc = description
|
||||||
self._ctrl_cls = controller_cls
|
self._ctrl_cls = controller_cls
|
||||||
|
|
|
@ -91,7 +91,7 @@ class ZHADevice(LogMixin):
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
zigpy_device: zha_typing.ZigpyDeviceType,
|
zigpy_device: zha_typing.ZigpyDeviceType,
|
||||||
zha_gateway: zha_typing.ZhaGatewayType,
|
zha_gateway: zha_typing.ZhaGatewayType,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the gateway."""
|
"""Initialize the gateway."""
|
||||||
self.hass = hass
|
self.hass = hass
|
||||||
self._zigpy_device = zigpy_device
|
self._zigpy_device = zigpy_device
|
||||||
|
|
|
@ -33,7 +33,7 @@ class ZHAGroupMember(LogMixin):
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, zha_group: ZhaGroupType, zha_device: ZhaDeviceType, endpoint_id: int
|
self, zha_group: ZhaGroupType, zha_device: ZhaDeviceType, endpoint_id: int
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the group member."""
|
"""Initialize the group member."""
|
||||||
self._zha_group: ZhaGroupType = zha_group
|
self._zha_group: ZhaGroupType = zha_group
|
||||||
self._zha_device: ZhaDeviceType = zha_device
|
self._zha_device: ZhaDeviceType = zha_device
|
||||||
|
@ -116,7 +116,7 @@ class ZHAGroup(LogMixin):
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
zha_gateway: ZhaGatewayType,
|
zha_gateway: ZhaGatewayType,
|
||||||
zigpy_group: ZigpyGroupType,
|
zigpy_group: ZigpyGroupType,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the group."""
|
"""Initialize the group."""
|
||||||
self.hass: HomeAssistant = hass
|
self.hass: HomeAssistant = hass
|
||||||
self._zigpy_group: ZigpyGroupType = zigpy_group
|
self._zigpy_group: ZigpyGroupType = zigpy_group
|
||||||
|
|
|
@ -183,7 +183,7 @@ class Shade(ZhaEntity, CoverEntity):
|
||||||
zha_device: ZhaDeviceType,
|
zha_device: ZhaDeviceType,
|
||||||
channels: list[ChannelType],
|
channels: list[ChannelType],
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
) -> None:
|
||||||
"""Initialize the ZHA light."""
|
"""Initialize the ZHA light."""
|
||||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||||
self._on_off_channel = self.cluster_channels[CHANNEL_ON_OFF]
|
self._on_off_channel = self.cluster_channels[CHANNEL_ON_OFF]
|
||||||
|
|
|
@ -40,7 +40,7 @@ UPDATE_GROUP_FROM_CHILD_DELAY = 0.2
|
||||||
class BaseZhaEntity(LogMixin, entity.Entity):
|
class BaseZhaEntity(LogMixin, entity.Entity):
|
||||||
"""A base class for ZHA entities."""
|
"""A base class for ZHA entities."""
|
||||||
|
|
||||||
def __init__(self, unique_id: str, zha_device: ZhaDeviceType, **kwargs):
|
def __init__(self, unique_id: str, zha_device: ZhaDeviceType, **kwargs) -> None:
|
||||||
"""Init ZHA entity."""
|
"""Init ZHA entity."""
|
||||||
self._name: str = ""
|
self._name: str = ""
|
||||||
self._force_update: bool = False
|
self._force_update: bool = False
|
||||||
|
@ -147,7 +147,7 @@ class ZhaEntity(BaseZhaEntity, RestoreEntity):
|
||||||
zha_device: ZhaDeviceType,
|
zha_device: ZhaDeviceType,
|
||||||
channels: list[ChannelType],
|
channels: list[ChannelType],
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
) -> None:
|
||||||
"""Init ZHA entity."""
|
"""Init ZHA entity."""
|
||||||
super().__init__(unique_id, zha_device, **kwargs)
|
super().__init__(unique_id, zha_device, **kwargs)
|
||||||
ieeetail = "".join([f"{o:02x}" for o in zha_device.ieee[:4]])
|
ieeetail = "".join([f"{o:02x}" for o in zha_device.ieee[:4]])
|
||||||
|
|
|
@ -109,7 +109,7 @@ class Sensor(ZhaEntity, SensorEntity):
|
||||||
zha_device: ZhaDeviceType,
|
zha_device: ZhaDeviceType,
|
||||||
channels: list[ChannelType],
|
channels: list[ChannelType],
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
) -> None:
|
||||||
"""Init this sensor."""
|
"""Init this sensor."""
|
||||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||||
self._channel: ChannelType = channels[0]
|
self._channel: ChannelType = channels[0]
|
||||||
|
|
|
@ -279,7 +279,7 @@ async def async_unload_entry(
|
||||||
class Zone(entity.Entity):
|
class Zone(entity.Entity):
|
||||||
"""Representation of a Zone."""
|
"""Representation of a Zone."""
|
||||||
|
|
||||||
def __init__(self, config: dict):
|
def __init__(self, config: dict) -> None:
|
||||||
"""Initialize the zone."""
|
"""Initialize the zone."""
|
||||||
self._config = config
|
self._config = config
|
||||||
self.editable = True
|
self.editable = True
|
||||||
|
|
|
@ -55,7 +55,7 @@ BITMASK_SCHEMA = vol.All(
|
||||||
class ZWaveServices:
|
class ZWaveServices:
|
||||||
"""Class that holds our services (Zwave Commands) that should be published to hass."""
|
"""Class that holds our services (Zwave Commands) that should be published to hass."""
|
||||||
|
|
||||||
def __init__(self, hass: HomeAssistant, ent_reg: EntityRegistry):
|
def __init__(self, hass: HomeAssistant, ent_reg: EntityRegistry) -> None:
|
||||||
"""Initialize with hass object."""
|
"""Initialize with hass object."""
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
self._ent_reg = ent_reg
|
self._ent_reg = ent_reg
|
||||||
|
|
Loading…
Reference in New Issue