Use platform constants from root (#78032)

pull/78052/head
epenet 2022-09-08 12:24:45 +02:00 committed by GitHub
parent f14bb8195f
commit ff356205bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 46 additions and 72 deletions

View File

@ -1,5 +1,5 @@
"""Describe logbook events."""
from homeassistant.components.logbook.const import (
from homeassistant.components.logbook import (
LOGBOOK_ENTRY_ENTITY_ID,
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,

View File

@ -12,8 +12,11 @@ from amcrest import AmcrestError
from haffmpeg.camera import CameraMjpeg
import voluptuous as vol
from homeassistant.components.camera import Camera, CameraEntityFeature
from homeassistant.components.camera.const import DOMAIN as CAMERA_DOMAIN
from homeassistant.components.camera import (
DOMAIN as CAMERA_DOMAIN,
Camera,
CameraEntityFeature,
)
from homeassistant.components.ffmpeg import FFmpegManager, get_ffmpeg_manager
from homeassistant.const import ATTR_ENTITY_ID, CONF_NAME, STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant

View File

@ -9,7 +9,7 @@ from canary.api import Api
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
from homeassistant.components.camera.const import DOMAIN as CAMERA_DOMAIN
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME, Platform
from homeassistant.core import HomeAssistant

View File

@ -3,10 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.const import ATTR_DEVICE_ID, CONF_EVENT
from homeassistant.core import Event, HomeAssistant, callback
import homeassistant.helpers.device_registry as dr

View File

@ -3,8 +3,11 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.humidifier import HumidifierDeviceClass, HumidifierEntity
from homeassistant.components.humidifier.const import HumidifierEntityFeature
from homeassistant.components.humidifier import (
HumidifierDeviceClass,
HumidifierEntity,
HumidifierEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback

View File

@ -3,7 +3,7 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.logbook.const import (
from homeassistant.components.logbook import (
LOGBOOK_ENTRY_ENTITY_ID,
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,

View File

@ -3,10 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.core import Event, HomeAssistant, callback
from .const import (

View File

@ -34,10 +34,7 @@ from homeassistant.components.cover import (
)
from homeassistant.components.fan import ATTR_PERCENTAGE, FanEntityFeature
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.humidifier.const import (
ATTR_HUMIDITY,
SERVICE_SET_HUMIDITY,
)
from homeassistant.components.humidifier import ATTR_HUMIDITY, SERVICE_SET_HUMIDITY
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,

View File

@ -1,8 +1,5 @@
"""Describe logbook events."""
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.core import callback
from .const import DOMAIN, EVENT_COMMAND_RECEIVED, SOURCE_CLOUD

View File

@ -2,7 +2,7 @@
from collections.abc import Callable
from typing import Any
from homeassistant.components.logbook.const import (
from homeassistant.components.logbook import (
LOGBOOK_ENTRY_ENTITY_ID,
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,

View File

@ -3,8 +3,7 @@ import logging
from pyhap.const import CATEGORY_HUMIDIFIER
from homeassistant.components.humidifier import HumidifierDeviceClass
from homeassistant.components.humidifier.const import (
from homeassistant.components.humidifier import (
ATTR_HUMIDITY,
ATTR_MAX_HUMIDITY,
ATTR_MIN_HUMIDITY,
@ -12,6 +11,7 @@ from homeassistant.components.humidifier.const import (
DEFAULT_MIN_HUMIDITY,
DOMAIN,
SERVICE_SET_HUMIDITY,
HumidifierDeviceClass,
)
from homeassistant.const import (
ATTR_DEVICE_CLASS,

View File

@ -3,10 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.const import CONF_DEVICE_ID, CONF_EVENT, CONF_ID, CONF_TYPE
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.helpers import device_registry as dr

View File

@ -3,10 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.core import Event, HomeAssistant, callback
from .const import (

View File

@ -35,7 +35,7 @@ from motioneye_client.const import (
KEY_WEB_HOOK_STORAGE_URL,
)
from homeassistant.components.camera.const import DOMAIN as CAMERA_DOMAIN
from homeassistant.components.camera import DOMAIN as CAMERA_DOMAIN
from homeassistant.components.media_source.const import URI_SCHEME
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN

View File

@ -10,16 +10,14 @@ import voluptuous as vol
from homeassistant.components import siren
from homeassistant.components.siren import (
TURN_ON_SCHEMA,
SirenEntity,
SirenEntityFeature,
process_turn_on_params,
)
from homeassistant.components.siren.const import (
ATTR_AVAILABLE_TONES,
ATTR_DURATION,
ATTR_TONE,
ATTR_VOLUME_LEVEL,
TURN_ON_SCHEMA,
SirenEntity,
SirenEntityFeature,
process_turn_on_params,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (

View File

@ -18,8 +18,7 @@ from google_nest_sdm.device import Device
from google_nest_sdm.device_manager import DeviceManager
from google_nest_sdm.exceptions import ApiException
from homeassistant.components.camera import Camera, CameraEntityFeature
from homeassistant.components.camera.const import StreamType
from homeassistant.components.camera import Camera, CameraEntityFeature, StreamType
from homeassistant.components.stream import CONF_EXTRA_PART_WAIT_TIME
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant

View File

@ -4,8 +4,11 @@ from typing import Any
from pyoverkiz.enums import OverkizState
from pyoverkiz.enums.command import OverkizCommand, OverkizCommandParam
from homeassistant.components.siren import SirenEntity, SirenEntityFeature
from homeassistant.components.siren.const import ATTR_DURATION
from homeassistant.components.siren import (
ATTR_DURATION,
SirenEntity,
SirenEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant

View File

@ -17,10 +17,7 @@ from homeassistant.components.climate import (
HVACAction,
)
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.humidifier.const import (
ATTR_AVAILABLE_MODES,
ATTR_HUMIDITY,
)
from homeassistant.components.humidifier import ATTR_AVAILABLE_MODES, ATTR_HUMIDITY
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
ATTR_DEVICE_CLASS,

View File

@ -11,8 +11,7 @@ import async_timeout
import voluptuous as vol
from homeassistant.components import webhook
from homeassistant.components.camera import PLATFORM_SCHEMA, STATE_IDLE, Camera
from homeassistant.components.camera.const import DOMAIN
from homeassistant.components.camera import DOMAIN, PLATFORM_SCHEMA, STATE_IDLE, Camera
from homeassistant.const import CONF_NAME, CONF_TIMEOUT, CONF_WEBHOOK_ID
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv

View File

@ -6,8 +6,7 @@ from typing import Any
import RFXtrx as rfxtrxmod
from homeassistant.components.siren import SirenEntity, SirenEntityFeature
from homeassistant.components.siren.const import ATTR_TONE
from homeassistant.components.siren import ATTR_TONE, SirenEntity, SirenEntityFeature
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.helpers.entity import Entity

View File

@ -3,10 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.typing import EventType

View File

@ -4,10 +4,7 @@ from __future__ import annotations
from collections.abc import Callable
from typing import TYPE_CHECKING
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.const import ATTR_COMMAND, ATTR_DEVICE_ID
from homeassistant.core import Event, HomeAssistant, callback
import homeassistant.helpers.device_registry as dr

View File

@ -9,10 +9,11 @@ from zigpy.zcl.clusters.security import IasWd as WD
from homeassistant.components.siren import (
ATTR_DURATION,
ATTR_TONE,
ATTR_VOLUME_LEVEL,
SirenEntity,
SirenEntityFeature,
)
from homeassistant.components.siren.const import ATTR_TONE, ATTR_VOLUME_LEVEL
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant, callback

View File

@ -15,14 +15,12 @@ from zwave_js_server.model.driver import Driver
from zwave_js_server.model.value import Value as ZwaveValue
from homeassistant.components.humidifier import (
HumidifierDeviceClass,
HumidifierEntity,
HumidifierEntityDescription,
)
from homeassistant.components.humidifier.const import (
DEFAULT_MAX_HUMIDITY,
DEFAULT_MIN_HUMIDITY,
DOMAIN as HUMIDIFIER_DOMAIN,
HumidifierDeviceClass,
HumidifierEntity,
HumidifierEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback

View File

@ -5,10 +5,7 @@ from collections.abc import Callable
from zwave_js_server.const import CommandClass
from homeassistant.components.logbook.const import (
LOGBOOK_ENTRY_MESSAGE,
LOGBOOK_ENTRY_NAME,
)
from homeassistant.components.logbook import LOGBOOK_ENTRY_MESSAGE, LOGBOOK_ENTRY_NAME
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import Event, HomeAssistant, callback
import homeassistant.helpers.device_registry as dr

View File

@ -8,11 +8,12 @@ from zwave_js_server.const.command_class.sound_switch import ToneID
from zwave_js_server.model.driver import Driver
from homeassistant.components.siren import (
ATTR_TONE,
ATTR_VOLUME_LEVEL,
DOMAIN as SIREN_DOMAIN,
SirenEntity,
SirenEntityFeature,
)
from homeassistant.components.siren.const import ATTR_TONE, ATTR_VOLUME_LEVEL
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect