Use core constants for yeelight (#46552)
This commit is contained in:
parent
713544e5eb
commit
add0d9d3eb
4 changed files with 2 additions and 8 deletions
|
@ -42,7 +42,6 @@ CONF_FLOW_PARAMS = "flow_params"
|
|||
CONF_CUSTOM_EFFECTS = "custom_effects"
|
||||
CONF_NIGHTLIGHT_SWITCH_TYPE = "nightlight_switch_type"
|
||||
CONF_NIGHTLIGHT_SWITCH = "nightlight_switch"
|
||||
CONF_DEVICE = "device"
|
||||
|
||||
DATA_CONFIG_ENTRIES = "config_entries"
|
||||
DATA_CUSTOM_EFFECTS = "custom_effects"
|
||||
|
@ -423,7 +422,6 @@ class YeelightDevice:
|
|||
|
||||
Uses brightness as it appears to be supported in both ceiling and other lights.
|
||||
"""
|
||||
|
||||
return self._nightlight_brightness is not None
|
||||
|
||||
@property
|
||||
|
|
|
@ -5,12 +5,11 @@ import voluptuous as vol
|
|||
import yeelight
|
||||
|
||||
from homeassistant import config_entries, exceptions
|
||||
from homeassistant.const import CONF_HOST, CONF_ID, CONF_NAME
|
||||
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME
|
||||
from homeassistant.core import callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
from . import (
|
||||
CONF_DEVICE,
|
||||
CONF_MODE_MUSIC,
|
||||
CONF_MODEL,
|
||||
CONF_NIGHTLIGHT_SWITCH,
|
||||
|
|
|
@ -261,7 +261,6 @@ async def async_setup_entry(
|
|||
hass: HomeAssistant, config_entry: ConfigEntry, async_add_entities
|
||||
) -> None:
|
||||
"""Set up Yeelight from a config entry."""
|
||||
|
||||
custom_effects = _parse_custom_effects(hass.data[DOMAIN][DATA_CUSTOM_EFFECTS])
|
||||
|
||||
device = hass.data[DOMAIN][DATA_CONFIG_ENTRIES][config_entry.entry_id][DATA_DEVICE]
|
||||
|
@ -563,7 +562,6 @@ class YeelightGenericLight(YeelightEntity, LightEntity):
|
|||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the device specific state attributes."""
|
||||
|
||||
attributes = {
|
||||
"flowing": self.device.is_color_flow_enabled,
|
||||
"music_mode": self._bulb.music_mode,
|
||||
|
|
|
@ -3,7 +3,6 @@ from unittest.mock import MagicMock, patch
|
|||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components.yeelight import (
|
||||
CONF_DEVICE,
|
||||
CONF_MODE_MUSIC,
|
||||
CONF_MODEL,
|
||||
CONF_NIGHTLIGHT_SWITCH,
|
||||
|
@ -18,7 +17,7 @@ from homeassistant.components.yeelight import (
|
|||
DOMAIN,
|
||||
NIGHTLIGHT_SWITCH_TYPE_LIGHT,
|
||||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_ID, CONF_NAME
|
||||
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_ID, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from . import (
|
||||
|
|
Loading…
Add table
Reference in a new issue