Add constructor return type in integrations L-N (#50888)
* Add constructor return type in integrations L-N * Small fixpull/49717/head^2
parent
f3db819548
commit
e06a2a53c4
|
@ -488,7 +488,7 @@ class Profile:
|
|||
class Profiles:
|
||||
"""Representation of available color profiles."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant):
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
"""Initialize profiles."""
|
||||
self.hass = hass
|
||||
self.data: dict[str, Profile] = {}
|
||||
|
|
|
@ -52,7 +52,7 @@ class ResourceStorageCollection(collection.StorageCollection):
|
|||
CREATE_SCHEMA = vol.Schema(RESOURCE_CREATE_FIELDS)
|
||||
UPDATE_SCHEMA = vol.Schema(RESOURCE_UPDATE_FIELDS)
|
||||
|
||||
def __init__(self, hass: HomeAssistant, ll_config: LovelaceConfig):
|
||||
def __init__(self, hass: HomeAssistant, ll_config: LovelaceConfig) -> None:
|
||||
"""Initialize the storage collection."""
|
||||
super().__init__(
|
||||
storage.Store(hass, RESOURCES_STORAGE_VERSION, RESOURCE_STORAGE_KEY),
|
||||
|
|
|
@ -18,7 +18,7 @@ class ConfigEntryLyricClient(LyricClient):
|
|||
self,
|
||||
websession: ClientSession,
|
||||
oauth_session: config_entry_oauth2_flow.OAuth2Session,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize Honeywell Lyric auth."""
|
||||
super().__init__(websession)
|
||||
self._oauth_session = oauth_session
|
||||
|
|
|
@ -1161,7 +1161,7 @@ class BrowseMedia:
|
|||
children: list[BrowseMedia] | None = None,
|
||||
children_media_class: str | None = None,
|
||||
thumbnail: str | None = None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize browse media item."""
|
||||
self.media_class = media_class
|
||||
self.media_content_id = media_content_id
|
||||
|
|
|
@ -30,7 +30,7 @@ class LocalSource(MediaSource):
|
|||
|
||||
name: str = "Local Media"
|
||||
|
||||
def __init__(self, hass: HomeAssistant):
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
"""Initialize local source."""
|
||||
super().__init__(DOMAIN)
|
||||
self.hass = hass
|
||||
|
@ -183,7 +183,7 @@ class LocalMediaView(HomeAssistantView):
|
|||
url = "/media/{source_dir_id}/{location:.*}"
|
||||
name = "media"
|
||||
|
||||
def __init__(self, hass: HomeAssistant, source: LocalSource):
|
||||
def __init__(self, hass: HomeAssistant, source: LocalSource) -> None:
|
||||
"""Initialize the media view."""
|
||||
self.hass = hass
|
||||
self.source = source
|
||||
|
|
|
@ -29,7 +29,7 @@ class BrowseMediaSource(BrowseMedia):
|
|||
|
||||
children: list[BrowseMediaSource] | None
|
||||
|
||||
def __init__(self, *, domain: str | None, identifier: str | None, **kwargs):
|
||||
def __init__(self, *, domain: str | None, identifier: str | None, **kwargs) -> None:
|
||||
"""Initialize media source browse media."""
|
||||
media_content_id = f"{URI_SCHEME}{domain or ''}"
|
||||
if identifier:
|
||||
|
@ -106,7 +106,7 @@ class MediaSource(ABC):
|
|||
|
||||
name: str = None
|
||||
|
||||
def __init__(self, domain: str):
|
||||
def __init__(self, domain: str) -> None:
|
||||
"""Initialize a media source."""
|
||||
self.domain = domain
|
||||
if not self.name:
|
||||
|
|
|
@ -84,7 +84,7 @@ async def async_unload_entry(hass, config_entry):
|
|||
class MelCloudDevice:
|
||||
"""MELCloud Device instance."""
|
||||
|
||||
def __init__(self, device: Device):
|
||||
def __init__(self, device: Device) -> None:
|
||||
"""Construct a device wrapper."""
|
||||
self.device = device
|
||||
self.name = device.name
|
||||
|
|
|
@ -100,7 +100,7 @@ async def async_setup_entry(
|
|||
class MelCloudClimate(ClimateEntity):
|
||||
"""Base climate device."""
|
||||
|
||||
def __init__(self, device: MelCloudDevice):
|
||||
def __init__(self, device: MelCloudDevice) -> None:
|
||||
"""Initialize the climate."""
|
||||
self.api = device
|
||||
self._base_device = self.api.device
|
||||
|
|
|
@ -113,7 +113,7 @@ class MeteoFranceFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
class MeteoFranceOptionsFlowHandler(config_entries.OptionsFlow):
|
||||
"""Handle a option flow."""
|
||||
|
||||
def __init__(self, config_entry: config_entries.ConfigEntry):
|
||||
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||
"""Initialize options flow."""
|
||||
self.config_entry = config_entry
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ async def async_setup_entry(
|
|||
class MeteoFranceSensor(CoordinatorEntity, SensorEntity):
|
||||
"""Representation of a Meteo-France sensor."""
|
||||
|
||||
def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator):
|
||||
def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator) -> None:
|
||||
"""Initialize the Meteo-France sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._type = sensor_type
|
||||
|
@ -194,7 +194,7 @@ class MeteoFranceRainSensor(MeteoFranceSensor):
|
|||
class MeteoFranceAlertSensor(MeteoFranceSensor):
|
||||
"""Representation of a Meteo-France alert sensor."""
|
||||
|
||||
def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator):
|
||||
def __init__(self, sensor_type: str, coordinator: DataUpdateCoordinator) -> None:
|
||||
"""Initialize the Meteo-France sensor."""
|
||||
super().__init__(sensor_type, coordinator)
|
||||
dept_code = self.coordinator.data.domain_id
|
||||
|
|
|
@ -68,7 +68,7 @@ async def async_setup_entry(
|
|||
class MeteoFranceWeather(CoordinatorEntity, WeatherEntity):
|
||||
"""Representation of a weather condition."""
|
||||
|
||||
def __init__(self, coordinator: DataUpdateCoordinator, mode: str):
|
||||
def __init__(self, coordinator: DataUpdateCoordinator, mode: str) -> None:
|
||||
"""Initialise the platform with a data instance and station name."""
|
||||
super().__init__(coordinator)
|
||||
self._city_name = self.coordinator.data.position["name"]
|
||||
|
|
|
@ -232,7 +232,7 @@ class MinioListener:
|
|||
prefix: str,
|
||||
suffix: str,
|
||||
events: list[str],
|
||||
):
|
||||
) -> None:
|
||||
"""Create Listener."""
|
||||
self._queue = queue
|
||||
self._endpoint = endpoint
|
||||
|
|
|
@ -89,7 +89,7 @@ class MinioEventThread(threading.Thread):
|
|||
prefix: str,
|
||||
suffix: str,
|
||||
events: list[str],
|
||||
):
|
||||
) -> None:
|
||||
"""Copy over all Minio client options."""
|
||||
super().__init__()
|
||||
self._queue = queue
|
||||
|
|
|
@ -26,7 +26,7 @@ def unique_id(webhook_id, sensor_unique_id):
|
|||
class MobileAppEntity(RestoreEntity):
|
||||
"""Representation of an mobile app entity."""
|
||||
|
||||
def __init__(self, config: dict, device: DeviceEntry, entry: ConfigEntry):
|
||||
def __init__(self, config: dict, device: DeviceEntry, entry: ConfigEntry) -> None:
|
||||
"""Initialize the entity."""
|
||||
self._config = config
|
||||
self._device = device
|
||||
|
|
|
@ -106,7 +106,7 @@ class ModbusThermostat(ClimateEntity):
|
|||
self,
|
||||
hub: ModbusHub,
|
||||
config: dict[str, Any],
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the modbus thermostat."""
|
||||
self._hub: ModbusHub = hub
|
||||
self._name = config[CONF_NAME]
|
||||
|
|
|
@ -74,7 +74,7 @@ class ModbusCover(CoverEntity, RestoreEntity):
|
|||
self,
|
||||
hub: ModbusHub,
|
||||
config: dict[str, Any],
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the modbus cover."""
|
||||
self._hub: ModbusHub = hub
|
||||
self._coil = config.get(CALL_TYPE_COIL)
|
||||
|
|
|
@ -52,7 +52,7 @@ async def async_setup_platform(
|
|||
class ModbusSwitch(SwitchEntity, RestoreEntity):
|
||||
"""Base class representing a Modbus switch."""
|
||||
|
||||
def __init__(self, hub: ModbusHub, config: dict):
|
||||
def __init__(self, hub: ModbusHub, config: dict) -> None:
|
||||
"""Initialize the switch."""
|
||||
self._hub: ModbusHub = hub
|
||||
self._name = config[CONF_NAME]
|
||||
|
|
|
@ -43,7 +43,7 @@ class MySensorsDevice:
|
|||
node_id: int,
|
||||
child_id: int,
|
||||
value_type: int,
|
||||
):
|
||||
) -> None:
|
||||
"""Set up the MySensors device."""
|
||||
self.gateway_id: GatewayId = gateway_id
|
||||
self.gateway: BaseAsyncGateway = gateway
|
||||
|
|
|
@ -108,7 +108,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigType) -> bool:
|
|||
class NeatoHub:
|
||||
"""A My Neato hub wrapper class."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, neato: Account):
|
||||
def __init__(self, hass: HomeAssistant, neato: Account) -> None:
|
||||
"""Initialize the Neato hub."""
|
||||
self._hass = hass
|
||||
self.my_neato: Account = neato
|
||||
|
|
|
@ -15,7 +15,7 @@ class ConfigEntryAuth(pybotvac.OAuthSession):
|
|||
hass: core.HomeAssistant,
|
||||
config_entry: config_entries.ConfigEntry,
|
||||
implementation: config_entry_oauth2_flow.AbstractOAuth2Implementation,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize Neato Botvac Auth."""
|
||||
self.hass = hass
|
||||
self.session = config_entry_oauth2_flow.OAuth2Session(
|
||||
|
|
|
@ -106,7 +106,7 @@ async def async_setup(hass: HomeAssistant, config: dict):
|
|||
class SignalUpdateCallback:
|
||||
"""An EventCallback invoked when new events arrive from subscriber."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant):
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
"""Initialize EventCallback."""
|
||||
self._hass = hass
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ class AsyncConfigEntryAuth(AbstractAuth):
|
|||
oauth_session: config_entry_oauth2_flow.OAuth2Session,
|
||||
client_id: str,
|
||||
client_secret: str,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize Google Nest Device Access auth."""
|
||||
super().__init__(websession, API_URL)
|
||||
self._oauth_session = oauth_session
|
||||
|
|
|
@ -56,7 +56,7 @@ async def async_setup_sdm_entry(
|
|||
class NestCamera(Camera):
|
||||
"""Devices that support cameras."""
|
||||
|
||||
def __init__(self, device: Device):
|
||||
def __init__(self, device: Device) -> None:
|
||||
"""Initialize the camera."""
|
||||
super().__init__()
|
||||
self._device = device
|
||||
|
|
|
@ -98,7 +98,7 @@ async def async_setup_sdm_entry(
|
|||
class ThermostatEntity(ClimateEntity):
|
||||
"""A nest thermostat climate entity."""
|
||||
|
||||
def __init__(self, device: Device):
|
||||
def __init__(self, device: Device) -> None:
|
||||
"""Initialize ThermostatEntity."""
|
||||
self._device = device
|
||||
self._device_info = DeviceInfo(device)
|
||||
|
|
|
@ -18,7 +18,7 @@ class DeviceInfo:
|
|||
|
||||
device_brand = "Google Nest"
|
||||
|
||||
def __init__(self, device: Device):
|
||||
def __init__(self, device: Device) -> None:
|
||||
"""Initialize the DeviceInfo."""
|
||||
self._device = device
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ async def async_setup_sdm_entry(
|
|||
class SensorBase(SensorEntity):
|
||||
"""Representation of a dynamically updated Sensor."""
|
||||
|
||||
def __init__(self, device: Device):
|
||||
def __init__(self, device: Device) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self._device = device
|
||||
self._device_info = DeviceInfo(device)
|
||||
|
|
|
@ -15,7 +15,7 @@ class ConfigEntryNetatmoAuth(pyatmo.auth.NetatmoOAuth2):
|
|||
hass: core.HomeAssistant,
|
||||
config_entry: config_entries.ConfigEntry,
|
||||
implementation: config_entry_oauth2_flow.AbstractOAuth2Implementation,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize Netatmo Auth."""
|
||||
self.hass = hass
|
||||
self.session = config_entry_oauth2_flow.OAuth2Session(
|
||||
|
|
|
@ -75,7 +75,7 @@ class NetatmoFlowHandler(
|
|||
class NetatmoOptionsFlowHandler(config_entries.OptionsFlow):
|
||||
"""Handle Netatmo options."""
|
||||
|
||||
def __init__(self, config_entry: config_entries.ConfigEntry):
|
||||
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||
"""Initialize Netatmo options flow."""
|
||||
self.config_entry = config_entry
|
||||
self.options = dict(config_entry.options)
|
||||
|
|
|
@ -52,7 +52,7 @@ SCAN_INTERVAL = 60
|
|||
class NetatmoDataHandler:
|
||||
"""Manages the Netatmo data handling."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, entry: ConfigEntry):
|
||||
def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||
"""Initialize self."""
|
||||
self.hass = hass
|
||||
self._auth = hass.data[DOMAIN][entry.entry_id][AUTH]
|
||||
|
|
|
@ -80,7 +80,7 @@ class NetatmoLight(NetatmoBase, LightEntity):
|
|||
camera_id: str,
|
||||
camera_type: str,
|
||||
home_id: str,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a Netatmo Presence camera light."""
|
||||
LightEntity.__init__(self)
|
||||
super().__init__(data_handler)
|
||||
|
|
|
@ -41,7 +41,7 @@ class NetatmoSource(MediaSource):
|
|||
|
||||
name: str = MANUFACTURER
|
||||
|
||||
def __init__(self, hass: HomeAssistant):
|
||||
def __init__(self, hass: HomeAssistant) -> None:
|
||||
"""Initialize Netatmo source."""
|
||||
super().__init__(DOMAIN)
|
||||
self.hass = hass
|
||||
|
|
|
@ -66,7 +66,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
class InputValidationError(exceptions.HomeAssistantError):
|
||||
"""Error to indicate we cannot proceed due to invalid input."""
|
||||
|
||||
def __init__(self, base: str):
|
||||
def __init__(self, base: str) -> None:
|
||||
"""Initialize with error base."""
|
||||
super().__init__()
|
||||
self.base = base
|
||||
|
|
|
@ -158,7 +158,7 @@ class NiluData:
|
|||
class NiluSensor(AirQualityEntity):
|
||||
"""Single nilu station air sensor."""
|
||||
|
||||
def __init__(self, api_data: NiluData, name: str, show_on_map: bool):
|
||||
def __init__(self, api_data: NiluData, name: str, show_on_map: bool) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self._api = api_data
|
||||
self._name = f"{name} {api_data.data.name}"
|
||||
|
|
|
@ -141,7 +141,7 @@ class NotionEntity(CoordinatorEntity):
|
|||
system_id: str,
|
||||
name: str,
|
||||
device_class: str,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the entity."""
|
||||
super().__init__(coordinator)
|
||||
self._attrs = {ATTR_ATTRIBUTION: DEFAULT_ATTRIBUTION}
|
||||
|
|
|
@ -55,7 +55,7 @@ class NotionSensor(NotionEntity, SensorEntity):
|
|||
name: str,
|
||||
device_class: str,
|
||||
unit: str,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the entity."""
|
||||
super().__init__(
|
||||
coordinator, task_id, sensor_id, bridge_id, system_id, name, device_class
|
||||
|
|
|
@ -148,7 +148,7 @@ class StationPriceData:
|
|||
class StationPriceSensor(SensorEntity):
|
||||
"""Implementation of a sensor that reports the fuel price for a station."""
|
||||
|
||||
def __init__(self, station_data: StationPriceData, fuel_type: str):
|
||||
def __init__(self, station_data: StationPriceData, fuel_type: str) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self._station_data = station_data
|
||||
self._fuel_type = fuel_type
|
||||
|
|
|
@ -227,7 +227,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
class OptionsFlowHandler(config_entries.OptionsFlow):
|
||||
"""Handle a option flow for nut."""
|
||||
|
||||
def __init__(self, config_entry: config_entries.ConfigEntry):
|
||||
def __init__(self, config_entry: config_entries.ConfigEntry) -> None:
|
||||
"""Initialize options flow."""
|
||||
self.config_entry = config_entry
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class NwsDataUpdateCoordinator(DataUpdateCoordinator):
|
|||
failed_update_interval: datetime.timedelta,
|
||||
update_method: Callable[[], Awaitable] | None = None,
|
||||
request_refresh_debouncer: debounce.Debouncer | None = None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize NWS coordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
|
|
|
@ -25,7 +25,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
class NZBGetDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
"""Class to manage fetching NZBGet data."""
|
||||
|
||||
def __init__(self, hass: HomeAssistant, *, config: dict, options: dict):
|
||||
def __init__(self, hass: HomeAssistant, *, config: dict, options: dict) -> None:
|
||||
"""Initialize global NZBGet data updater."""
|
||||
self.nzbget = NZBGetAPI(
|
||||
config[CONF_HOST],
|
||||
|
|
|
@ -77,7 +77,7 @@ class NZBGetSensor(NZBGetEntity, SensorEntity):
|
|||
sensor_type: str,
|
||||
sensor_name: str,
|
||||
unit_of_measurement: str | None = None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a new NZBGet sensor."""
|
||||
self._sensor_type = sensor_type
|
||||
self._unique_id = f"{entry_id}_{sensor_type}"
|
||||
|
|
|
@ -41,7 +41,7 @@ class NZBGetDownloadSwitch(NZBGetEntity, SwitchEntity):
|
|||
coordinator: NZBGetDataUpdateCoordinator,
|
||||
entry_id: str,
|
||||
entry_name: str,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a new NZBGet switch."""
|
||||
self._unique_id = f"{entry_id}_download"
|
||||
|
||||
|
|
Loading…
Reference in New Issue