Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for RTDSContactSensor and RTDSMotionSensor in Tahoma … (RTS Alarms sensors and contacts for Somfy Protexiom alarms) #16609

Merged
merged 2 commits into from
Sep 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions homeassistant/components/sensor/tahoma.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,32 @@ def unit_of_measurement(self):
return 'lx'
if self.tahoma_device.type == 'Humidity Sensor':
return '%'
if self.tahoma_device.type == 'rtds:RTDSContactSensor':
return None
if self.tahoma_device.type == 'rtds:RTDSMotionSensor':
return None

def update(self):
"""Update the state."""
self.controller.get_states([self.tahoma_device])
if self.tahoma_device.type == 'io:LightIOSystemSensor':
self.current_value = self.tahoma_device.active_states[
'core:LuminanceState']
self._available = bool(self.tahoma_device.active_states.get(
'core:StatusState') == 'available')
if self.tahoma_device.type == 'io:SomfyContactIOSystemSensor':
self.current_value = self.tahoma_device.active_states[
'core:ContactState']

self._available = bool(self.tahoma_device.active_states.get(
'core:StatusState') == 'available')
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
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)

Expand Down
2 changes: 2 additions & 0 deletions homeassistant/components/tahoma.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
'io:HorizontalAwningIOComponent': 'cover',
'io:OnOffLightIOComponent': 'switch',
'rtds:RTDSSmokeSensor': 'smoke',
'rtds:RTDSContactSensor': 'sensor',
'rtds:RTDSMotionSensor': 'sensor'
}


Expand Down