Use AddEntitiesCallback type, pt.3 (#49953)
This commit is contained in:
parent
4d939486a9
commit
004fa63dbe
34 changed files with 113 additions and 106 deletions
|
@ -1,8 +1,6 @@
|
||||||
"""Support for Canary alarm."""
|
"""Support for Canary alarm."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from canary.api import LOCATION_MODE_AWAY, LOCATION_MODE_HOME, LOCATION_MODE_NIGHT
|
from canary.api import LOCATION_MODE_AWAY, LOCATION_MODE_HOME, LOCATION_MODE_NIGHT
|
||||||
|
|
||||||
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
|
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
|
||||||
|
@ -19,7 +17,7 @@ from homeassistant.const import (
|
||||||
STATE_ALARM_DISARMED,
|
STATE_ALARM_DISARMED,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import DATA_COORDINATOR, DOMAIN
|
from .const import DATA_COORDINATOR, DOMAIN
|
||||||
|
@ -29,7 +27,7 @@ from .coordinator import CanaryDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Canary alarm control panels based on a config entry."""
|
"""Set up Canary alarm control panels based on a config entry."""
|
||||||
coordinator: CanaryDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
coordinator: CanaryDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
||||||
|
|
|
@ -3,7 +3,6 @@ from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from haffmpeg.camera import CameraMjpeg
|
from haffmpeg.camera import CameraMjpeg
|
||||||
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
|
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
|
||||||
|
@ -15,7 +14,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv
|
||||||
from homeassistant.helpers.aiohttp_client import async_aiohttp_proxy_stream
|
from homeassistant.helpers.aiohttp_client import async_aiohttp_proxy_stream
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
|
|
||||||
|
@ -46,7 +45,7 @@ PLATFORM_SCHEMA = vol.All(
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Canary sensors based on a config entry."""
|
"""Set up Canary sensors based on a config entry."""
|
||||||
coordinator: CanaryDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
coordinator: CanaryDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
"""Support for Canary sensors."""
|
"""Support for Canary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from canary.api import SensorType
|
from canary.api import SensorType
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity
|
from homeassistant.components.sensor import SensorEntity
|
||||||
|
@ -17,7 +15,7 @@ from homeassistant.const import (
|
||||||
TEMP_CELSIUS,
|
TEMP_CELSIUS,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import DATA_COORDINATOR, DOMAIN, MANUFACTURER
|
from .const import DATA_COORDINATOR, DOMAIN, MANUFACTURER
|
||||||
|
@ -57,7 +55,7 @@ STATE_AIR_QUALITY_VERY_ABNORMAL = "very_abnormal"
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Canary sensors based on a config entry."""
|
"""Set up Canary sensors based on a config entry."""
|
||||||
coordinator: CanaryDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
coordinator: CanaryDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id][
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
"""Support for the Dynalite channels as covers."""
|
"""Support for the Dynalite channels as covers."""
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.cover import (
|
from homeassistant.components.cover import (
|
||||||
DEVICE_CLASS_SHUTTER,
|
DEVICE_CLASS_SHUTTER,
|
||||||
|
@ -8,6 +7,7 @@ from homeassistant.components.cover import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .dynalitebase import DynaliteBase, async_setup_entry_base
|
from .dynalitebase import DynaliteBase, async_setup_entry_base
|
||||||
|
|
||||||
|
@ -15,7 +15,9 @@ DEFAULT_COVER_CLASS = DEVICE_CLASS_SHUTTER
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DOMAIN, LOGGER
|
from .const import DOMAIN, LOGGER
|
||||||
|
|
||||||
|
@ -15,7 +16,7 @@ from .const import DOMAIN, LOGGER
|
||||||
def async_setup_entry_base(
|
def async_setup_entry_base(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
async_add_entities: Callable,
|
async_add_entities: AddEntitiesCallback,
|
||||||
platform: str,
|
platform: str,
|
||||||
entity_from_device: Callable,
|
entity_from_device: Callable,
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
"""Support for Dynalite channels as lights."""
|
"""Support for Dynalite channels as lights."""
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.light import SUPPORT_BRIGHTNESS, LightEntity
|
from homeassistant.components.light import SUPPORT_BRIGHTNESS, LightEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .dynalitebase import DynaliteBase, async_setup_entry_base
|
from .dynalitebase import DynaliteBase, async_setup_entry_base
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
||||||
async_setup_entry_base(
|
async_setup_entry_base(
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
"""Support for the Dynalite channels and presets as switches."""
|
"""Support for the Dynalite channels and presets as switches."""
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .dynalitebase import DynaliteBase, async_setup_entry_base
|
from .dynalitebase import DynaliteBase, async_setup_entry_base
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
"""Record the async_add_entities function to add them later when received from Dynalite."""
|
||||||
async_setup_entry_base(
|
async_setup_entry_base(
|
||||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from elgato import Elgato, ElgatoError, Info, State
|
from elgato import Elgato, ElgatoError, Info, State
|
||||||
|
|
||||||
|
@ -23,8 +23,11 @@ from homeassistant.const import (
|
||||||
ATTR_SW_VERSION,
|
ATTR_SW_VERSION,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import async_get_current_platform
|
from homeassistant.helpers.entity_platform import (
|
||||||
|
AddEntitiesCallback,
|
||||||
|
async_get_current_platform,
|
||||||
|
)
|
||||||
|
|
||||||
from .const import DATA_ELGATO_CLIENT, DOMAIN, SERVICE_IDENTIFY
|
from .const import DATA_ELGATO_CLIENT, DOMAIN, SERVICE_IDENTIFY
|
||||||
|
|
||||||
|
@ -37,7 +40,7 @@ SCAN_INTERVAL = timedelta(seconds=10)
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Elgato Key Light based on a config entry."""
|
"""Set up Elgato Key Light based on a config entry."""
|
||||||
elgato: Elgato = hass.data[DOMAIN][entry.entry_id][DATA_ELGATO_CLIENT]
|
elgato: Elgato = hass.data[DOMAIN][entry.entry_id][DATA_ELGATO_CLIENT]
|
||||||
|
|
|
@ -25,6 +25,7 @@ from homeassistant.helpers.dispatcher import (
|
||||||
async_dispatcher_send,
|
async_dispatcher_send,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
import homeassistant.util.color as color_util
|
import homeassistant.util.color as color_util
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
|
@ -81,7 +82,9 @@ ICON_EXTERNAL_SOURCE = "mdi:television-ambient-light"
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Set up a Hyperion platform from config entry."""
|
"""Set up a Hyperion platform from config entry."""
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from hyperion import client
|
from hyperion import client
|
||||||
from hyperion.const import (
|
from hyperion.const import (
|
||||||
|
@ -32,6 +32,7 @@ from homeassistant.helpers.dispatcher import (
|
||||||
async_dispatcher_send,
|
async_dispatcher_send,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
|
@ -82,7 +83,9 @@ def _component_to_switch_name(component: str, instance_name: str) -> str:
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Set up a Hyperion platform from config entry."""
|
"""Set up a Hyperion platform from config entry."""
|
||||||
entry_data = hass.data[DOMAIN][config_entry.entry_id]
|
entry_data = hass.data[DOMAIN][config_entry.entry_id]
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
"""Support for Litter-Robot sensors."""
|
"""Support for Litter-Robot sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from pylitterbot.robot import Robot
|
from pylitterbot.robot import Robot
|
||||||
|
|
||||||
from homeassistant.components.sensor import SensorEntity
|
from homeassistant.components.sensor import SensorEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, PERCENTAGE
|
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, PERCENTAGE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
from .entity import LitterRobotEntity
|
from .entity import LitterRobotEntity
|
||||||
|
@ -83,7 +81,7 @@ ROBOT_SENSORS: list[tuple[type[LitterRobotPropertySensor], str, str]] = [
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Litter-Robot sensors using config entry."""
|
"""Set up Litter-Robot sensors using config entry."""
|
||||||
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]
|
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
"""Support for Litter-Robot switches."""
|
"""Support for Litter-Robot switches."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
from .entity import LitterRobotControlEntity
|
from .entity import LitterRobotControlEntity
|
||||||
|
@ -66,7 +66,7 @@ ROBOT_SWITCHES: list[tuple[type[LitterRobotControlEntity], str]] = [
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Litter-Robot switches using config entry."""
|
"""Set up Litter-Robot switches using config entry."""
|
||||||
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]
|
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Support for Litter-Robot "Vacuum"."""
|
"""Support for Litter-Robot "Vacuum"."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from pylitterbot.enums import LitterBoxStatus
|
from pylitterbot.enums import LitterBoxStatus
|
||||||
from pylitterbot.robot import VALID_WAIT_TIMES
|
from pylitterbot.robot import VALID_WAIT_TIMES
|
||||||
|
@ -23,7 +23,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import STATE_OFF
|
from homeassistant.const import STATE_OFF
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
from .entity import LitterRobotControlEntity
|
from .entity import LitterRobotControlEntity
|
||||||
|
@ -42,7 +42,7 @@ SERVICE_SET_WAIT_TIME = "set_wait_time"
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Litter-Robot cleaner using config entry."""
|
"""Set up Litter-Robot cleaner using config entry."""
|
||||||
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]
|
hub: LitterRobotHub = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
"""Support for Rituals Perfume Genie binary sensors."""
|
"""Support for Rituals Perfume Genie binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from pyrituals import Diffuser
|
from pyrituals import Diffuser
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
|
@ -11,6 +9,7 @@ from homeassistant.components.binary_sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import RitualsDataUpdateCoordinator
|
from . import RitualsDataUpdateCoordinator
|
||||||
from .const import COORDINATORS, DEVICES, DOMAIN
|
from .const import COORDINATORS, DEVICES, DOMAIN
|
||||||
|
@ -21,7 +20,9 @@ BATTERY_CHARGING_ID = 21
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the diffuser binary sensors."""
|
"""Set up the diffuser binary sensors."""
|
||||||
diffusers = hass.data[DOMAIN][config_entry.entry_id][DEVICES]
|
diffusers = hass.data[DOMAIN][config_entry.entry_id][DEVICES]
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
"""Support for Rituals Perfume Genie sensors."""
|
"""Support for Rituals Perfume Genie sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from pyrituals import Diffuser
|
from pyrituals import Diffuser
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
@ -12,6 +10,7 @@ from homeassistant.const import (
|
||||||
PERCENTAGE,
|
PERCENTAGE,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import RitualsDataUpdateCoordinator
|
from . import RitualsDataUpdateCoordinator
|
||||||
from .const import COORDINATORS, DEVICES, DOMAIN, ID, SENSORS
|
from .const import COORDINATORS, DEVICES, DOMAIN, ID, SENSORS
|
||||||
|
@ -35,7 +34,9 @@ ATTR_SIGNAL_STRENGTH = "signal_strength"
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the diffuser sensors."""
|
"""Set up the diffuser sensors."""
|
||||||
diffusers = hass.data[DOMAIN][config_entry.entry_id][DEVICES]
|
diffusers = hass.data[DOMAIN][config_entry.entry_id][DEVICES]
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
"""Support for Rituals Perfume Genie switches."""
|
"""Support for Rituals Perfume Genie switches."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from pyrituals import Diffuser
|
from pyrituals import Diffuser
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import RitualsDataUpdateCoordinator
|
from . import RitualsDataUpdateCoordinator
|
||||||
from .const import ATTRIBUTES, COORDINATORS, DEVICES, DOMAIN
|
from .const import ATTRIBUTES, COORDINATORS, DEVICES, DOMAIN
|
||||||
|
@ -21,7 +22,9 @@ ON_STATE = "1"
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities: Callable
|
hass: HomeAssistant,
|
||||||
|
config_entry: ConfigEntry,
|
||||||
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the diffuser switch."""
|
"""Set up the diffuser switch."""
|
||||||
diffusers = hass.data[DOMAIN][config_entry.entry_id][DEVICES]
|
diffusers = hass.data[DOMAIN][config_entry.entry_id][DEVICES]
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
"""SMA Solar Webconnect interface."""
|
"""SMA Solar Webconnect interface."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Coroutine
|
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pysma
|
import pysma
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -118,7 +117,7 @@ async def async_setup_platform(
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[], Coroutine],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up SMA sensors."""
|
"""Set up SMA sensors."""
|
||||||
sma_data = hass.data[DOMAIN][config_entry.entry_id]
|
sma_data = hass.data[DOMAIN][config_entry.entry_id]
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
"""Support for Twente Milieu sensors."""
|
"""Support for Twente Milieu sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from twentemilieu import (
|
from twentemilieu import (
|
||||||
WASTE_TYPE_NON_RECYCLABLE,
|
WASTE_TYPE_NON_RECYCLABLE,
|
||||||
WASTE_TYPE_ORGANIC,
|
WASTE_TYPE_ORGANIC,
|
||||||
|
@ -18,7 +16,8 @@ from homeassistant.const import CONF_ID
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import PlatformNotReady
|
from homeassistant.exceptions import PlatformNotReady
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import DATA_UPDATE, DOMAIN
|
from .const import DATA_UPDATE, DOMAIN
|
||||||
|
|
||||||
|
@ -28,7 +27,7 @@ PARALLEL_UPDATES = 1
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Twente Milieu sensor based on a config entry."""
|
"""Set up Twente Milieu sensor based on a config entry."""
|
||||||
twentemilieu = hass.data[DOMAIN][entry.data[CONF_ID]]
|
twentemilieu = hass.data[DOMAIN][entry.data[CONF_ID]]
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
"""Support for Vera binary sensors."""
|
"""Support for Vera binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
|
@ -12,7 +10,7 @@ from homeassistant.components.binary_sensor import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
from .common import ControllerData, get_controller_data
|
from .common import ControllerData, get_controller_data
|
||||||
|
@ -21,7 +19,7 @@ from .common import ControllerData, get_controller_data
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Support for Vera thermostats."""
|
"""Support for Vera thermostats."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ from homeassistant.components.climate.const import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import convert
|
from homeassistant.util import convert
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
|
@ -38,7 +38,7 @@ SUPPORT_HVAC = [HVAC_MODE_COOL, HVAC_MODE_HEAT, HVAC_MODE_HEAT_COOL, HVAC_MODE_O
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Support for Vera cover - curtains, rollershutters etc."""
|
"""Support for Vera cover - curtains, rollershutters etc."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ from homeassistant.components.cover import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
from .common import ControllerData, get_controller_data
|
from .common import ControllerData, get_controller_data
|
||||||
|
@ -22,7 +22,7 @@ from .common import ControllerData, get_controller_data
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Support for Vera lights."""
|
"""Support for Vera lights."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ from homeassistant.components.light import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
import homeassistant.util.color as color_util
|
import homeassistant.util.color as color_util
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
|
@ -26,7 +26,7 @@ from .common import ControllerData, get_controller_data
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Support for Vera locks."""
|
"""Support for Vera locks."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ from homeassistant.components.lock import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
|
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
from .common import ControllerData, get_controller_data
|
from .common import ControllerData, get_controller_data
|
||||||
|
@ -25,7 +25,7 @@ ATTR_LOW_BATTERY = "low_battery"
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
"""Support for Vera scenes."""
|
"""Support for Vera scenes."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
from homeassistant.components.scene import Scene
|
from homeassistant.components.scene import Scene
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
from .common import ControllerData, get_controller_data
|
from .common import ControllerData, get_controller_data
|
||||||
|
@ -18,7 +18,7 @@ from .const import VERA_ID_FORMAT
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from typing import Callable, cast
|
from typing import cast
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ from homeassistant.components.sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import LIGHT_LUX, PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
from homeassistant.const import LIGHT_LUX, PERCENTAGE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import convert
|
from homeassistant.util import convert
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
|
@ -26,7 +26,7 @@ SCAN_INTERVAL = timedelta(seconds=5)
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""Support for Vera switches."""
|
"""Support for Vera switches."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
import pyvera as veraApi
|
import pyvera as veraApi
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ from homeassistant.components.switch import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import convert
|
from homeassistant.util import convert
|
||||||
|
|
||||||
from . import VeraDevice
|
from . import VeraDevice
|
||||||
|
@ -22,7 +22,7 @@ from .common import ControllerData, get_controller_data
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up the sensor config entry."""
|
"""Set up the sensor config entry."""
|
||||||
controller_data = get_controller_data(hass, entry)
|
controller_data = get_controller_data(hass, entry)
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Iterable
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.alarm_control_panel import (
|
from homeassistant.components.alarm_control_panel import (
|
||||||
FORMAT_NUMBER,
|
FORMAT_NUMBER,
|
||||||
|
@ -15,7 +13,8 @@ from homeassistant.components.alarm_control_panel.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import ALARM_STATE_TO_HA, CONF_GIID, DOMAIN, LOGGER
|
from .const import ALARM_STATE_TO_HA, CONF_GIID, DOMAIN, LOGGER
|
||||||
|
@ -25,7 +24,7 @@ from .coordinator import VerisureDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[Iterable[Entity]], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Verisure alarm control panel from a config entry."""
|
"""Set up Verisure alarm control panel from a config entry."""
|
||||||
async_add_entities([VerisureAlarm(coordinator=hass.data[DOMAIN][entry.entry_id])])
|
async_add_entities([VerisureAlarm(coordinator=hass.data[DOMAIN][entry.entry_id])])
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
"""Support for Verisure binary sensors."""
|
"""Support for Verisure binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
DEVICE_CLASS_CONNECTIVITY,
|
DEVICE_CLASS_CONNECTIVITY,
|
||||||
DEVICE_CLASS_OPENING,
|
DEVICE_CLASS_OPENING,
|
||||||
|
@ -12,6 +9,7 @@ from homeassistant.components.binary_sensor import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import CONF_GIID, DOMAIN
|
from .const import CONF_GIID, DOMAIN
|
||||||
|
@ -21,7 +19,7 @@ from .coordinator import VerisureDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[Iterable[Entity]], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Verisure binary sensors based on a config entry."""
|
"""Set up Verisure binary sensors based on a config entry."""
|
||||||
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
"""Support for Verisure cameras."""
|
"""Support for Verisure cameras."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from verisure import Error as VerisureError
|
from verisure import Error as VerisureError
|
||||||
|
|
||||||
|
@ -12,8 +10,11 @@ from homeassistant.components.camera import Camera
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import async_get_current_platform
|
from homeassistant.helpers.entity_platform import (
|
||||||
|
AddEntitiesCallback,
|
||||||
|
async_get_current_platform,
|
||||||
|
)
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import CONF_GIID, DOMAIN, LOGGER, SERVICE_CAPTURE_SMARTCAM
|
from .const import CONF_GIID, DOMAIN, LOGGER, SERVICE_CAPTURE_SMARTCAM
|
||||||
|
@ -23,7 +24,7 @@ from .coordinator import VerisureDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[Iterable[Entity]], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Verisure sensors based on a config entry."""
|
"""Set up Verisure sensors based on a config entry."""
|
||||||
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Iterable
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from verisure import Error as VerisureError
|
from verisure import Error as VerisureError
|
||||||
|
|
||||||
|
@ -11,8 +9,11 @@ from homeassistant.components.lock import LockEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_CODE, STATE_LOCKED, STATE_UNLOCKED
|
from homeassistant.const import ATTR_CODE, STATE_LOCKED, STATE_UNLOCKED
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import async_get_current_platform
|
from homeassistant.helpers.entity_platform import (
|
||||||
|
AddEntitiesCallback,
|
||||||
|
async_get_current_platform,
|
||||||
|
)
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -31,7 +32,7 @@ from .coordinator import VerisureDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[Iterable[Entity]], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Verisure alarm control panel from a config entry."""
|
"""Set up Verisure alarm control panel from a config entry."""
|
||||||
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
"""Support for Verisure sensors."""
|
"""Support for Verisure sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
|
@ -13,6 +10,7 @@ from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
|
from homeassistant.const import PERCENTAGE, TEMP_CELSIUS
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo, Entity
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import CONF_GIID, DEVICE_TYPE_NAME, DOMAIN
|
from .const import CONF_GIID, DEVICE_TYPE_NAME, DOMAIN
|
||||||
|
@ -22,7 +20,7 @@ from .coordinator import VerisureDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[Iterable[Entity]], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Verisure sensors based on a config entry."""
|
"""Set up Verisure sensors based on a config entry."""
|
||||||
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
"""Support for Verisure Smartplugs."""
|
"""Support for Verisure Smartplugs."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Iterable
|
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity
|
from homeassistant.components.switch import SwitchEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
from .const import CONF_GIID, DOMAIN
|
from .const import CONF_GIID, DOMAIN
|
||||||
|
@ -18,7 +17,7 @@ from .coordinator import VerisureDataUpdateCoordinator
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
entry: ConfigEntry,
|
entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[Iterable[Entity]], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up Verisure alarm control panel from a config entry."""
|
"""Set up Verisure alarm control panel from a config entry."""
|
||||||
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
coordinator: VerisureDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any, Callable
|
from typing import Any
|
||||||
|
|
||||||
from pyvizio import VizioAsync
|
from pyvizio import VizioAsync
|
||||||
from pyvizio.api.apps import find_app_name
|
from pyvizio.api.apps import find_app_name
|
||||||
|
@ -33,7 +33,8 @@ from homeassistant.helpers.dispatcher import (
|
||||||
async_dispatcher_connect,
|
async_dispatcher_connect,
|
||||||
async_dispatcher_send,
|
async_dispatcher_send,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.entity import DeviceInfo, Entity
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
|
@ -65,7 +66,7 @@ PARALLEL_UPDATES = 0
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[Entity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up a Vizio media player entry."""
|
"""Set up a Vizio media player entry."""
|
||||||
host = config_entry.data[CONF_HOST]
|
host = config_entry.data[CONF_HOST]
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import annotations
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
import re
|
import re
|
||||||
from typing import Callable
|
|
||||||
|
|
||||||
from WazeRouteCalculator import WazeRouteCalculator, WRCError
|
from WazeRouteCalculator import WazeRouteCalculator, WRCError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
@ -24,6 +23,7 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import Config, CoreState, HomeAssistant
|
from homeassistant.core import Config, CoreState, HomeAssistant
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_DESTINATION,
|
ATTR_DESTINATION,
|
||||||
|
@ -112,7 +112,7 @@ async def async_setup_platform(
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
config_entry: ConfigEntry,
|
config_entry: ConfigEntry,
|
||||||
async_add_entities: Callable[[list[SensorEntity], bool], None],
|
async_add_entities: AddEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up a Waze travel time sensor entry."""
|
"""Set up a Waze travel time sensor entry."""
|
||||||
defaults = {
|
defaults = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue