From bd92532ebbea07cac5ea574d68e13b7a57a3a74e Mon Sep 17 00:00:00 2001 From: Jens Date: Sun, 6 Oct 2019 01:12:50 +0200 Subject: [PATCH] Add io:SomfyBasicContactIOSystemSensor to TaHoma component (#27234) --- homeassistant/components/tahoma/__init__.py | 1 + homeassistant/components/tahoma/sensor.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/homeassistant/components/tahoma/__init__.py b/homeassistant/components/tahoma/__init__.py index 4400df6db96..6bcc783400c 100644 --- a/homeassistant/components/tahoma/__init__.py +++ b/homeassistant/components/tahoma/__init__.py @@ -42,6 +42,7 @@ TAHOMA_TYPES = { "io:RollerShutterUnoIOComponent": "cover", "io:RollerShutterVeluxIOComponent": "cover", "io:RollerShutterWithLowSpeedManagementIOComponent": "cover", + "io:SomfyBasicContactIOSystemSensor": "sensor", "io:SomfyContactIOSystemSensor": "sensor", "io:VerticalExteriorAwningIOComponent": "cover", "io:WindowOpenerVeluxIOComponent": "cover", diff --git a/homeassistant/components/tahoma/sensor.py b/homeassistant/components/tahoma/sensor.py index 0ed3879cc7a..5279b160d9c 100644 --- a/homeassistant/components/tahoma/sensor.py +++ b/homeassistant/components/tahoma/sensor.py @@ -44,6 +44,8 @@ class TahomaSensor(TahomaDevice, Entity): return None if self.tahoma_device.type == "io:SomfyContactIOSystemSensor": return None + if self.tahoma_device.type == "io:SomfyBasicContactIOSystemSensor": + return None if self.tahoma_device.type == "io:LightIOSystemSensor": return "lx" if self.tahoma_device.type == "Humidity Sensor": @@ -66,6 +68,11 @@ class TahomaSensor(TahomaDevice, Entity): self._available = bool( self.tahoma_device.active_states.get("core:StatusState") == "available" ) + if self.tahoma_device.type == "io:SomfyBasicContactIOSystemSensor": + self.current_value = self.tahoma_device.active_states["core:ContactState"] + self._available = bool( + self.tahoma_device.active_states.get("core:StatusState") == "available" + ) if self.tahoma_device.type == "rtds:RTDSContactSensor": self.current_value = self.tahoma_device.active_states["core:ContactState"] self._available = True