Add io:SomfyBasicContactIOSystemSensor to TaHoma component (#27234)

This commit is contained in:
Jens 2019-10-06 01:12:50 +02:00 committed by Martin Hjelmare
parent 5c01dd483f
commit bd92532ebb
2 changed files with 8 additions and 0 deletions

View file

@ -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",

View file

@ -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