mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Add init return type to integrations (#87523)
Add type hints to integrations
This commit is contained in:
parent
ade0d6fcae
commit
bb3e0633a4
@ -262,7 +262,7 @@ class AbstractAemetSensor(CoordinatorEntity[WeatherUpdateCoordinator], SensorEnt
|
||||
unique_id,
|
||||
coordinator: WeatherUpdateCoordinator,
|
||||
description: SensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(coordinator)
|
||||
self.entity_description = description
|
||||
@ -279,7 +279,7 @@ class AemetSensor(AbstractAemetSensor):
|
||||
unique_id_prefix,
|
||||
weather_coordinator: WeatherUpdateCoordinator,
|
||||
description: SensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(
|
||||
name=name,
|
||||
@ -304,7 +304,7 @@ class AemetForecastSensor(AbstractAemetSensor):
|
||||
weather_coordinator: WeatherUpdateCoordinator,
|
||||
forecast_mode,
|
||||
description: SensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(
|
||||
name=name,
|
||||
|
@ -102,7 +102,7 @@ class AemetWeather(CoordinatorEntity[WeatherUpdateCoordinator], WeatherEntity):
|
||||
unique_id,
|
||||
coordinator: WeatherUpdateCoordinator,
|
||||
forecast_mode,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(coordinator)
|
||||
self._forecast_mode = forecast_mode
|
||||
|
@ -195,7 +195,9 @@ class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorEntity):
|
||||
|
||||
_attr_device_class = BinarySensorDeviceClass.DOOR
|
||||
|
||||
def __init__(self, data, device, description: BinarySensorEntityDescription):
|
||||
def __init__(
|
||||
self, data, device, description: BinarySensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(data, device)
|
||||
self.entity_description = description
|
||||
@ -235,7 +237,9 @@ class AugustDoorbellBinarySensor(AugustEntityMixin, BinarySensorEntity):
|
||||
|
||||
entity_description: AugustBinarySensorEntityDescription
|
||||
|
||||
def __init__(self, data, device, description: AugustBinarySensorEntityDescription):
|
||||
def __init__(
|
||||
self, data, device, description: AugustBinarySensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(data, device)
|
||||
self.entity_description = description
|
||||
|
@ -268,7 +268,7 @@ class AugustBatterySensor(AugustEntityMixin, SensorEntity, Generic[_T]):
|
||||
device,
|
||||
old_device,
|
||||
description: AugustSensorEntityDescription[_T],
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(data, device)
|
||||
self.entity_description = description
|
||||
|
@ -130,7 +130,7 @@ class BboxUptimeSensor(SensorEntity):
|
||||
_attr_attribution = ATTRIBUTION
|
||||
_attr_device_class = SensorDeviceClass.TIMESTAMP
|
||||
|
||||
def __init__(self, bbox_data, name, description: SensorEntityDescription):
|
||||
def __init__(self, bbox_data, name, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._attr_name = f"{name} {description.name}"
|
||||
@ -149,7 +149,7 @@ class BboxSensor(SensorEntity):
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
|
||||
def __init__(self, bbox_data, name, description: SensorEntityDescription):
|
||||
def __init__(self, bbox_data, name, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._attr_name = f"{name} {description.name}"
|
||||
|
@ -55,7 +55,9 @@ async def async_setup_entry(
|
||||
class BlinkBinarySensor(BinarySensorEntity):
|
||||
"""Representation of a Blink binary sensor."""
|
||||
|
||||
def __init__(self, data, camera, description: BinarySensorEntityDescription):
|
||||
def __init__(
|
||||
self, data, camera, description: BinarySensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.data = data
|
||||
self.entity_description = description
|
||||
|
@ -53,7 +53,7 @@ async def async_setup_entry(
|
||||
class BlinkSensor(SensorEntity):
|
||||
"""A Blink camera sensor."""
|
||||
|
||||
def __init__(self, data, camera, description: SensorEntityDescription):
|
||||
def __init__(self, data, camera, description: SensorEntityDescription) -> None:
|
||||
"""Initialize sensors from Blink camera."""
|
||||
self.entity_description = description
|
||||
self._attr_name = f"{DOMAIN} {camera} {description.name}"
|
||||
|
@ -114,7 +114,7 @@ class BroadlinkSensor(BroadlinkEntity, SensorEntity):
|
||||
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, device, description: SensorEntityDescription):
|
||||
def __init__(self, device, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(device)
|
||||
self.entity_description = description
|
||||
|
@ -692,7 +692,9 @@ class BrSensor(SensorEntity):
|
||||
_attr_entity_registry_enabled_default = False
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, client_name, coordinates, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, client_name, coordinates, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._attr_name = f"{client_name} {description.name}"
|
||||
|
@ -91,7 +91,9 @@ class ComedHourlyPricingSensor(SensorEntity):
|
||||
|
||||
_attr_attribution = "Data provided by ComEd Hourly Pricing service"
|
||||
|
||||
def __init__(self, websession, offset, name, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, websession, offset, name, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.websession = websession
|
||||
|
@ -59,7 +59,7 @@ class DaikinZoneSwitch(SwitchEntity):
|
||||
_attr_icon = ZONE_ICON
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, daikin_api: DaikinApi, zone_id):
|
||||
def __init__(self, daikin_api: DaikinApi, zone_id) -> None:
|
||||
"""Initialize the zone."""
|
||||
self._api = daikin_api
|
||||
self._zone_id = zone_id
|
||||
|
@ -651,7 +651,7 @@ class DarkSkySensor(SensorEntity):
|
||||
name,
|
||||
forecast_day=None,
|
||||
forecast_hour=None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.forecast_data = forecast_data
|
||||
@ -794,7 +794,7 @@ class DarkSkyAlertSensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, forecast_data, description: DarkskySensorEntityDescription, name
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.forecast_data = forecast_data
|
||||
|
@ -106,7 +106,9 @@ class DiscogsSensor(SensorEntity):
|
||||
|
||||
_attr_attribution = "Data provided by Discogs"
|
||||
|
||||
def __init__(self, discogs_data, name, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, discogs_data, name, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the Discogs sensor."""
|
||||
self.entity_description = description
|
||||
self._discogs_data = discogs_data
|
||||
|
@ -110,7 +110,7 @@ class DovadoSensor(SensorEntity):
|
||||
|
||||
entity_description: DovadoSensorEntityDescription
|
||||
|
||||
def __init__(self, data, description: DovadoSensorEntityDescription):
|
||||
def __init__(self, data, description: DovadoSensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._data = data
|
||||
|
@ -113,7 +113,7 @@ class DwdWeatherWarningsSensor(SensorEntity):
|
||||
api,
|
||||
name,
|
||||
description: SensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a DWD-Weather-Warnings sensor."""
|
||||
self._api = api
|
||||
self.entity_description = description
|
||||
|
@ -188,7 +188,7 @@ class EBoxSensor(SensorEntity):
|
||||
ebox_data,
|
||||
description: SensorEntityDescription,
|
||||
name,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._attr_name = f"{name} {description.name}"
|
||||
|
@ -112,7 +112,7 @@ class EcobeeSensor(SensorEntity):
|
||||
sensor_name,
|
||||
sensor_index,
|
||||
description: EcobeeSensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.data = data
|
||||
|
@ -60,7 +60,9 @@ async def async_setup_entry(
|
||||
class EcoNetBinarySensor(EcoNetEntity, BinarySensorEntity):
|
||||
"""Define a Econet binary sensor."""
|
||||
|
||||
def __init__(self, econet_device, description: BinarySensorEntityDescription):
|
||||
def __init__(
|
||||
self, econet_device, description: BinarySensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize."""
|
||||
super().__init__(econet_device)
|
||||
self.entity_description = description
|
||||
|
@ -154,7 +154,9 @@ def setup_platform(
|
||||
class EnOceanSensor(EnOceanEntity, RestoreEntity, SensorEntity):
|
||||
"""Representation of an EnOcean sensor device such as a power meter."""
|
||||
|
||||
def __init__(self, dev_id, dev_name, description: EnOceanSensorEntityDescription):
|
||||
def __init__(
|
||||
self, dev_id, dev_name, description: EnOceanSensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the EnOcean sensor device."""
|
||||
super().__init__(dev_id, dev_name)
|
||||
self.entity_description = description
|
||||
@ -223,7 +225,7 @@ class EnOceanTemperatureSensor(EnOceanSensor):
|
||||
scale_max,
|
||||
range_from,
|
||||
range_to,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the EnOcean temperature sensor device."""
|
||||
super().__init__(dev_id, dev_name, description)
|
||||
self._scale_min = scale_min
|
||||
|
@ -34,7 +34,7 @@ class FAABinarySensor(CoordinatorEntity, BinarySensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, coordinator, entry_id, description: BinarySensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(coordinator)
|
||||
self.entity_description = description
|
||||
|
@ -214,7 +214,9 @@ async def async_setup_platform(
|
||||
class FidoSensor(SensorEntity):
|
||||
"""Implementation of a Fido sensor."""
|
||||
|
||||
def __init__(self, fido_data, name, number, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, fido_data, name, number, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.fido_data = fido_data
|
||||
|
@ -53,7 +53,7 @@ def setup_scanner(
|
||||
class FleetGoDeviceScanner:
|
||||
"""Define a scanner for the FleetGO platform."""
|
||||
|
||||
def __init__(self, config, see: SeeCallback):
|
||||
def __init__(self, config, see: SeeCallback) -> None:
|
||||
"""Initialize FleetGoDeviceScanner."""
|
||||
self._include = config.get(CONF_INCLUDE)
|
||||
self._see = see
|
||||
|
@ -142,7 +142,7 @@ class GrowattInverter(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, probe, name, unique_id, description: GrowattSensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a PVOutput sensor."""
|
||||
self.probe = probe
|
||||
self.entity_description = description
|
||||
|
@ -392,7 +392,7 @@ class SourceManager:
|
||||
*,
|
||||
retry_delay: int = COMMAND_RETRY_DELAY,
|
||||
max_retry_attempts: int = COMMAND_RETRY_ATTEMPTS,
|
||||
):
|
||||
) -> None:
|
||||
"""Init input manager."""
|
||||
self.retry_delay = retry_delay
|
||||
self.max_retry_attempts = max_retry_attempts
|
||||
|
@ -89,7 +89,7 @@ class HydrawiseEntity(Entity):
|
||||
|
||||
_attr_attribution = "Data provided by hydrawise.com"
|
||||
|
||||
def __init__(self, data, description: EntityDescription):
|
||||
def __init__(self, data, description: EntityDescription) -> None:
|
||||
"""Initialize the Hydrawise entity."""
|
||||
self.entity_description = description
|
||||
self.data = data
|
||||
|
@ -81,7 +81,7 @@ class HydrawiseSwitch(HydrawiseEntity, SwitchEntity):
|
||||
|
||||
def __init__(
|
||||
self, data, description: SwitchEntityDescription, default_watering_timer
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a switch for Hydrawise device."""
|
||||
super().__init__(data, description)
|
||||
self._default_watering_timer = default_watering_timer
|
||||
|
@ -60,7 +60,9 @@ class IOSSensor(SensorEntity):
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, device_name, device, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, device_name, device, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._device = device
|
||||
|
@ -41,7 +41,7 @@ class Iperf3Sensor(RestoreEntity, SensorEntity):
|
||||
_attr_attribution = "Data retrieved using Iperf3"
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, iperf3_data, description: SensorEntityDescription):
|
||||
def __init__(self, iperf3_data, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._iperf3_data = iperf3_data
|
||||
|
@ -121,7 +121,7 @@ class IPMAWeather(WeatherEntity):
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
|
||||
def __init__(self, location: Location, api: IPMA_API, config):
|
||||
def __init__(self, location: Location, api: IPMA_API, config) -> None:
|
||||
"""Initialise the platform with a data instance and station name."""
|
||||
self._api = api
|
||||
self._location_name = config.get(CONF_NAME, location.name)
|
||||
|
@ -91,7 +91,9 @@ async def async_setup_entry(
|
||||
class JuiceNetSensorDevice(JuiceNetDevice, SensorEntity):
|
||||
"""Implementation of a JuiceNet sensor."""
|
||||
|
||||
def __init__(self, device, coordinator, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, device, coordinator, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialise the sensor."""
|
||||
super().__init__(device, description.key, coordinator)
|
||||
self.entity_description = description
|
||||
|
@ -71,7 +71,7 @@ class KaiterraSensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, api, name, device_id, description: KaiterraSensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self._api = api
|
||||
self._device_id = device_id
|
||||
|
@ -102,7 +102,7 @@ class KonnectedSensor(SensorEntity):
|
||||
description: SensorEntityDescription,
|
||||
addr=None,
|
||||
initial_state=None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the entity for a single sensor_type."""
|
||||
self.entity_description = description
|
||||
self._addr = addr
|
||||
|
@ -37,7 +37,9 @@ async def async_setup_entry(
|
||||
class LiteJetScene(Scene):
|
||||
"""Representation of a single LiteJet scene."""
|
||||
|
||||
def __init__(self, entry_id, lj: LiteJet, i, name): # pylint: disable=invalid-name
|
||||
def __init__(
|
||||
self, entry_id, lj: LiteJet, i, name # pylint: disable=invalid-name
|
||||
) -> None:
|
||||
"""Initialize the scene."""
|
||||
self._lj = lj
|
||||
self._index = i
|
||||
|
@ -59,7 +59,7 @@ class LogiSensor(SensorEntity):
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
|
||||
def __init__(self, camera, time_zone, description: SensorEntityDescription):
|
||||
def __init__(self, camera, time_zone, description: SensorEntityDescription) -> None:
|
||||
"""Initialize a sensor for Logi Circle camera."""
|
||||
self.entity_description = description
|
||||
self._camera = camera
|
||||
|
@ -146,7 +146,7 @@ class MagicSeaweedSensor(SensorEntity):
|
||||
unit_system,
|
||||
description: SensorEntityDescription,
|
||||
hour=None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.client_name = name
|
||||
|
@ -37,7 +37,7 @@ async def async_setup_entry(
|
||||
class NightscoutSensor(SensorEntity):
|
||||
"""Implementation of a Nightscout sensor."""
|
||||
|
||||
def __init__(self, api: NightscoutAPI, name, unique_id):
|
||||
def __init__(self, api: NightscoutAPI, name, unique_id) -> None:
|
||||
"""Initialize the Nightscout sensor."""
|
||||
self.api = api
|
||||
self._attr_unique_id = unique_id
|
||||
|
@ -85,7 +85,7 @@ class NoboZone(ClimateEntity):
|
||||
_attr_target_temperature_step = 1
|
||||
# Need to poll to get preset change when in HVACMode.AUTO, so can't set _attr_should_poll = False
|
||||
|
||||
def __init__(self, zone_id, hub: nobo, override_type):
|
||||
def __init__(self, zone_id, hub: nobo, override_type) -> None:
|
||||
"""Initialize the climate device."""
|
||||
self._id = zone_id
|
||||
self._nobo = hub
|
||||
|
@ -38,7 +38,7 @@ def setup_platform(
|
||||
class OmbiSensor(SensorEntity):
|
||||
"""Representation of an Ombi sensor."""
|
||||
|
||||
def __init__(self, ombi, description: SensorEntityDescription):
|
||||
def __init__(self, ombi, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._ombi = ombi
|
||||
|
@ -55,7 +55,9 @@ class ONVIFSensor(ONVIFBaseEntity, RestoreSensor):
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, uid, device: ONVIFDevice, entry: er.RegistryEntry | None = None):
|
||||
def __init__(
|
||||
self, uid, device: ONVIFDevice, entry: er.RegistryEntry | None = None
|
||||
) -> None:
|
||||
"""Initialize the ONVIF binary sensor."""
|
||||
self._attr_unique_id = uid
|
||||
if entry is not None:
|
||||
|
@ -113,7 +113,7 @@ def setup_platform(
|
||||
class OpenEVSESensor(SensorEntity):
|
||||
"""Implementation of an OpenEVSE sensor."""
|
||||
|
||||
def __init__(self, charger, description: SensorEntityDescription):
|
||||
def __init__(self, charger, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.charger = charger
|
||||
|
@ -89,7 +89,7 @@ class MinutPointSensor(MinutPointEntity, SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, point_client, device_id, description: MinutPointSensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
super().__init__(point_client, device_id, description.device_class)
|
||||
self.entity_description = description
|
||||
|
@ -64,7 +64,7 @@ class PoolSenseEntity(CoordinatorEntity):
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
|
||||
def __init__(self, coordinator, email, description: EntityDescription):
|
||||
def __init__(self, coordinator, email, description: EntityDescription) -> None:
|
||||
"""Initialize poolsense sensor."""
|
||||
super().__init__(coordinator)
|
||||
self.entity_description = description
|
||||
|
@ -59,7 +59,7 @@ async def async_setup_entry(
|
||||
class ProgettihwswBinarySensor(CoordinatorEntity, BinarySensorEntity):
|
||||
"""Represent a binary sensor."""
|
||||
|
||||
def __init__(self, coordinator, name, sensor: Input):
|
||||
def __init__(self, coordinator, name, sensor: Input) -> None:
|
||||
"""Set initializing values."""
|
||||
super().__init__(coordinator)
|
||||
self._name = name
|
||||
|
@ -60,7 +60,7 @@ async def async_setup_entry(
|
||||
class ProgettihwswSwitch(CoordinatorEntity, SwitchEntity):
|
||||
"""Represent a switch entity."""
|
||||
|
||||
def __init__(self, coordinator, name, switch: Relay):
|
||||
def __init__(self, coordinator, name, switch: Relay) -> None:
|
||||
"""Initialize the values."""
|
||||
super().__init__(coordinator)
|
||||
self._switch = switch
|
||||
|
@ -256,7 +256,7 @@ class ProxmoxEntity(CoordinatorEntity):
|
||||
host_name,
|
||||
node_name,
|
||||
vm_id=None,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the Proxmox entity."""
|
||||
super().__init__(coordinator)
|
||||
|
||||
|
@ -78,7 +78,7 @@ class ProxmoxBinarySensor(ProxmoxEntity, BinarySensorEntity):
|
||||
host_name,
|
||||
node_name,
|
||||
vm_id,
|
||||
):
|
||||
) -> None:
|
||||
"""Create the binary sensor for vms or containers."""
|
||||
super().__init__(
|
||||
coordinator, unique_id, name, icon, host_name, node_name, vm_id
|
||||
|
@ -102,7 +102,7 @@ class PyLoadSensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, api: PyLoadAPI, sensor_type: SensorEntityDescription, client_name
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a new pyLoad sensor."""
|
||||
self._attr_name = f"{client_name} {sensor_type.name}"
|
||||
self.type = sensor_type.key
|
||||
|
@ -107,7 +107,7 @@ class QBittorrentSensor(SensorEntity):
|
||||
qbittorrent_client,
|
||||
client_name,
|
||||
exception,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the qBittorrent sensor."""
|
||||
self.entity_description = description
|
||||
self.client = qbittorrent_client
|
||||
|
@ -319,7 +319,9 @@ class QNAPStatsAPI:
|
||||
class QNAPSensor(SensorEntity):
|
||||
"""Base class for a QNAP sensor."""
|
||||
|
||||
def __init__(self, api, description: SensorEntityDescription, monitor_device=None):
|
||||
def __init__(
|
||||
self, api, description: SensorEntityDescription, monitor_device=None
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.monitor_device = monitor_device
|
||||
|
@ -98,7 +98,7 @@ class RaspyRFMSwitch(SwitchEntity):
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, raspyrfm_client, name: str, gateway, controlunit):
|
||||
def __init__(self, raspyrfm_client, name: str, gateway, controlunit) -> None:
|
||||
"""Initialize the switch."""
|
||||
self._raspyrfm_client = raspyrfm_client
|
||||
|
||||
|
@ -94,7 +94,7 @@ def setup_platform(
|
||||
class RedditSensor(SensorEntity):
|
||||
"""Representation of a Reddit sensor."""
|
||||
|
||||
def __init__(self, reddit, subreddit: str, limit: int, sort_by: str):
|
||||
def __init__(self, reddit, subreddit: str, limit: int, sort_by: str) -> None:
|
||||
"""Initialize the Reddit sensor."""
|
||||
self._reddit = reddit
|
||||
self._subreddit = subreddit
|
||||
|
@ -69,7 +69,7 @@ class RepetierSensor(SensorEntity):
|
||||
name,
|
||||
printer_id,
|
||||
description: RepetierSensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Init new sensor."""
|
||||
self.entity_description = description
|
||||
self._api = api
|
||||
|
@ -80,7 +80,7 @@ class RingBinarySensor(RingEntityMixin, BinarySensorEntity):
|
||||
ring,
|
||||
device,
|
||||
description: RingBinarySensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a sensor for Ring device."""
|
||||
super().__init__(config_entry_id, device)
|
||||
self.entity_description = description
|
||||
|
@ -49,7 +49,7 @@ class RingSensor(RingEntityMixin, SensorEntity):
|
||||
config_entry_id,
|
||||
device,
|
||||
description: RingSensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize a sensor for Ring device."""
|
||||
super().__init__(config_entry_id, device)
|
||||
self.entity_description = description
|
||||
|
@ -109,7 +109,7 @@ class RovaSensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, platform_name, description: SensorEntityDescription, data_service
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.data_service = data_service
|
||||
|
@ -130,7 +130,7 @@ class RTorrentSensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, rtorrent_client, client_name, description: SensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.client = rtorrent_client
|
||||
|
@ -160,7 +160,7 @@ class SabnzbdSensor(SensorEntity):
|
||||
client_name,
|
||||
description: SabnzbdSensorEntityDescription,
|
||||
entry_id,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
|
||||
self._attr_unique_id = f"{entry_id}_{description.key}"
|
||||
|
@ -336,7 +336,7 @@ class SmappeeSensor(SensorEntity):
|
||||
smappee_base,
|
||||
service_location,
|
||||
description: SmappeeSensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the Smappee sensor."""
|
||||
self.entity_description = description
|
||||
self._smappee_base = smappee_base
|
||||
|
@ -279,7 +279,7 @@ class DeviceBroker:
|
||||
smart_app,
|
||||
devices: Iterable,
|
||||
scenes: Iterable,
|
||||
):
|
||||
) -> None:
|
||||
"""Create a new instance of the DeviceBroker."""
|
||||
self._hass = hass
|
||||
self._entry = entry
|
||||
|
@ -16,7 +16,7 @@ class SmartTubEntity(CoordinatorEntity):
|
||||
|
||||
def __init__(
|
||||
self, coordinator: DataUpdateCoordinator, spa: smarttub.Spa, entity_name
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the entity.
|
||||
|
||||
Given a spa id and a short name for the entity, we provide basic device
|
||||
|
@ -33,7 +33,7 @@ async def async_setup_entry(
|
||||
class SmartTubPump(SmartTubEntity, SwitchEntity):
|
||||
"""A pump on a spa."""
|
||||
|
||||
def __init__(self, coordinator, pump: SpaPump):
|
||||
def __init__(self, coordinator, pump: SpaPump) -> None:
|
||||
"""Initialize the entity."""
|
||||
super().__init__(coordinator, pump.spa, "pump")
|
||||
self.pump_id = pump.id
|
||||
|
@ -278,7 +278,7 @@ class SolarEdgeSensor(SensorEntity):
|
||||
platform_name,
|
||||
data,
|
||||
description: SolarEdgeLocalSensorEntityDescription,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._platform_name = platform_name
|
||||
|
@ -168,7 +168,7 @@ async def async_setup_platform(
|
||||
class StartcaSensor(SensorEntity):
|
||||
"""Representation of Start.ca Bandwidth sensor."""
|
||||
|
||||
def __init__(self, startcadata, name, description: SensorEntityDescription):
|
||||
def __init__(self, startcadata, name, description: SensorEntityDescription) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self.startcadata = startcadata
|
||||
|
@ -99,7 +99,9 @@ def setup_platform(
|
||||
class ThinkingCleanerSensor(SensorEntity):
|
||||
"""Representation of a ThinkingCleaner Sensor."""
|
||||
|
||||
def __init__(self, tc_object, update_devices, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, tc_object, update_devices, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the ThinkingCleaner."""
|
||||
self.entity_description = description
|
||||
self._tc_object = tc_object
|
||||
|
@ -75,7 +75,9 @@ def setup_platform(
|
||||
class ThinkingCleanerSwitch(SwitchEntity):
|
||||
"""ThinkingCleaner Switch (dock, clean, find me)."""
|
||||
|
||||
def __init__(self, tc_object, update_devices, description: SwitchEntityDescription):
|
||||
def __init__(
|
||||
self, tc_object, update_devices, description: SwitchEntityDescription
|
||||
) -> None:
|
||||
"""Initialize the ThinkingCleaner."""
|
||||
self.entity_description = description
|
||||
|
||||
|
@ -86,7 +86,7 @@ class TotalConnectAlarm(
|
||||
name,
|
||||
location_id,
|
||||
partition_id,
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the TotalConnect status."""
|
||||
super().__init__(coordinator)
|
||||
self._location_id = location_id
|
||||
|
@ -141,7 +141,7 @@ class TravisCISensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, data, repo_name, user, branch, description: SensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._build = None
|
||||
|
@ -189,7 +189,7 @@ class ViCareBinarySensor(BinarySensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, name, api, device_config, description: ViCareBinarySensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._attr_name = name
|
||||
|
@ -98,7 +98,7 @@ class ViCareButton(ButtonEntity):
|
||||
|
||||
def __init__(
|
||||
self, name, api, device_config, description: ViCareButtonEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the button."""
|
||||
self.entity_description = description
|
||||
self._device_config = device_config
|
||||
|
@ -659,7 +659,7 @@ class ViCareSensor(SensorEntity):
|
||||
|
||||
def __init__(
|
||||
self, name, api, device_config, description: ViCareSensorEntityDescription
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the sensor."""
|
||||
self.entity_description = description
|
||||
self._attr_name = name
|
||||
|
@ -32,7 +32,7 @@ class VilfoRouterSensor(SensorEntity):
|
||||
|
||||
entity_description: VilfoSensorEntityDescription
|
||||
|
||||
def __init__(self, api, description: VilfoSensorEntityDescription):
|
||||
def __init__(self, api, description: VilfoSensorEntityDescription) -> None:
|
||||
"""Initialize."""
|
||||
self.entity_description = description
|
||||
self.api = api
|
||||
|
@ -84,7 +84,9 @@ def setup_platform(
|
||||
class VultrSensor(SensorEntity):
|
||||
"""Representation of a Vultr subscription sensor."""
|
||||
|
||||
def __init__(self, vultr, subscription, name, description: SensorEntityDescription):
|
||||
def __init__(
|
||||
self, vultr, subscription, name, description: SensorEntityDescription
|
||||
) -> None:
|
||||
"""Initialize a new Vultr sensor."""
|
||||
self.entity_description = description
|
||||
self._vultr = vultr
|
||||
|
@ -77,7 +77,7 @@ def setup_platform(
|
||||
class WirelessTagSwitch(WirelessTagBaseSensor, SwitchEntity):
|
||||
"""A switch implementation for Wireless Sensor Tags."""
|
||||
|
||||
def __init__(self, api, tag, description: SwitchEntityDescription):
|
||||
def __init__(self, api, tag, description: SwitchEntityDescription) -> None:
|
||||
"""Initialize a switch for Wireless Sensor Tag."""
|
||||
super().__init__(api, tag)
|
||||
self.entity_description = description
|
||||
|
@ -53,7 +53,7 @@ async def async_setup_entry(
|
||||
class WolfLinkSensor(CoordinatorEntity, SensorEntity):
|
||||
"""Base class for all Wolf entities."""
|
||||
|
||||
def __init__(self, coordinator, wolf_object: Parameter, device_id):
|
||||
def __init__(self, coordinator, wolf_object: Parameter, device_id) -> None:
|
||||
"""Initialize."""
|
||||
super().__init__(coordinator)
|
||||
self.wolf_object = wolf_object
|
||||
|
@ -206,7 +206,7 @@ class MiroboVacuum(
|
||||
entry,
|
||||
unique_id,
|
||||
coordinator: DataUpdateCoordinator[VacuumCoordinatorData],
|
||||
):
|
||||
) -> None:
|
||||
"""Initialize the Xiaomi vacuum cleaner robot handler."""
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self._state: str | None = None
|
||||
|
@ -71,7 +71,7 @@ class DiscoverYandexTransport(SensorEntity):
|
||||
|
||||
_attr_attribution = "Data provided by maps.yandex.ru"
|
||||
|
||||
def __init__(self, requester: YandexMapsRequester, stop_id, routes, name):
|
||||
def __init__(self, requester: YandexMapsRequester, stop_id, routes, name) -> None:
|
||||
"""Initialize sensor."""
|
||||
self.requester = requester
|
||||
self._stop_id = stop_id
|
||||
|
@ -89,7 +89,7 @@ class ZHAAlarmControlPanel(ZhaEntity, AlarmControlPanelEntity):
|
||||
| AlarmControlPanelEntityFeature.TRIGGER
|
||||
)
|
||||
|
||||
def __init__(self, unique_id, zha_device: ZHADevice, channels, **kwargs):
|
||||
def __init__(self, unique_id, zha_device: ZHADevice, channels, **kwargs) -> None:
|
||||
"""Initialize the ZHA alarm control device."""
|
||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||
cfg_entry = zha_device.gateway.config_entry
|
||||
|
@ -623,7 +623,7 @@ class Light(BaseLight, ZhaEntity):
|
||||
_attr_supported_color_modes: set[ColorMode]
|
||||
_REFRESH_INTERVAL = (45, 75)
|
||||
|
||||
def __init__(self, unique_id, zha_device: ZHADevice, channels, **kwargs):
|
||||
def __init__(self, unique_id, zha_device: ZHADevice, channels, **kwargs) -> None:
|
||||
"""Initialize the ZHA light."""
|
||||
super().__init__(unique_id, zha_device, channels, **kwargs)
|
||||
self._on_off_channel = self.cluster_channels[CHANNEL_ON_OFF]
|
||||
|
Loading…
x
Reference in New Issue
Block a user