1
mirror of https://github.com/home-assistant/core synced 2024-07-12 07:21:24 +02:00

Use const imports [g-i] (#63468)

This commit is contained in:
Marc Mueller 2022-01-05 17:08:00 +01:00 committed by GitHub
parent 1b32385ab2
commit 246338f93d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 33 deletions

View File

@ -12,14 +12,6 @@ from homeassistant.components.cover import (
ATTR_TILT_POSITION,
DOMAIN,
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_TILT,
SUPPORT_OPEN,
@ -37,6 +29,14 @@ from homeassistant.const import (
CONF_ENTITIES,
CONF_NAME,
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_CLOSING,
STATE_OPEN,

View File

@ -34,6 +34,7 @@ from homeassistant.components.light import (
SUPPORT_FLASH,
SUPPORT_TRANSITION,
SUPPORT_WHITE_VALUE,
LightEntity,
)
from homeassistant.const import (
ATTR_ENTITY_ID,
@ -41,6 +42,8 @@ from homeassistant.const import (
CONF_ENTITIES,
CONF_NAME,
CONF_UNIQUE_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_ON,
STATE_UNAVAILABLE,
)
@ -104,7 +107,7 @@ FORWARDED_ATTRIBUTES = frozenset(
)
class LightGroup(GroupEntity, light.LightEntity):
class LightGroup(GroupEntity, LightEntity):
"""Representation of a light group."""
_attr_available = False
@ -159,7 +162,7 @@ class LightGroup(GroupEntity, light.LightEntity):
await self.hass.services.async_call(
light.DOMAIN,
light.SERVICE_TURN_ON,
SERVICE_TURN_ON,
data,
blocking=True,
context=self._context,
@ -174,7 +177,7 @@ class LightGroup(GroupEntity, light.LightEntity):
await self.hass.services.async_call(
light.DOMAIN,
light.SERVICE_TURN_OFF,
SERVICE_TURN_OFF,
data,
blocking=True,
context=self._context,

View File

@ -16,18 +16,7 @@ from homeassistant.components.media_player import (
DOMAIN,
PLATFORM_SCHEMA,
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_SHUFFLE_SET,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
SERVICE_VOLUME_MUTE,
SERVICE_VOLUME_SET,
SUPPORT_CLEAR_PLAYLIST,
SUPPORT_NEXT_TRACK,
SUPPORT_PAUSE,
@ -50,6 +39,17 @@ from homeassistant.const import (
CONF_ENTITIES,
CONF_NAME,
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_ON,
STATE_UNAVAILABLE,

View File

@ -5,13 +5,11 @@ import voluptuous as vol
from homeassistant.components.water_heater import (
STATE_ECO,
STATE_OFF,
STATE_ON,
SUPPORT_OPERATION_MODE,
WaterHeaterEntity,
)
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.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity import DeviceInfo

View File

@ -7,16 +7,10 @@ import logging
from types import MappingProxyType
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 . import (
ATTR_OPTION,
ATTR_OPTIONS,
DOMAIN,
SERVICE_SELECT_OPTION,
SERVICE_SET_OPTIONS,
)
from . import ATTR_OPTIONS, DOMAIN, SERVICE_SELECT_OPTION, SERVICE_SET_OPTIONS
ATTR_GROUP = [ATTR_OPTION, ATTR_OPTIONS]