From abe47adc8678cacebb470bada623a290c936c2fb Mon Sep 17 00:00:00 2001 From: Clayton Nummer Date: Sat, 7 Mar 2020 10:16:13 -0500 Subject: [PATCH 1/6] Version bump for (deprecated) custom updater --- custom_components/circadian_lighting/__init__.py | 2 +- custom_updater.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/circadian_lighting/__init__.py b/custom_components/circadian_lighting/__init__.py index 360819cd..62667398 100644 --- a/custom_components/circadian_lighting/__init__.py +++ b/custom_components/circadian_lighting/__init__.py @@ -48,7 +48,7 @@ from homeassistant.util.dt import utcnow as dt_utcnow, as_local from datetime import datetime, timedelta -VERSION = '1.0.11b' +VERSION = '1.0.11' _LOGGER = logging.getLogger(__name__) diff --git a/custom_updater.json b/custom_updater.json index 16b4a1cf..867cd59d 100644 --- a/custom_updater.json +++ b/custom_updater.json @@ -1,7 +1,7 @@ { "circadian_lighting": { - "updated_at": "2020-02-21", - "version": "1.0.11b", + "updated_at": "2020-03-07", + "version": "1.0.11", "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", From eaa5c0e3dd909941bb7f82104c93f7eaf678b184 Mon Sep 17 00:00:00 2001 From: LJU Date: Thu, 14 May 2020 08:26:29 +0200 Subject: [PATCH 2/6] Update SwitchDevice to SwitchEntity --- custom_components/circadian_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index f8da28da..2ac2fc9c 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -17,7 +17,7 @@ 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 from homeassistant.const import ( ATTR_ENTITY_ID, CONF_NAME, CONF_PLATFORM, STATE_ON, SERVICE_TURN_ON) From d7c27cd107d745fef74897fbc1f99745372338e4 Mon Sep 17 00:00:00 2001 From: LJU Date: Thu, 14 May 2020 08:28:41 +0200 Subject: [PATCH 3/6] Update SwitchDevice to SwitchEntity --- custom_components/circadian_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 2ac2fc9c..e85f5041 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -105,7 +105,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, From 5f3700343b6953847de12bdde6c54ea777400c9d Mon Sep 17 00:00:00 2001 From: LJU Date: Thu, 21 May 2020 15:33:49 +0200 Subject: [PATCH 4/6] Update import Update import and add switchdevice for earlier versions --- custom_components/circadian_lighting/switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index e85f5041..332c91e1 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -17,6 +17,7 @@ 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 from homeassistant.const import ( ATTR_ENTITY_ID, CONF_NAME, CONF_PLATFORM, STATE_ON, @@ -105,7 +106,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): return False -class CircadianSwitch(SwitchEntity, RestoreEntity): +class CircadianSwitch(SwitchEntity, SwitchDevice, RestoreEntity): """Representation of a Circadian Lighting switch.""" def __init__(self, hass, cl, name, lights_ct, lights_rgb, lights_xy, lights_brightness, From 836e2922a6c66db0b290a9a76f10a6be28913b9f Mon Sep 17 00:00:00 2001 From: LJU Date: Fri, 22 May 2020 23:36:16 +0200 Subject: [PATCH 5/6] Update with try --- custom_components/circadian_lighting/switch.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 332c91e1..3e00037e 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -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, From a2a1c4574454497e2f7852e87ad299fa43e70b31 Mon Sep 17 00:00:00 2001 From: LJU Date: Fri, 22 May 2020 23:36:45 +0200 Subject: [PATCH 6/6] Update switch.py --- custom_components/circadian_lighting/switch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/circadian_lighting/switch.py b/custom_components/circadian_lighting/switch.py index 3e00037e..3b58c1c5 100644 --- a/custom_components/circadian_lighting/switch.py +++ b/custom_components/circadian_lighting/switch.py @@ -16,7 +16,7 @@ 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 + VALID_TRANSITION, ATTR_WHITE_VALUE, ATTR_XY_COLOR, DOMAIN as LIGHT_DOMAIN) try: from homeassistant.components.switch import SwitchEntity