Add setup type hints [b] (#63427)
Co-authored-by: epenet <epenet@users.noreply.github.com>pull/63474/head
parent
75f8e031df
commit
953a4f07fa
|
@ -1,8 +1,13 @@
|
|||
"""Support for Balboa Spa binary sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import CIRC_PUMP, DOMAIN, FILTER
|
||||
from .entity import BalboaEntity
|
||||
|
@ -15,10 +20,14 @@ FILTER_STATES = [
|
|||
]
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry, async_add_entities):
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||
) -> None:
|
||||
"""Set up the spa's binary sensors."""
|
||||
spa = hass.data[DOMAIN][entry.entry_id]
|
||||
entities = [BalboaSpaFilter(entry, spa, FILTER, index) for index in range(1, 3)]
|
||||
entities: list[BalboaSpaBinarySensor] = [
|
||||
BalboaSpaFilter(entry, spa, FILTER, index) for index in range(1, 3)
|
||||
]
|
||||
if spa.have_circ_pump():
|
||||
entities.append(BalboaSpaCircPump(entry, spa, CIRC_PUMP))
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
"""Support for Blinkt! lights on Raspberry Pi."""
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
|
||||
import voluptuous as vol
|
||||
|
@ -12,7 +14,10 @@ from homeassistant.components.light import (
|
|||
LightEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
|
||||
SUPPORT_BLINKT = SUPPORT_BRIGHTNESS | SUPPORT_COLOR
|
||||
|
@ -24,7 +29,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
|||
)
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
def setup_platform(
|
||||
hass: HomeAssistant,
|
||||
config: ConfigType,
|
||||
add_entities: AddEntitiesCallback,
|
||||
discovery_info: DiscoveryInfoType | None = None,
|
||||
) -> None:
|
||||
"""Set up the Blinkt Light platform."""
|
||||
blinkt = importlib.import_module("blinkt")
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
"""Platform for binarysensor integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from boschshcpy import SHCBatteryDevice, SHCSession, SHCShutterContact
|
||||
from boschshcpy.device import SHCDevice
|
||||
|
||||
|
@ -6,14 +8,21 @@ from homeassistant.components.binary_sensor import (
|
|||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DATA_SESSION, DOMAIN
|
||||
from .entity import SHCEntity
|
||||
|
||||
|
||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the SHC binary sensor platform."""
|
||||
entities = []
|
||||
entities: list[BinarySensorEntity] = []
|
||||
session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION]
|
||||
|
||||
for binary_sensor in session.device_helper.shutter_contacts:
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
"""Platform for sensor integration."""
|
||||
from __future__ import annotations
|
||||
|
||||
from boschshcpy import SHCSession
|
||||
from boschshcpy.device import SHCDevice
|
||||
|
||||
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import (
|
||||
CONCENTRATION_PARTS_PER_MILLION,
|
||||
ENERGY_KILO_WATT_HOUR,
|
||||
|
@ -10,14 +13,20 @@ from homeassistant.const import (
|
|||
POWER_WATT,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DATA_SESSION, DOMAIN
|
||||
from .entity import SHCEntity
|
||||
|
||||
|
||||
async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry,
|
||||
async_add_entities: AddEntitiesCallback,
|
||||
) -> None:
|
||||
"""Set up the SHC sensor platform."""
|
||||
entities = []
|
||||
entities: list[SensorEntity] = []
|
||||
session: SHCSession = hass.data[DOMAIN][config_entry.entry_id][DATA_SESSION]
|
||||
|
||||
for sensor in session.device_helper.thermostats:
|
||||
|
|
Loading…
Reference in New Issue