diff --git a/custom_components/circadian_lighting/__init__.py b/custom_components/circadian_lighting/__init__.py index c6fcecfc..219c7333 100644 --- a/custom_components/circadian_lighting/__init__.py +++ b/custom_components/circadian_lighting/__init__.py @@ -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__) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index f8da28da..3b58c1c5 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -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, diff --git a/custom_updater.json b/custom_updater.json index 91225bd0..a3c454e0 100644 --- a/custom_updater.json +++ b/custom_updater.json @@ -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",