mirror of
https://github.com/basnijholt/adaptive-lighting.git
synced 2026-09-16 16:54:04 +02:00
Update with try
This commit is contained in:
parent
5f3700343b
commit
836e2922a6
1 changed files with 8 additions and 4 deletions
|
|
@ -16,9 +16,13 @@ from homeassistant.helpers.event import track_state_change
|
|||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.components.light import (
|
||||
is_on, ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_RGB_COLOR, ATTR_TRANSITION,
|
||||
VALID_TRANSITION, ATTR_WHITE_VALUE, ATTR_XY_COLOR, DOMAIN as LIGHT_DOMAIN)
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
from homeassistant.components.switch import SwitchEntity
|
||||
VALID_TRANSITION, ATTR_WHITE_VALUE, ATTR_XY_COLOR, DOMAIN as LIGHT_DOMAIN
|
||||
|
||||
try:
|
||||
from homeassistant.components.switch import SwitchEntity
|
||||
except ImportError:
|
||||
from homeassistant.components.switch import SwitchDevice as SwitchEntity
|
||||
|
||||
from homeassistant.const import (
|
||||
ATTR_ENTITY_ID, CONF_NAME, CONF_PLATFORM, STATE_ON,
|
||||
SERVICE_TURN_ON)
|
||||
|
|
@ -106,7 +110,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
return False
|
||||
|
||||
|
||||
class CircadianSwitch(SwitchEntity, SwitchDevice, RestoreEntity):
|
||||
class CircadianSwitch(SwitchEntity, RestoreEntity):
|
||||
"""Representation of a Circadian Lighting switch."""
|
||||
|
||||
def __init__(self, hass, cl, name, lights_ct, lights_rgb, lights_xy, lights_brightness,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue