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