From f1dee4bcb97a93ead2c15b66c491ca88a3738ba9 Mon Sep 17 00:00:00 2001 From: Malte Date: Mon, 13 Mar 2017 21:37:16 +0100 Subject: [PATCH 1/3] Fix #6534 Makes sure 0 is not passes to `color_temperature_kelvin_to_mired`. --- homeassistant/components/light/osramlightify.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/osramlightify.py b/homeassistant/components/light/osramlightify.py index b460ff52a9b0f..e7bb0c6e9ff01 100644 --- a/homeassistant/components/light/osramlightify.py +++ b/homeassistant/components/light/osramlightify.py @@ -215,5 +215,6 @@ def update(self): self._name = self._light.name() self._rgb = self._light.rgb() o_temp = self._light.temp() - self._temperature = color_temperature_kelvin_to_mired(o_temp) + if o_temp is not 0: + self._temperature = color_temperature_kelvin_to_mired(o_temp) self._state = self._light.on() From 5f63247801e91a150337f0c8e30f8a32309dbb98 Mon Sep 17 00:00:00 2001 From: deisi Date: Tue, 14 Mar 2017 20:35:08 +0100 Subject: [PATCH 2/3] Update osramlightify.py --- homeassistant/components/light/osramlightify.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/light/osramlightify.py b/homeassistant/components/light/osramlightify.py index e7bb0c6e9ff01..1c2f3285d7777 100644 --- a/homeassistant/components/light/osramlightify.py +++ b/homeassistant/components/light/osramlightify.py @@ -215,6 +215,6 @@ def update(self): self._name = self._light.name() self._rgb = self._light.rgb() o_temp = self._light.temp() - if o_temp is not 0: + if o_temp != 0: self._temperature = color_temperature_kelvin_to_mired(o_temp) self._state = self._light.on() From 06ae7d9be78e45820a6d99cf9d95929918199cb8 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 14 Mar 2017 21:08:20 -0700 Subject: [PATCH 3/3] Update osramlightify.py --- homeassistant/components/light/osramlightify.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/light/osramlightify.py b/homeassistant/components/light/osramlightify.py index 1c2f3285d7777..1ddfe1baa5388 100644 --- a/homeassistant/components/light/osramlightify.py +++ b/homeassistant/components/light/osramlightify.py @@ -215,6 +215,8 @@ def update(self): self._name = self._light.name() self._rgb = self._light.rgb() o_temp = self._light.temp() - if o_temp != 0: + if o_temp == 0: + self._temperature = None + else: self._temperature = color_temperature_kelvin_to_mired(o_temp) self._state = self._light.on()