mirror of
https://github.com/home-assistant/core
synced 2024-09-09 12:51:22 +02:00
Use const imports [g-i] (#63468)
This commit is contained in:
parent
1b32385ab2
commit
246338f93d
@ -12,14 +12,6 @@ from homeassistant.components.cover import (
|
|||||||
ATTR_TILT_POSITION,
|
ATTR_TILT_POSITION,
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SERVICE_CLOSE_COVER,
|
|
||||||
SERVICE_CLOSE_COVER_TILT,
|
|
||||||
SERVICE_OPEN_COVER,
|
|
||||||
SERVICE_OPEN_COVER_TILT,
|
|
||||||
SERVICE_SET_COVER_POSITION,
|
|
||||||
SERVICE_SET_COVER_TILT_POSITION,
|
|
||||||
SERVICE_STOP_COVER,
|
|
||||||
SERVICE_STOP_COVER_TILT,
|
|
||||||
SUPPORT_CLOSE,
|
SUPPORT_CLOSE,
|
||||||
SUPPORT_CLOSE_TILT,
|
SUPPORT_CLOSE_TILT,
|
||||||
SUPPORT_OPEN,
|
SUPPORT_OPEN,
|
||||||
@ -37,6 +29,14 @@ from homeassistant.const import (
|
|||||||
CONF_ENTITIES,
|
CONF_ENTITIES,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
CONF_UNIQUE_ID,
|
CONF_UNIQUE_ID,
|
||||||
|
SERVICE_CLOSE_COVER,
|
||||||
|
SERVICE_CLOSE_COVER_TILT,
|
||||||
|
SERVICE_OPEN_COVER,
|
||||||
|
SERVICE_OPEN_COVER_TILT,
|
||||||
|
SERVICE_SET_COVER_POSITION,
|
||||||
|
SERVICE_SET_COVER_TILT_POSITION,
|
||||||
|
SERVICE_STOP_COVER,
|
||||||
|
SERVICE_STOP_COVER_TILT,
|
||||||
STATE_CLOSED,
|
STATE_CLOSED,
|
||||||
STATE_CLOSING,
|
STATE_CLOSING,
|
||||||
STATE_OPEN,
|
STATE_OPEN,
|
||||||
|
@ -34,6 +34,7 @@ from homeassistant.components.light import (
|
|||||||
SUPPORT_FLASH,
|
SUPPORT_FLASH,
|
||||||
SUPPORT_TRANSITION,
|
SUPPORT_TRANSITION,
|
||||||
SUPPORT_WHITE_VALUE,
|
SUPPORT_WHITE_VALUE,
|
||||||
|
LightEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
@ -41,6 +42,8 @@ from homeassistant.const import (
|
|||||||
CONF_ENTITIES,
|
CONF_ENTITIES,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
CONF_UNIQUE_ID,
|
CONF_UNIQUE_ID,
|
||||||
|
SERVICE_TURN_OFF,
|
||||||
|
SERVICE_TURN_ON,
|
||||||
STATE_ON,
|
STATE_ON,
|
||||||
STATE_UNAVAILABLE,
|
STATE_UNAVAILABLE,
|
||||||
)
|
)
|
||||||
@ -104,7 +107,7 @@ FORWARDED_ATTRIBUTES = frozenset(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class LightGroup(GroupEntity, light.LightEntity):
|
class LightGroup(GroupEntity, LightEntity):
|
||||||
"""Representation of a light group."""
|
"""Representation of a light group."""
|
||||||
|
|
||||||
_attr_available = False
|
_attr_available = False
|
||||||
@ -159,7 +162,7 @@ class LightGroup(GroupEntity, light.LightEntity):
|
|||||||
|
|
||||||
await self.hass.services.async_call(
|
await self.hass.services.async_call(
|
||||||
light.DOMAIN,
|
light.DOMAIN,
|
||||||
light.SERVICE_TURN_ON,
|
SERVICE_TURN_ON,
|
||||||
data,
|
data,
|
||||||
blocking=True,
|
blocking=True,
|
||||||
context=self._context,
|
context=self._context,
|
||||||
@ -174,7 +177,7 @@ class LightGroup(GroupEntity, light.LightEntity):
|
|||||||
|
|
||||||
await self.hass.services.async_call(
|
await self.hass.services.async_call(
|
||||||
light.DOMAIN,
|
light.DOMAIN,
|
||||||
light.SERVICE_TURN_OFF,
|
SERVICE_TURN_OFF,
|
||||||
data,
|
data,
|
||||||
blocking=True,
|
blocking=True,
|
||||||
context=self._context,
|
context=self._context,
|
||||||
|
@ -16,18 +16,7 @@ from homeassistant.components.media_player import (
|
|||||||
DOMAIN,
|
DOMAIN,
|
||||||
PLATFORM_SCHEMA,
|
PLATFORM_SCHEMA,
|
||||||
SERVICE_CLEAR_PLAYLIST,
|
SERVICE_CLEAR_PLAYLIST,
|
||||||
SERVICE_MEDIA_NEXT_TRACK,
|
|
||||||
SERVICE_MEDIA_PAUSE,
|
|
||||||
SERVICE_MEDIA_PLAY,
|
|
||||||
SERVICE_MEDIA_PREVIOUS_TRACK,
|
|
||||||
SERVICE_MEDIA_SEEK,
|
|
||||||
SERVICE_MEDIA_STOP,
|
|
||||||
SERVICE_PLAY_MEDIA,
|
SERVICE_PLAY_MEDIA,
|
||||||
SERVICE_SHUFFLE_SET,
|
|
||||||
SERVICE_TURN_OFF,
|
|
||||||
SERVICE_TURN_ON,
|
|
||||||
SERVICE_VOLUME_MUTE,
|
|
||||||
SERVICE_VOLUME_SET,
|
|
||||||
SUPPORT_CLEAR_PLAYLIST,
|
SUPPORT_CLEAR_PLAYLIST,
|
||||||
SUPPORT_NEXT_TRACK,
|
SUPPORT_NEXT_TRACK,
|
||||||
SUPPORT_PAUSE,
|
SUPPORT_PAUSE,
|
||||||
@ -50,6 +39,17 @@ from homeassistant.const import (
|
|||||||
CONF_ENTITIES,
|
CONF_ENTITIES,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
CONF_UNIQUE_ID,
|
CONF_UNIQUE_ID,
|
||||||
|
SERVICE_MEDIA_NEXT_TRACK,
|
||||||
|
SERVICE_MEDIA_PAUSE,
|
||||||
|
SERVICE_MEDIA_PLAY,
|
||||||
|
SERVICE_MEDIA_PREVIOUS_TRACK,
|
||||||
|
SERVICE_MEDIA_SEEK,
|
||||||
|
SERVICE_MEDIA_STOP,
|
||||||
|
SERVICE_SHUFFLE_SET,
|
||||||
|
SERVICE_TURN_OFF,
|
||||||
|
SERVICE_TURN_ON,
|
||||||
|
SERVICE_VOLUME_MUTE,
|
||||||
|
SERVICE_VOLUME_SET,
|
||||||
STATE_OFF,
|
STATE_OFF,
|
||||||
STATE_ON,
|
STATE_ON,
|
||||||
STATE_UNAVAILABLE,
|
STATE_UNAVAILABLE,
|
||||||
|
@ -5,13 +5,11 @@ import voluptuous as vol
|
|||||||
|
|
||||||
from homeassistant.components.water_heater import (
|
from homeassistant.components.water_heater import (
|
||||||
STATE_ECO,
|
STATE_ECO,
|
||||||
STATE_OFF,
|
|
||||||
STATE_ON,
|
|
||||||
SUPPORT_OPERATION_MODE,
|
SUPPORT_OPERATION_MODE,
|
||||||
WaterHeaterEntity,
|
WaterHeaterEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import TEMP_CELSIUS
|
from homeassistant.const import STATE_OFF, STATE_ON, TEMP_CELSIUS
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
|
@ -7,16 +7,10 @@ import logging
|
|||||||
from types import MappingProxyType
|
from types import MappingProxyType
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.const import ATTR_ENTITY_ID
|
from homeassistant.const import ATTR_ENTITY_ID, ATTR_OPTION
|
||||||
from homeassistant.core import Context, HomeAssistant, State
|
from homeassistant.core import Context, HomeAssistant, State
|
||||||
|
|
||||||
from . import (
|
from . import ATTR_OPTIONS, DOMAIN, SERVICE_SELECT_OPTION, SERVICE_SET_OPTIONS
|
||||||
ATTR_OPTION,
|
|
||||||
ATTR_OPTIONS,
|
|
||||||
DOMAIN,
|
|
||||||
SERVICE_SELECT_OPTION,
|
|
||||||
SERVICE_SET_OPTIONS,
|
|
||||||
)
|
|
||||||
|
|
||||||
ATTR_GROUP = [ATTR_OPTION, ATTR_OPTIONS]
|
ATTR_GROUP = [ATTR_OPTION, ATTR_OPTIONS]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user