Merge pull request #92 from LEJOUI/master

Update SwitchDevice to SwitchEntity
This commit is contained in:
Clayton Nummer 2020-06-03 21:06:11 -04:00 committed by GitHub
commit ca8f25ad2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

View file

@ -48,7 +48,7 @@ from homeassistant.util.dt import now as dt_now, get_time_zone
from datetime import datetime, timedelta
VERSION = '1.0.12b'
VERSION = '1.0.13b'
_LOGGER = logging.getLogger(__name__)

View file

@ -17,7 +17,12 @@ 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
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)
@ -105,7 +110,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
return False
class CircadianSwitch(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,

View file

@ -1,7 +1,7 @@
{
"circadian_lighting": {
"updated_at": "2020-03-19",
"version": "1.0.12b",
"updated_at": "2020-06-03",
"version": "1.0.13b",
"local_location": "/custom_components/circadian_lighting/__init__.py",
"remote_location": "https://raw.githubusercontent.com/claytonjn/hass-circadian_lighting/master/custom_components/circadian_lighting/__init__.py",
"visit_repo": "https://github.com/claytonjn/hass-circadian_lighting",