Ruff: isort don't split imports based on trailing comma (#98162)
This commit is contained in:
parent
726b0c5179
commit
868a5f377f
117 changed files with 135 additions and 580 deletions
|
@ -22,9 +22,7 @@ from homeassistant.components.recorder import (
|
||||||
get_instance as get_recorder_instance,
|
get_instance as get_recorder_instance,
|
||||||
)
|
)
|
||||||
import homeassistant.config as conf_util
|
import homeassistant.config as conf_util
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import SOURCE_IGNORE
|
||||||
SOURCE_IGNORE,
|
|
||||||
)
|
|
||||||
from homeassistant.const import ATTR_DOMAIN, __version__ as HA_VERSION
|
from homeassistant.const import ATTR_DOMAIN, __version__ as HA_VERSION
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
|
@ -3,9 +3,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.device_automation import (
|
from homeassistant.components.device_automation import DEVICE_TRIGGER_BASE_SCHEMA
|
||||||
DEVICE_TRIGGER_BASE_SCHEMA,
|
|
||||||
)
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
CONF_DEVICE_ID,
|
CONF_DEVICE_ID,
|
||||||
|
|
|
@ -4,10 +4,7 @@ from datetime import datetime
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from aiohttp import ClientError
|
from aiohttp import ClientError
|
||||||
from yalexs.activity import (
|
from yalexs.activity import Activity, ActivityType
|
||||||
Activity,
|
|
||||||
ActivityType,
|
|
||||||
)
|
|
||||||
from yalexs.api_async import ApiAsync
|
from yalexs.api_async import ApiAsync
|
||||||
from yalexs.pubnub_async import AugustPubNub
|
from yalexs.pubnub_async import AugustPubNub
|
||||||
from yalexs.util import get_latest_activity
|
from yalexs.util import get_latest_activity
|
||||||
|
|
|
@ -7,10 +7,7 @@ from aiohttp import ClientError
|
||||||
from auroranoaa import AuroraForecast
|
from auroranoaa import AuroraForecast
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
DataUpdateCoordinator,
|
|
||||||
UpdateFailed,
|
|
||||||
)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -4,14 +4,9 @@ import logging
|
||||||
|
|
||||||
from homeassistant.helpers.device_registry import DeviceEntryType
|
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
CoordinatorEntity,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import (
|
from .const import ATTRIBUTION, DOMAIN
|
||||||
ATTRIBUTION,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from .coordinator import AuroraDataUpdateCoordinator
|
from .coordinator import AuroraDataUpdateCoordinator
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
@ -13,11 +13,7 @@ from python_awair.devices import AwairBaseDevice, AwairLocalDevice
|
||||||
from python_awair.exceptions import AuthError, AwairError
|
from python_awair.exceptions import AuthError, AwairError
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_HOST, Platform
|
||||||
CONF_ACCESS_TOKEN,
|
|
||||||
CONF_HOST,
|
|
||||||
Platform,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryAuthFailed
|
from homeassistant.exceptions import ConfigEntryAuthFailed
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
|
@ -16,14 +16,8 @@ from homeassistant.const import (
|
||||||
EntityCategory,
|
EntityCategory,
|
||||||
)
|
)
|
||||||
from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, callback
|
from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import (
|
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription
|
||||||
DeviceInfo,
|
from homeassistant.helpers.entity_platform import async_get_current_platform
|
||||||
Entity,
|
|
||||||
EntityDescription,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.entity_platform import (
|
|
||||||
async_get_current_platform,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
from homeassistant.helpers.storage import Store
|
from homeassistant.helpers.storage import Store
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
|
@ -12,14 +12,8 @@ from .api import (
|
||||||
async_register_callback,
|
async_register_callback,
|
||||||
async_track_unavailable,
|
async_track_unavailable,
|
||||||
)
|
)
|
||||||
from .match import (
|
from .match import BluetoothCallbackMatcher
|
||||||
BluetoothCallbackMatcher,
|
from .models import BluetoothChange, BluetoothScanningMode, BluetoothServiceInfoBleak
|
||||||
)
|
|
||||||
from .models import (
|
|
||||||
BluetoothChange,
|
|
||||||
BluetoothScanningMode,
|
|
||||||
BluetoothServiceInfoBleak,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class BasePassiveBluetoothCoordinator(ABC):
|
class BasePassiveBluetoothCoordinator(ABC):
|
||||||
|
|
|
@ -8,11 +8,7 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.device_registry import async_get
|
from homeassistant.helpers.device_registry import async_get
|
||||||
from homeassistant.helpers.typing import EventType
|
from homeassistant.helpers.typing import EventType
|
||||||
|
|
||||||
from .const import (
|
from .const import BTHOME_BLE_EVENT, DOMAIN, BTHomeBleEvent
|
||||||
BTHOME_BLE_EVENT,
|
|
||||||
DOMAIN,
|
|
||||||
BTHomeBleEvent,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
|
|
@ -5,11 +5,7 @@ from datetime import datetime, timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_HOST, CONF_PORT, Platform
|
||||||
CONF_HOST,
|
|
||||||
CONF_PORT,
|
|
||||||
Platform,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.start import async_at_started
|
from homeassistant.helpers.start import async_at_started
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
|
@ -5,10 +5,7 @@ from typing import Any
|
||||||
|
|
||||||
from duotecno.unit import DuoswitchUnit
|
from duotecno.unit import DuoswitchUnit
|
||||||
|
|
||||||
from homeassistant.components.cover import (
|
from homeassistant.components.cover import CoverEntity, CoverEntityFeature
|
||||||
CoverEntity,
|
|
||||||
CoverEntityFeature,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
|
@ -3,11 +3,7 @@ from typing import Any
|
||||||
|
|
||||||
from duotecno.unit import DimUnit
|
from duotecno.unit import DimUnit
|
||||||
|
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
|
||||||
ATTR_BRIGHTNESS,
|
|
||||||
ColorMode,
|
|
||||||
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.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
|
|
@ -6,11 +6,7 @@ import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from awesomeversion import AwesomeVersion
|
from awesomeversion import AwesomeVersion
|
||||||
from pyenphase import (
|
from pyenphase import AUTH_TOKEN_MIN_VERSION, Envoy, EnvoyError
|
||||||
AUTH_TOKEN_MIN_VERSION,
|
|
||||||
Envoy,
|
|
||||||
EnvoyError,
|
|
||||||
)
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
"""The enphase_envoy component."""
|
"""The enphase_envoy component."""
|
||||||
from pyenphase import (
|
from pyenphase import EnvoyAuthenticationError, EnvoyAuthenticationRequired
|
||||||
EnvoyAuthenticationError,
|
|
||||||
EnvoyAuthenticationRequired,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant.const import Platform
|
from homeassistant.const import Platform
|
||||||
|
|
||||||
|
|
|
@ -7,11 +7,7 @@ from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pyenphase import (
|
from pyenphase import Envoy, EnvoyError, EnvoyTokenAuth
|
||||||
Envoy,
|
|
||||||
EnvoyError,
|
|
||||||
EnvoyTokenAuth,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
|
from homeassistant.const import CONF_NAME, CONF_PASSWORD, CONF_TOKEN, CONF_USERNAME
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
"""Support for esphome devices."""
|
"""Support for esphome devices."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from aioesphomeapi import (
|
from aioesphomeapi import APIClient
|
||||||
APIClient,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant.components import zeroconf
|
from homeassistant.components import zeroconf
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
|
@ -17,10 +15,7 @@ from homeassistant.core import HomeAssistant
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
|
||||||
from .const import (
|
from .const import CONF_NOISE_PSK, DOMAIN
|
||||||
CONF_NOISE_PSK,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from .dashboard import async_setup as async_setup_dashboard
|
from .dashboard import async_setup as async_setup_dashboard
|
||||||
from .domain_data import DomainData
|
from .domain_data import DomainData
|
||||||
|
|
||||||
|
|
|
@ -31,11 +31,7 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
from .enum_mapper import EsphomeEnumMapper
|
from .enum_mapper import EsphomeEnumMapper
|
||||||
|
|
||||||
_ESPHOME_ACP_STATE_TO_HASS_STATE: EsphomeEnumMapper[
|
_ESPHOME_ACP_STATE_TO_HASS_STATE: EsphomeEnumMapper[
|
||||||
|
|
|
@ -14,11 +14,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .domain_data import DomainData
|
from .domain_data import DomainData
|
||||||
from .entity import (
|
from .entity import EsphomeAssistEntity, EsphomeEntity, platform_async_setup_entry
|
||||||
EsphomeAssistEntity,
|
|
||||||
EsphomeEntity,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
|
|
|
@ -16,10 +16,7 @@ from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback as hass_ca
|
||||||
|
|
||||||
from ..entry_data import RuntimeEntryData
|
from ..entry_data import RuntimeEntryData
|
||||||
from .cache import ESPHomeBluetoothCache
|
from .cache import ESPHomeBluetoothCache
|
||||||
from .client import (
|
from .client import ESPHomeClient, ESPHomeClientData
|
||||||
ESPHomeClient,
|
|
||||||
ESPHomeClientData,
|
|
||||||
)
|
|
||||||
from .device import ESPHomeBluetoothDevice
|
from .device import ESPHomeBluetoothDevice
|
||||||
from .scanner import ESPHomeScanner
|
from .scanner import ESPHomeScanner
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,7 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
|
|
|
@ -15,10 +15,7 @@ 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 homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
|
|
|
@ -55,11 +55,7 @@ from homeassistant.const import (
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
from .enum_mapper import EsphomeEnumMapper
|
from .enum_mapper import EsphomeEnumMapper
|
||||||
|
|
||||||
FAN_QUIET = "quiet"
|
FAN_QUIET = "quiet"
|
||||||
|
|
|
@ -17,11 +17,7 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
|
|
|
@ -4,12 +4,7 @@ from __future__ import annotations
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
import functools
|
import functools
|
||||||
import math
|
import math
|
||||||
from typing import ( # pylint: disable=unused-import
|
from typing import Any, Generic, TypeVar, cast # pylint: disable=unused-import
|
||||||
Any,
|
|
||||||
Generic,
|
|
||||||
TypeVar,
|
|
||||||
cast,
|
|
||||||
)
|
|
||||||
|
|
||||||
from aioesphomeapi import (
|
from aioesphomeapi import (
|
||||||
EntityCategory as EsphomeEntityCategory,
|
EntityCategory as EsphomeEntityCategory,
|
||||||
|
@ -19,16 +14,12 @@ from aioesphomeapi import (
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import EntityCategory
|
||||||
EntityCategory,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import entity_platform
|
from homeassistant.helpers import entity_platform
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
import homeassistant.helpers.device_registry as dr
|
import homeassistant.helpers.device_registry as dr
|
||||||
from homeassistant.helpers.dispatcher import (
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
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 homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
|
|
|
@ -22,11 +22,7 @@ from homeassistant.util.percentage import (
|
||||||
ranged_value_to_percentage,
|
ranged_value_to_percentage,
|
||||||
)
|
)
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
from .enum_mapper import EsphomeEnumMapper
|
from .enum_mapper import EsphomeEnumMapper
|
||||||
|
|
||||||
ORDERED_NAMED_FAN_SPEEDS = [FanSpeed.LOW, FanSpeed.MEDIUM, FanSpeed.HIGH]
|
ORDERED_NAMED_FAN_SPEEDS = [FanSpeed.LOW, FanSpeed.MEDIUM, FanSpeed.HIGH]
|
||||||
|
|
|
@ -31,11 +31,7 @@ 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 homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
FLASH_LENGTHS = {FLASH_SHORT: 2, FLASH_LONG: 10}
|
FLASH_LENGTHS = {FLASH_SHORT: 2, FLASH_LONG: 10}
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,7 @@ from homeassistant.const import ATTR_CODE
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
|
|
|
@ -23,11 +23,7 @@ import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import tag, zeroconf
|
from homeassistant.components import tag, zeroconf
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_DEVICE_ID, CONF_MODE, EVENT_HOMEASSISTANT_STOP
|
||||||
ATTR_DEVICE_ID,
|
|
||||||
CONF_MODE,
|
|
||||||
EVENT_HOMEASSISTANT_STOP,
|
|
||||||
)
|
|
||||||
from homeassistant.core import Event, HomeAssistant, ServiceCall, State, callback
|
from homeassistant.core import Event, HomeAssistant, ServiceCall, State, callback
|
||||||
from homeassistant.exceptions import TemplateError
|
from homeassistant.exceptions import TemplateError
|
||||||
from homeassistant.helpers import template
|
from homeassistant.helpers import template
|
||||||
|
|
|
@ -25,11 +25,7 @@ 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 homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
from .enum_mapper import EsphomeEnumMapper
|
from .enum_mapper import EsphomeEnumMapper
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,7 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
from .enum_mapper import EsphomeEnumMapper
|
from .enum_mapper import EsphomeEnumMapper
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
from .enum_mapper import EsphomeEnumMapper
|
from .enum_mapper import EsphomeEnumMapper
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,7 @@ from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.util.enum import try_parse_enum
|
from homeassistant.util.enum import try_parse_enum
|
||||||
|
|
||||||
from .entity import (
|
from .entity import EsphomeEntity, esphome_state_property, platform_async_setup_entry
|
||||||
EsphomeEntity,
|
|
||||||
esphome_state_property,
|
|
||||||
platform_async_setup_entry,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
|
|
|
@ -24,11 +24,7 @@ from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import (
|
from .const import DATA_COORDINATOR, DOMAIN, MANUFACTURER
|
||||||
DATA_COORDINATOR,
|
|
||||||
DOMAIN,
|
|
||||||
MANUFACTURER,
|
|
||||||
)
|
|
||||||
from .coordinator import EzvizDataUpdateCoordinator
|
from .coordinator import EzvizDataUpdateCoordinator
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
@ -4,19 +4,12 @@ from __future__ import annotations
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.components.image import Image, ImageEntity, ImageEntityDescription
|
from homeassistant.components.image import Image, ImageEntity, ImageEntityDescription
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import ConfigEntry
|
||||||
ConfigEntry,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity_platform import (
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
AddEntitiesCallback,
|
|
||||||
)
|
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
from .const import (
|
from .const import DATA_COORDINATOR, DOMAIN
|
||||||
DATA_COORDINATOR,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from .coordinator import EzvizDataUpdateCoordinator
|
from .coordinator import EzvizDataUpdateCoordinator
|
||||||
from .entity import EzvizEntity
|
from .entity import EzvizEntity
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@ from homeassistant.const import CONF_HOST, CONF_PORT, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import ConfigEntryNotReady
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
|
|
||||||
from .const import (
|
from .const import DOMAIN
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from .coordinator import FiveMDataUpdateCoordinator
|
from .coordinator import FiveMDataUpdateCoordinator
|
||||||
|
|
||||||
PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR]
|
PLATFORMS: list[Platform] = [Platform.BINARY_SENSOR, Platform.SENSOR]
|
||||||
|
|
|
@ -10,10 +10,7 @@ from fivem import FiveM, FiveMServerOfflineError
|
||||||
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
DataUpdateCoordinator,
|
|
||||||
UpdateFailed,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_PLAYERS_LIST,
|
ATTR_PLAYERS_LIST,
|
||||||
|
|
|
@ -7,14 +7,9 @@ import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.helpers.entity import DeviceInfo, EntityDescription
|
from homeassistant.helpers.entity import DeviceInfo, EntityDescription
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
CoordinatorEntity,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import (
|
from .const import DOMAIN, MANUFACTURER
|
||||||
DOMAIN,
|
|
||||||
MANUFACTURER,
|
|
||||||
)
|
|
||||||
from .coordinator import FiveMDataUpdateCoordinator
|
from .coordinator import FiveMDataUpdateCoordinator
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
@ -10,9 +10,7 @@ from homeassistant.components.binary_sensor import (
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import EntityCategory
|
||||||
EntityCategory,
|
|
||||||
)
|
|
||||||
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_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
|
@ -6,10 +6,7 @@ from dataclasses import dataclass, field
|
||||||
from gardena_bluetooth.const import Reset
|
from gardena_bluetooth.const import Reset
|
||||||
from gardena_bluetooth.parse import CharacteristicBool
|
from gardena_bluetooth.parse import CharacteristicBool
|
||||||
|
|
||||||
from homeassistant.components.button import (
|
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
|
||||||
ButtonEntity,
|
|
||||||
ButtonEntityDescription,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import EntityCategory
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
|
@ -7,13 +7,7 @@ from typing import Final
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.const import CONF_EVENT, CONF_PLATFORM, CONF_SOURCE, CONF_ZONE
|
from homeassistant.const import CONF_EVENT, CONF_PLATFORM, CONF_SOURCE, CONF_ZONE
|
||||||
from homeassistant.core import (
|
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, State, callback
|
||||||
CALLBACK_TYPE,
|
|
||||||
HassJob,
|
|
||||||
HomeAssistant,
|
|
||||||
State,
|
|
||||||
callback,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers import condition, config_validation as cv
|
from homeassistant.helpers import condition, config_validation as cv
|
||||||
from homeassistant.helpers.config_validation import entity_domain
|
from homeassistant.helpers.config_validation import entity_domain
|
||||||
from homeassistant.helpers.event import (
|
from homeassistant.helpers.event import (
|
||||||
|
|
|
@ -8,13 +8,7 @@ import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import exceptions
|
from homeassistant import exceptions
|
||||||
from homeassistant.const import CONF_ATTRIBUTE, CONF_FOR, CONF_PLATFORM, MATCH_ALL
|
from homeassistant.const import CONF_ATTRIBUTE, CONF_FOR, CONF_PLATFORM, MATCH_ALL
|
||||||
from homeassistant.core import (
|
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, State, callback
|
||||||
CALLBACK_TYPE,
|
|
||||||
HassJob,
|
|
||||||
HomeAssistant,
|
|
||||||
State,
|
|
||||||
callback,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import (
|
||||||
config_validation as cv,
|
config_validation as cv,
|
||||||
entity_registry as er,
|
entity_registry as er,
|
||||||
|
|
|
@ -6,10 +6,7 @@ from typing import Any
|
||||||
from aiohue.v2 import HueBridgeV2
|
from aiohue.v2 import HueBridgeV2
|
||||||
from aiohue.v2.controllers.events import EventType
|
from aiohue.v2.controllers.events import EventType
|
||||||
from aiohue.v2.models.button import Button
|
from aiohue.v2.models.button import Button
|
||||||
from aiohue.v2.models.relative_rotary import (
|
from aiohue.v2.models.relative_rotary import RelativeRotary, RelativeRotaryDirection
|
||||||
RelativeRotary,
|
|
||||||
RelativeRotaryDirection,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant.components.event import (
|
from homeassistant.components.event import (
|
||||||
EventDeviceClass,
|
EventDeviceClass,
|
||||||
|
|
|
@ -4,11 +4,7 @@ from __future__ import annotations
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
from xknx import XKNX
|
from xknx import XKNX
|
||||||
from xknx.devices.light import (
|
from xknx.devices.light import ColorTemperatureType, Light as XknxLight, XYYColor
|
||||||
ColorTemperatureType,
|
|
||||||
Light as XknxLight,
|
|
||||||
XYYColor,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components.light import (
|
from homeassistant.components.light import (
|
||||||
|
|
|
@ -11,11 +11,7 @@ from homeassistant.const import CONF_API_KEY
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
|
|
||||||
from .const import (
|
from .const import CONF_USERS, DOMAIN, LOGGER
|
||||||
CONF_USERS,
|
|
||||||
DOMAIN,
|
|
||||||
LOGGER,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def format_track(track: Track | None) -> str | None:
|
def format_track(track: Track | None) -> str | None:
|
||||||
|
|
|
@ -16,9 +16,7 @@ from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
CoordinatorEntity,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_LAST_PLAYED,
|
ATTR_LAST_PLAYED,
|
||||||
|
|
|
@ -15,11 +15,7 @@ from homeassistant.components.event import (
|
||||||
EventEntity,
|
EventEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME, CONF_VALUE_TEMPLATE
|
||||||
CONF_DEVICE_CLASS,
|
|
||||||
CONF_NAME,
|
|
||||||
CONF_VALUE_TEMPLATE,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -36,11 +32,7 @@ from .const import (
|
||||||
PAYLOAD_NONE,
|
PAYLOAD_NONE,
|
||||||
)
|
)
|
||||||
from .debug_info import log_messages
|
from .debug_info import log_messages
|
||||||
from .mixins import (
|
from .mixins import MQTT_ENTITY_COMMON_SCHEMA, MqttEntity, async_setup_entry_helper
|
||||||
MQTT_ENTITY_COMMON_SCHEMA,
|
|
||||||
MqttEntity,
|
|
||||||
async_setup_entry_helper,
|
|
||||||
)
|
|
||||||
from .models import (
|
from .models import (
|
||||||
MqttValueTemplate,
|
MqttValueTemplate,
|
||||||
PayloadSentinel,
|
PayloadSentinel,
|
||||||
|
|
|
@ -12,10 +12,7 @@ import httpx
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import image
|
from homeassistant.components import image
|
||||||
from homeassistant.components.image import (
|
from homeassistant.components.image import DEFAULT_CONTENT_TYPE, ImageEntity
|
||||||
DEFAULT_CONTENT_TYPE,
|
|
||||||
ImageEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
|
|
@ -17,11 +17,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
from .config import MQTT_BASE_SCHEMA
|
from .config import MQTT_BASE_SCHEMA
|
||||||
from .const import CONF_COMMAND_TOPIC, CONF_ENCODING, CONF_QOS, CONF_RETAIN
|
from .const import CONF_COMMAND_TOPIC, CONF_ENCODING, CONF_QOS, CONF_RETAIN
|
||||||
from .mixins import (
|
from .mixins import MQTT_ENTITY_COMMON_SCHEMA, MqttEntity, async_setup_entry_helper
|
||||||
MQTT_ENTITY_COMMON_SCHEMA,
|
|
||||||
MqttEntity,
|
|
||||||
async_setup_entry_helper,
|
|
||||||
)
|
|
||||||
from .util import valid_publish_topic
|
from .util import valid_publish_topic
|
||||||
|
|
||||||
DEFAULT_NAME = "MQTT Scene"
|
DEFAULT_NAME = "MQTT Scene"
|
||||||
|
|
|
@ -17,11 +17,7 @@ from homeassistant.components.climate import (
|
||||||
HVACMode,
|
HVACMode,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_NAME, PRECISION_TENTHS, UnitOfTemperature
|
||||||
ATTR_NAME,
|
|
||||||
PRECISION_TENTHS,
|
|
||||||
UnitOfTemperature,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
|
@ -9,11 +9,7 @@ from homeassistant.components.sensor import (
|
||||||
SensorStateClass,
|
SensorStateClass,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_MODEL, ATTR_NAME, UnitOfTemperature
|
||||||
ATTR_MODEL,
|
|
||||||
ATTR_NAME,
|
|
||||||
UnitOfTemperature,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
|
@ -6,12 +6,7 @@ from typing import Any
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import ConfigFlow
|
from homeassistant.config_entries import ConfigFlow
|
||||||
from homeassistant.const import (
|
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, CONF_RADIUS
|
||||||
CONF_LATITUDE,
|
|
||||||
CONF_LONGITUDE,
|
|
||||||
CONF_NAME,
|
|
||||||
CONF_RADIUS,
|
|
||||||
)
|
|
||||||
from homeassistant.data_entry_flow import FlowResult
|
from homeassistant.data_entry_flow import FlowResult
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
|
|
@ -10,10 +10,7 @@ from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
|
|
||||||
from .const import (
|
from .const import CONF_STATION, DOMAIN
|
||||||
CONF_STATION,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from .coordinator import PegelOnlineDataUpdateCoordinator
|
from .coordinator import PegelOnlineDataUpdateCoordinator
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
@ -21,12 +21,7 @@ from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
from homeassistant.util import Throttle
|
from homeassistant.util import Throttle
|
||||||
from homeassistant.util.dt import get_time_zone
|
from homeassistant.util.dt import get_time_zone
|
||||||
|
|
||||||
from .const import (
|
from .const import CONF_HOUSE_NUMBER, CONF_HOUSE_NUMBER_SUFFIX, CONF_ZIP_CODE, LOGGER
|
||||||
CONF_HOUSE_NUMBER,
|
|
||||||
CONF_HOUSE_NUMBER_SUFFIX,
|
|
||||||
CONF_ZIP_CODE,
|
|
||||||
LOGGER,
|
|
||||||
)
|
|
||||||
|
|
||||||
UPDATE_DELAY = timedelta(hours=12)
|
UPDATE_DELAY = timedelta(hours=12)
|
||||||
SCAN_INTERVAL = timedelta(hours=12)
|
SCAN_INTERVAL = timedelta(hours=12)
|
||||||
|
|
|
@ -62,11 +62,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
from homeassistant.util import Throttle, slugify
|
from homeassistant.util import Throttle, slugify
|
||||||
|
|
||||||
from .const import (
|
from .const import ATTR_SMHI_THUNDER_PROBABILITY, DOMAIN, ENTITY_ID_SENSOR_FORMAT
|
||||||
ATTR_SMHI_THUNDER_PROBABILITY,
|
|
||||||
DOMAIN,
|
|
||||||
ENTITY_ID_SENSOR_FORMAT,
|
|
||||||
)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -6,10 +6,7 @@ from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.image import (
|
from homeassistant.components.image import DOMAIN as IMAGE_DOMAIN, ImageEntity
|
||||||
DOMAIN as IMAGE_DOMAIN,
|
|
||||||
ImageEntity,
|
|
||||||
)
|
|
||||||
from homeassistant.const import CONF_UNIQUE_ID, CONF_URL, CONF_VERIFY_SSL
|
from homeassistant.const import CONF_UNIQUE_ID, CONF_URL, CONF_VERIFY_SSL
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import TemplateError
|
from homeassistant.exceptions import TemplateError
|
||||||
|
@ -20,10 +17,7 @@ from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
from . import TriggerUpdateCoordinator
|
from . import TriggerUpdateCoordinator
|
||||||
from .const import CONF_PICTURE
|
from .const import CONF_PICTURE
|
||||||
from .template_entity import (
|
from .template_entity import TemplateEntity, make_template_entity_common_schema
|
||||||
TemplateEntity,
|
|
||||||
make_template_entity_common_schema,
|
|
||||||
)
|
|
||||||
from .trigger_entity import TriggerEntity
|
from .trigger_entity import TriggerEntity
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
|
@ -41,9 +41,7 @@ from homeassistant.components.switch import (
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import EntityCategory
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.device_registry import (
|
from homeassistant.helpers.device_registry import DeviceEntryType
|
||||||
DeviceEntryType,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,7 @@ from homeassistant.components.select import SelectEntity
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_UNIQUE_ID
|
from homeassistant.const import CONF_UNIQUE_ID
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||||
device_registry as dr,
|
|
||||||
entity_registry as er,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.restore_state import RestoreEntity
|
from homeassistant.helpers.restore_state import RestoreEntity
|
||||||
|
|
|
@ -37,13 +37,7 @@ from homeassistant.const import __version__
|
||||||
from homeassistant.core import Context, HomeAssistant
|
from homeassistant.core import Context, HomeAssistant
|
||||||
from homeassistant.util.ulid import ulid
|
from homeassistant.util.ulid import ulid
|
||||||
|
|
||||||
from .const import (
|
from .const import CHANNELS, DOMAIN, RATE, RTP_AUDIO_SETTINGS, WIDTH
|
||||||
CHANNELS,
|
|
||||||
DOMAIN,
|
|
||||||
RATE,
|
|
||||||
RTP_AUDIO_SETTINGS,
|
|
||||||
WIDTH,
|
|
||||||
)
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .devices import VoIPDevice, VoIPDevices
|
from .devices import VoIPDevice, VoIPDevices
|
||||||
|
|
|
@ -20,10 +20,7 @@ from homeassistant.util.percentage import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import async_wemo_dispatcher_connect
|
from . import async_wemo_dispatcher_connect
|
||||||
from .const import (
|
from .const import SERVICE_RESET_FILTER_LIFE, SERVICE_SET_HUMIDITY
|
||||||
SERVICE_RESET_FILTER_LIFE,
|
|
||||||
SERVICE_SET_HUMIDITY,
|
|
||||||
)
|
|
||||||
from .entity import WemoBinaryStateEntity
|
from .entity import WemoBinaryStateEntity
|
||||||
from .wemo_device import DeviceCoordinator
|
from .wemo_device import DeviceCoordinator
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,7 @@ from homeassistant.const import (
|
||||||
CONF_PLATFORM,
|
CONF_PLATFORM,
|
||||||
CONF_ZONE,
|
CONF_ZONE,
|
||||||
)
|
)
|
||||||
from homeassistant.core import (
|
from homeassistant.core import CALLBACK_TYPE, HassJob, HomeAssistant, callback
|
||||||
CALLBACK_TYPE,
|
|
||||||
HassJob,
|
|
||||||
HomeAssistant,
|
|
||||||
callback,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import (
|
||||||
condition,
|
condition,
|
||||||
config_validation as cv,
|
config_validation as cv,
|
||||||
|
|
|
@ -26,16 +26,7 @@ import re
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
from time import monotonic
|
from time import monotonic
|
||||||
from typing import (
|
from typing import TYPE_CHECKING, Any, Generic, ParamSpec, Self, TypeVar, cast, overload
|
||||||
TYPE_CHECKING,
|
|
||||||
Any,
|
|
||||||
Generic,
|
|
||||||
ParamSpec,
|
|
||||||
Self,
|
|
||||||
TypeVar,
|
|
||||||
cast,
|
|
||||||
overload,
|
|
||||||
)
|
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
import async_timeout
|
import async_timeout
|
||||||
|
|
|
@ -26,10 +26,7 @@ from homeassistant.core import (
|
||||||
split_entity_id,
|
split_entity_id,
|
||||||
valid_entity_id,
|
valid_entity_id,
|
||||||
)
|
)
|
||||||
from homeassistant.exceptions import (
|
from homeassistant.exceptions import HomeAssistantError, PlatformNotReady
|
||||||
HomeAssistantError,
|
|
||||||
PlatformNotReady,
|
|
||||||
)
|
|
||||||
from homeassistant.generated import languages
|
from homeassistant.generated import languages
|
||||||
from homeassistant.setup import async_start_setup
|
from homeassistant.setup import async_start_setup
|
||||||
from homeassistant.util.async_ import run_callback_threadsafe
|
from homeassistant.util.async_ import run_callback_threadsafe
|
||||||
|
|
|
@ -537,6 +537,7 @@ known-first-party = [
|
||||||
"homeassistant",
|
"homeassistant",
|
||||||
]
|
]
|
||||||
combine-as-imports = true
|
combine-as-imports = true
|
||||||
|
split-on-trailing-comma = false
|
||||||
|
|
||||||
[tool.ruff.per-file-ignores]
|
[tool.ruff.per-file-ignores]
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,7 @@ from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from . import (
|
from . import TEST_SYSTEM_DATA, TEST_SYSTEM_URL, add_mock_config
|
||||||
TEST_SYSTEM_DATA,
|
|
||||||
TEST_SYSTEM_URL,
|
|
||||||
add_mock_config,
|
|
||||||
)
|
|
||||||
|
|
||||||
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
from tests.components.diagnostics import get_diagnostics_for_config_entry
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
|
@ -5,9 +5,7 @@ import voluptuous_serialize
|
||||||
|
|
||||||
import homeassistant.components.automation as automation
|
import homeassistant.components.automation as automation
|
||||||
from homeassistant.components.climate import DOMAIN, HVACMode, const, device_action
|
from homeassistant.components.climate import DOMAIN, HVACMode, const, device_action
|
||||||
from homeassistant.components.device_automation import (
|
from homeassistant.components.device_automation import DeviceAutomationType
|
||||||
DeviceAutomationType,
|
|
||||||
)
|
|
||||||
from homeassistant.const import EntityCategory
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import (
|
||||||
|
|
|
@ -3,11 +3,7 @@ from unittest import mock
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
import homeassistant.components.datadog as datadog
|
import homeassistant.components.datadog as datadog
|
||||||
from homeassistant.const import (
|
from homeassistant.const import EVENT_LOGBOOK_ENTRY, STATE_OFF, STATE_ON
|
||||||
EVENT_LOGBOOK_ENTRY,
|
|
||||||
STATE_OFF,
|
|
||||||
STATE_ON,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,7 @@ from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from .test_gateway import DECONZ_WEB_REQUEST, setup_deconz_integration
|
from .test_gateway import DECONZ_WEB_REQUEST, setup_deconz_integration
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import async_get_device_automations, async_mock_service
|
||||||
async_get_device_automations,
|
|
||||||
async_mock_service,
|
|
||||||
)
|
|
||||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,7 @@ from devolo_plc_api.exceptions.device import DevicePasswordProtected, DeviceUnav
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.components.button import (
|
from homeassistant.components.button import DOMAIN as PLATFORM, SERVICE_PRESS
|
||||||
DOMAIN as PLATFORM,
|
|
||||||
SERVICE_PRESS,
|
|
||||||
)
|
|
||||||
from homeassistant.components.devolo_home_network.const import DOMAIN
|
from homeassistant.components.devolo_home_network.const import DOMAIN
|
||||||
from homeassistant.config_entries import SOURCE_REAUTH
|
from homeassistant.config_entries import SOURCE_REAUTH
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID
|
||||||
|
|
|
@ -19,9 +19,7 @@ import async_timeout
|
||||||
import pytest
|
import pytest
|
||||||
from zeroconf import Zeroconf
|
from zeroconf import Zeroconf
|
||||||
|
|
||||||
from homeassistant.components.esphome import (
|
from homeassistant.components.esphome import dashboard
|
||||||
dashboard,
|
|
||||||
)
|
|
||||||
from homeassistant.components.esphome.const import (
|
from homeassistant.components.esphome.const import (
|
||||||
CONF_ALLOW_SERVICE_CALLS,
|
CONF_ALLOW_SERVICE_CALLS,
|
||||||
CONF_DEVICE_NAME,
|
CONF_DEVICE_NAME,
|
||||||
|
|
|
@ -21,11 +21,7 @@ from homeassistant.components.alarm_control_panel import (
|
||||||
SERVICE_ALARM_TRIGGER,
|
SERVICE_ALARM_TRIGGER,
|
||||||
)
|
)
|
||||||
from homeassistant.components.esphome.alarm_control_panel import EspHomeACPFeatures
|
from homeassistant.components.esphome.alarm_control_panel import EspHomeACPFeatures
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_ENTITY_ID, STATE_ALARM_ARMED_AWAY, STATE_UNKNOWN
|
||||||
ATTR_ENTITY_ID,
|
|
||||||
STATE_ALARM_ARMED_AWAY,
|
|
||||||
STATE_UNKNOWN,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,7 @@ from unittest.mock import call
|
||||||
|
|
||||||
from aioesphomeapi import APIClient, ButtonInfo
|
from aioesphomeapi import APIClient, ButtonInfo
|
||||||
|
|
||||||
from homeassistant.components.button import (
|
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
|
||||||
DOMAIN as BUTTON_DOMAIN,
|
|
||||||
SERVICE_PRESS,
|
|
||||||
)
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, STATE_UNKNOWN
|
from homeassistant.const import ATTR_ENTITY_ID, STATE_UNAVAILABLE, STATE_UNKNOWN
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,7 @@ from aioesphomeapi import (
|
||||||
UserService,
|
UserService,
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.components.camera import (
|
from homeassistant.components.camera import STATE_IDLE
|
||||||
STATE_IDLE,
|
|
||||||
)
|
|
||||||
from homeassistant.const import STATE_UNAVAILABLE
|
from homeassistant.const import STATE_UNAVAILABLE
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,7 @@ import pytest
|
||||||
|
|
||||||
from homeassistant import config_entries, data_entry_flow
|
from homeassistant import config_entries, data_entry_flow
|
||||||
from homeassistant.components import dhcp, zeroconf
|
from homeassistant.components import dhcp, zeroconf
|
||||||
from homeassistant.components.esphome import (
|
from homeassistant.components.esphome import DomainData, dashboard
|
||||||
DomainData,
|
|
||||||
dashboard,
|
|
||||||
)
|
|
||||||
from homeassistant.components.esphome.const import (
|
from homeassistant.components.esphome.const import (
|
||||||
CONF_ALLOW_SERVICE_CALLS,
|
CONF_ALLOW_SERVICE_CALLS,
|
||||||
CONF_DEVICE_NAME,
|
CONF_DEVICE_NAME,
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
"""Tests for the diagnostics data provided by the ESPHome integration."""
|
"""Tests for the diagnostics data provided by the ESPHome integration."""
|
||||||
|
|
||||||
|
|
||||||
from homeassistant.components.esphome.const import (
|
from homeassistant.components.esphome.const import CONF_DEVICE_NAME, CONF_NOISE_PSK
|
||||||
CONF_DEVICE_NAME,
|
|
||||||
CONF_NOISE_PSK,
|
|
||||||
)
|
|
||||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,7 @@
|
||||||
"""Test ESPHome manager."""
|
"""Test ESPHome manager."""
|
||||||
from collections.abc import Awaitable, Callable
|
from collections.abc import Awaitable, Callable
|
||||||
|
|
||||||
from aioesphomeapi import (
|
from aioesphomeapi import APIClient, EntityInfo, EntityState, UserService
|
||||||
APIClient,
|
|
||||||
EntityInfo,
|
|
||||||
EntityState,
|
|
||||||
UserService,
|
|
||||||
)
|
|
||||||
|
|
||||||
from homeassistant.components.esphome.const import DOMAIN, STABLE_BLE_VERSION_STR
|
from homeassistant.components.esphome.const import DOMAIN, STABLE_BLE_VERSION_STR
|
||||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_PORT
|
||||||
|
|
|
@ -32,9 +32,7 @@ from homeassistant.const import ATTR_ENTITY_ID
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import mock_platform
|
||||||
mock_platform,
|
|
||||||
)
|
|
||||||
from tests.typing import WebSocketGenerator
|
from tests.typing import WebSocketGenerator
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,11 +18,7 @@ from aioesphomeapi import (
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.components.sensor import ATTR_STATE_CLASS, SensorStateClass
|
from homeassistant.components.sensor import ATTR_STATE_CLASS, SensorStateClass
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_ICON, ATTR_UNIT_OF_MEASUREMENT, STATE_UNKNOWN
|
||||||
ATTR_ICON,
|
|
||||||
ATTR_UNIT_OF_MEASUREMENT,
|
|
||||||
STATE_UNKNOWN,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
from homeassistant.helpers import entity_registry as er
|
||||||
from homeassistant.helpers.entity import EntityCategory
|
from homeassistant.helpers.entity import EntityCategory
|
||||||
|
|
|
@ -4,24 +4,12 @@ from collections.abc import Awaitable, Callable
|
||||||
import dataclasses
|
import dataclasses
|
||||||
from unittest.mock import Mock, patch
|
from unittest.mock import Mock, patch
|
||||||
|
|
||||||
from aioesphomeapi import (
|
from aioesphomeapi import APIClient, EntityInfo, EntityState, UserService
|
||||||
APIClient,
|
|
||||||
EntityInfo,
|
|
||||||
EntityState,
|
|
||||||
UserService,
|
|
||||||
)
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.esphome.dashboard import (
|
from homeassistant.components.esphome.dashboard import async_get_dashboard
|
||||||
async_get_dashboard,
|
|
||||||
)
|
|
||||||
from homeassistant.components.update import UpdateEntityFeature
|
from homeassistant.components.update import UpdateEntityFeature
|
||||||
from homeassistant.const import (
|
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE, STATE_UNKNOWN
|
||||||
STATE_OFF,
|
|
||||||
STATE_ON,
|
|
||||||
STATE_UNAVAILABLE,
|
|
||||||
STATE_UNKNOWN,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
|
|
|
@ -8,11 +8,7 @@ from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from .const import (
|
from .const import MOCK_FIRMWARE_AVAILABLE, MOCK_FIRMWARE_RELEASE_URL, MOCK_USER_DATA
|
||||||
MOCK_FIRMWARE_AVAILABLE,
|
|
||||||
MOCK_FIRMWARE_RELEASE_URL,
|
|
||||||
MOCK_USER_DATA,
|
|
||||||
)
|
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.typing import ClientSessionGenerator
|
from tests.typing import ClientSessionGenerator
|
||||||
|
|
|
@ -7,9 +7,7 @@ from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo
|
from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo
|
||||||
|
|
||||||
from tests.common import MockConfigEntry
|
from tests.common import MockConfigEntry
|
||||||
from tests.components.bluetooth import (
|
from tests.components.bluetooth import inject_bluetooth_service_info
|
||||||
inject_bluetooth_service_info,
|
|
||||||
)
|
|
||||||
|
|
||||||
WATER_TIMER_SERVICE_INFO = BluetoothServiceInfo(
|
WATER_TIMER_SERVICE_INFO = BluetoothServiceInfo(
|
||||||
name="Timer",
|
name="Timer",
|
||||||
|
|
|
@ -9,10 +9,7 @@ import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
|
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_ENTITY_ID, Platform
|
||||||
ATTR_ENTITY_ID,
|
|
||||||
Platform,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from . import setup_entry
|
from . import setup_entry
|
||||||
|
|
|
@ -17,9 +17,7 @@ from . import (
|
||||||
WATER_TIMER_UNNAMED_SERVICE_INFO,
|
WATER_TIMER_UNNAMED_SERVICE_INFO,
|
||||||
)
|
)
|
||||||
|
|
||||||
from tests.components.bluetooth import (
|
from tests.components.bluetooth import inject_bluetooth_service_info
|
||||||
inject_bluetooth_service_info,
|
|
||||||
)
|
|
||||||
|
|
||||||
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,7 @@ from homeassistant.components.number import (
|
||||||
DOMAIN as NUMBER_DOMAIN,
|
DOMAIN as NUMBER_DOMAIN,
|
||||||
SERVICE_SET_VALUE,
|
SERVICE_SET_VALUE,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_ENTITY_ID, Platform
|
||||||
ATTR_ENTITY_ID,
|
|
||||||
Platform,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from . import setup_entry
|
from . import setup_entry
|
||||||
|
|
|
@ -14,10 +14,7 @@ from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from .common import setup_test_component
|
from .common import setup_test_component
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import async_get_device_automations, async_mock_service
|
||||||
async_get_device_automations,
|
|
||||||
async_mock_service,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
||||||
|
|
|
@ -11,10 +11,7 @@ from homeassistant.helpers import entity_registry as er
|
||||||
|
|
||||||
from .conftest import setup_platform
|
from .conftest import setup_platform
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import async_capture_events, async_get_device_automations
|
||||||
async_capture_events,
|
|
||||||
async_get_device_automations,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
async def test_hue_event(
|
async def test_hue_event(
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
"""Philips Hue Event platform tests for V2 bridge/api."""
|
"""Philips Hue Event platform tests for V2 bridge/api."""
|
||||||
from homeassistant.components.event import (
|
from homeassistant.components.event import ATTR_EVENT_TYPE, ATTR_EVENT_TYPES
|
||||||
ATTR_EVENT_TYPE,
|
|
||||||
ATTR_EVENT_TYPES,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .conftest import setup_platform
|
from .conftest import setup_platform
|
||||||
|
|
|
@ -8,12 +8,7 @@ import pytest
|
||||||
|
|
||||||
import homeassistant.components.influxdb as influxdb
|
import homeassistant.components.influxdb as influxdb
|
||||||
from homeassistant.components.influxdb.const import DEFAULT_BUCKET
|
from homeassistant.components.influxdb.const import DEFAULT_BUCKET
|
||||||
from homeassistant.const import (
|
from homeassistant.const import PERCENTAGE, STATE_OFF, STATE_ON, STATE_STANDBY
|
||||||
PERCENTAGE,
|
|
||||||
STATE_OFF,
|
|
||||||
STATE_ON,
|
|
||||||
STATE_STANDBY,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant, split_entity_id
|
from homeassistant.core import HomeAssistant, split_entity_id
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,7 @@ from unittest.mock import patch
|
||||||
import pytest
|
import pytest
|
||||||
from syrupy.assertion import SnapshotAssertion
|
from syrupy.assertion import SnapshotAssertion
|
||||||
|
|
||||||
from homeassistant.components.lastfm.const import (
|
from homeassistant.components.lastfm.const import CONF_USERS, DOMAIN
|
||||||
CONF_USERS,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import ConfigEntryState
|
from homeassistant.config_entries import ConfigEntryState
|
||||||
from homeassistant.const import CONF_API_KEY, CONF_PLATFORM, Platform
|
from homeassistant.const import CONF_API_KEY, CONF_PLATFORM, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
|
@ -14,10 +14,7 @@ from homeassistant.components.light import (
|
||||||
)
|
)
|
||||||
from homeassistant.const import EntityCategory
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||||
device_registry as dr,
|
|
||||||
entity_registry as er,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.entity_registry import RegistryEntryHider
|
from homeassistant.helpers.entity_registry import RegistryEntryHider
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,7 @@ from homeassistant.components.lock import (
|
||||||
from homeassistant.const import ATTR_CODE, STATE_UNKNOWN
|
from homeassistant.const import ATTR_CODE, STATE_UNKNOWN
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .common import (
|
from .common import set_node_attribute, trigger_subscription_callback
|
||||||
set_node_attribute,
|
|
||||||
trigger_subscription_callback,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
# This tests needs to be adjusted to remove lingering tasks
|
# This tests needs to be adjusted to remove lingering tasks
|
||||||
|
|
|
@ -5,16 +5,10 @@ from matter_server.client.models.node import MatterNode
|
||||||
from matter_server.common.models import EventType, MatterNodeEvent
|
from matter_server.common.models import EventType, MatterNodeEvent
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.event import (
|
from homeassistant.components.event import ATTR_EVENT_TYPE, ATTR_EVENT_TYPES
|
||||||
ATTR_EVENT_TYPE,
|
|
||||||
ATTR_EVENT_TYPES,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
||||||
from .common import (
|
from .common import setup_integration_with_node_fixture, trigger_subscription_callback
|
||||||
setup_integration_with_node_fixture,
|
|
||||||
trigger_subscription_callback,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(name="generic_switch_node")
|
@pytest.fixture(name="generic_switch_node")
|
||||||
|
|
|
@ -26,10 +26,7 @@ from homeassistant.const import (
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.generated.mqtt import MQTT
|
from homeassistant.generated.mqtt import MQTT
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import device_registry as dr, entity_registry as er
|
||||||
device_registry as dr,
|
|
||||||
entity_registry as er,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||||
|
|
||||||
|
|
|
@ -8,10 +8,7 @@ import pytest
|
||||||
|
|
||||||
from homeassistant.components import event, mqtt
|
from homeassistant.components import event, mqtt
|
||||||
from homeassistant.components.mqtt.event import MQTT_EVENT_ATTRIBUTES_BLOCKED
|
from homeassistant.components.mqtt.event import MQTT_EVENT_ATTRIBUTES_BLOCKED
|
||||||
from homeassistant.const import (
|
from homeassistant.const import STATE_UNKNOWN, Platform
|
||||||
STATE_UNKNOWN,
|
|
||||||
Platform,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
|
|
||||||
|
@ -51,9 +48,7 @@ from .test_common import (
|
||||||
help_test_update_with_json_attrs_not_dict,
|
help_test_update_with_json_attrs_not_dict,
|
||||||
)
|
)
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import async_fire_mqtt_message
|
||||||
async_fire_mqtt_message,
|
|
||||||
)
|
|
||||||
from tests.typing import MqttMockHAClientGenerator, MqttMockPahoClient
|
from tests.typing import MqttMockHAClientGenerator, MqttMockPahoClient
|
||||||
|
|
||||||
DEFAULT_CONFIG = {
|
DEFAULT_CONFIG = {
|
||||||
|
|
|
@ -12,10 +12,7 @@ from homeassistant.const import (
|
||||||
Platform,
|
Platform,
|
||||||
)
|
)
|
||||||
from homeassistant.core import CoreState, HomeAssistant, callback
|
from homeassistant.core import CoreState, HomeAssistant, callback
|
||||||
from homeassistant.helpers import (
|
from homeassistant.helpers import device_registry as dr, issue_registry as ir
|
||||||
device_registry as dr,
|
|
||||||
issue_registry as ir,
|
|
||||||
)
|
|
||||||
|
|
||||||
from tests.common import MockConfigEntry, async_capture_events, async_fire_mqtt_message
|
from tests.common import MockConfigEntry, async_capture_events, async_fire_mqtt_message
|
||||||
from tests.typing import MqttMockHAClientGenerator, MqttMockPahoClient
|
from tests.typing import MqttMockHAClientGenerator, MqttMockPahoClient
|
||||||
|
|
|
@ -17,10 +17,7 @@ from homeassistant.util.dt import utcnow
|
||||||
|
|
||||||
from .common import DEVICE_ID, CreateDevice, FakeSubscriber, PlatformSetup
|
from .common import DEVICE_ID, CreateDevice, FakeSubscriber, PlatformSetup
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import async_get_device_automations, async_mock_service
|
||||||
async_get_device_automations,
|
|
||||||
async_mock_service,
|
|
||||||
)
|
|
||||||
|
|
||||||
DEVICE_NAME = "My Camera"
|
DEVICE_NAME = "My Camera"
|
||||||
DATA_MESSAGE = {"message": "service-called"}
|
DATA_MESSAGE = {"message": "service-called"}
|
||||||
|
|
|
@ -3,11 +3,7 @@ from typing import Any
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.opensky.const import (
|
from homeassistant.components.opensky.const import CONF_ALTITUDE, DEFAULT_NAME, DOMAIN
|
||||||
CONF_ALTITUDE,
|
|
||||||
DEFAULT_NAME,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
|
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
|
||||||
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, CONF_RADIUS
|
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME, CONF_RADIUS
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
|
|
@ -9,10 +9,7 @@ from homeassistant.components.bluetooth import (
|
||||||
async_address_present,
|
async_address_present,
|
||||||
)
|
)
|
||||||
from homeassistant.components.oralb.const import DOMAIN
|
from homeassistant.components.oralb.const import DOMAIN
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_ASSUMED_STATE, ATTR_FRIENDLY_NAME
|
||||||
ATTR_ASSUMED_STATE,
|
|
||||||
ATTR_FRIENDLY_NAME,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
|
|
|
@ -3,10 +3,7 @@ from unittest.mock import patch
|
||||||
|
|
||||||
from aiohttp.client_exceptions import ClientError
|
from aiohttp.client_exceptions import ClientError
|
||||||
|
|
||||||
from homeassistant.components.pegel_online.const import (
|
from homeassistant.components.pegel_online.const import CONF_STATION, DOMAIN
|
||||||
CONF_STATION,
|
|
||||||
DOMAIN,
|
|
||||||
)
|
|
||||||
from homeassistant.config_entries import SOURCE_USER
|
from homeassistant.config_entries import SOURCE_USER
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_LATITUDE,
|
CONF_LATITUDE,
|
||||||
|
|
|
@ -8,10 +8,7 @@ from homeassistant.components.philips_js.const import DOMAIN
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
from tests.common import (
|
from tests.common import async_get_device_automations, async_mock_service
|
||||||
async_get_device_automations,
|
|
||||||
async_mock_service,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
@pytest.fixture(autouse=True, name="stub_blueprint_populate")
|
||||||
|
|
|
@ -7,11 +7,7 @@ from homeassistant.components.bluetooth import (
|
||||||
FALLBACK_MAXIMUM_STALE_ADVERTISEMENT_SECONDS,
|
FALLBACK_MAXIMUM_STALE_ADVERTISEMENT_SECONDS,
|
||||||
)
|
)
|
||||||
from homeassistant.components.qingping.const import DOMAIN
|
from homeassistant.components.qingping.const import DOMAIN
|
||||||
from homeassistant.const import (
|
from homeassistant.const import ATTR_FRIENDLY_NAME, STATE_OFF, STATE_UNAVAILABLE
|
||||||
ATTR_FRIENDLY_NAME,
|
|
||||||
STATE_OFF,
|
|
||||||
STATE_UNAVAILABLE,
|
|
||||||
)
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue