mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Adding support for RTDSContactSensor and RTDSMotionSensor in Tahoma … (RTS Alarms sensors and contacts for Somfy Protexiom alarms) (#16609)
* Adding support for RTDSContactSensor and RTDSContactSensor in Tahoma component * Removing extra blank lines
This commit is contained in:
parent
0d0bda9658
commit
9c1a539f90
@ -56,6 +56,10 @@ class TahomaSensor(TahomaDevice, Entity):
|
|||||||
return 'lx'
|
return 'lx'
|
||||||
if self.tahoma_device.type == 'Humidity Sensor':
|
if self.tahoma_device.type == 'Humidity Sensor':
|
||||||
return '%'
|
return '%'
|
||||||
|
if self.tahoma_device.type == 'rtds:RTDSContactSensor':
|
||||||
|
return None
|
||||||
|
if self.tahoma_device.type == 'rtds:RTDSMotionSensor':
|
||||||
|
return None
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Update the state."""
|
"""Update the state."""
|
||||||
@ -63,12 +67,21 @@ class TahomaSensor(TahomaDevice, Entity):
|
|||||||
if self.tahoma_device.type == 'io:LightIOSystemSensor':
|
if self.tahoma_device.type == 'io:LightIOSystemSensor':
|
||||||
self.current_value = self.tahoma_device.active_states[
|
self.current_value = self.tahoma_device.active_states[
|
||||||
'core:LuminanceState']
|
'core:LuminanceState']
|
||||||
|
self._available = bool(self.tahoma_device.active_states.get(
|
||||||
|
'core:StatusState') == 'available')
|
||||||
if self.tahoma_device.type == 'io:SomfyContactIOSystemSensor':
|
if self.tahoma_device.type == 'io:SomfyContactIOSystemSensor':
|
||||||
self.current_value = self.tahoma_device.active_states[
|
self.current_value = self.tahoma_device.active_states[
|
||||||
'core:ContactState']
|
'core:ContactState']
|
||||||
|
self._available = bool(self.tahoma_device.active_states.get(
|
||||||
self._available = bool(self.tahoma_device.active_states.get(
|
'core:StatusState') == 'available')
|
||||||
'core:StatusState') == 'available')
|
if self.tahoma_device.type == 'rtds:RTDSContactSensor':
|
||||||
|
self.current_value = self.tahoma_device.active_states[
|
||||||
|
'core:ContactState']
|
||||||
|
self._available = True
|
||||||
|
if self.tahoma_device.type == 'rtds:RTDSMotionSensor':
|
||||||
|
self.current_value = self.tahoma_device.active_states[
|
||||||
|
'core:OccupancyState']
|
||||||
|
self._available = True
|
||||||
|
|
||||||
_LOGGER.debug("Update %s, value: %d", self._name, self.current_value)
|
_LOGGER.debug("Update %s, value: %d", self._name, self.current_value)
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ TAHOMA_TYPES = {
|
|||||||
'io:HorizontalAwningIOComponent': 'cover',
|
'io:HorizontalAwningIOComponent': 'cover',
|
||||||
'io:OnOffLightIOComponent': 'switch',
|
'io:OnOffLightIOComponent': 'switch',
|
||||||
'rtds:RTDSSmokeSensor': 'smoke',
|
'rtds:RTDSSmokeSensor': 'smoke',
|
||||||
|
'rtds:RTDSContactSensor': 'sensor',
|
||||||
|
'rtds:RTDSMotionSensor': 'sensor'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user