From a2e705880de5b7aad3d3cf8bac780b7ad068507b Mon Sep 17 00:00:00 2001 From: zpetr Date: Tue, 23 Jun 2020 02:18:14 +0200 Subject: [PATCH] Tahoma zwave light support (#36584) --- homeassistant/components/tahoma/__init__.py | 1 + homeassistant/components/tahoma/switch.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/homeassistant/components/tahoma/__init__.py b/homeassistant/components/tahoma/__init__.py index 1a6b326f4e5..d75ccaec414 100644 --- a/homeassistant/components/tahoma/__init__.py +++ b/homeassistant/components/tahoma/__init__.py @@ -68,6 +68,7 @@ TAHOMA_TYPES = { "rts:VenetianBlindRTSComponent": "cover", "somfythermostat:SomfyThermostatTemperatureSensor": "sensor", "somfythermostat:SomfyThermostatHumiditySensor": "sensor", + "zwave:OnOffLightZWaveComponent": "switch", } diff --git a/homeassistant/components/tahoma/switch.py b/homeassistant/components/tahoma/switch.py index 13aa70c66d3..808f80d8cfa 100644 --- a/homeassistant/components/tahoma/switch.py +++ b/homeassistant/components/tahoma/switch.py @@ -47,10 +47,18 @@ class TahomaSwitch(TahomaDevice, SwitchEntity): else: self._state = STATE_OFF + if self.tahoma_device.type == "zwave:OnOffLightZWaveComponent": + if self.tahoma_device.active_states.get("core:OnOffState") == "on": + self._state = STATE_ON + else: + self._state = STATE_OFF + # A RTS power socket doesn't have a feedback channel, # so we must assume the socket is available. if self.tahoma_device.type == "rts:OnOffRTSComponent": self._available = True + elif self.tahoma_device.type == "zwave:OnOffLightZWaveComponent": + self._available = True else: self._available = bool( self.tahoma_device.active_states.get("core:StatusState") == "available"