Added support for Somfy RTS wireless power socket and
Somfy Temperature Sensore Thermos Wirefree iopull/20245/head
parent
440d479be8
commit
5faaf9c6d2
|
@ -48,8 +48,8 @@ class TahomaSensor(TahomaDevice, Entity):
|
|||
@property
|
||||
def unit_of_measurement(self):
|
||||
"""Return the unit of measurement of this entity, if any."""
|
||||
if self.tahoma_device.type == 'Temperature Sensor':
|
||||
return None
|
||||
if self.tahoma_device.type == 'io:TemperatureIOSystemSensor':
|
||||
return '°C'
|
||||
if self.tahoma_device.type == 'io:SomfyContactIOSystemSensor':
|
||||
return None
|
||||
if self.tahoma_device.type == 'io:LightIOSystemSensor':
|
||||
|
@ -82,6 +82,11 @@ class TahomaSensor(TahomaDevice, Entity):
|
|||
self.current_value = self.tahoma_device.active_states[
|
||||
'core:OccupancyState']
|
||||
self._available = True
|
||||
if self.tahoma_device.type == 'io:TemperatureIOSystemSensor':
|
||||
""" round the temperature value, otherwise, it will show up as 13.4999999999999 """
|
||||
self.current_value = float("{:.2f}".format(self.tahoma_device.active_states[
|
||||
'core:TemperatureState']))
|
||||
self._available = True
|
||||
|
||||
_LOGGER.debug("Update %s, value: %d", self._name, self.current_value)
|
||||
|
||||
|
|
|
@ -54,9 +54,14 @@ class TahomaSwitch(TahomaDevice, SwitchDevice):
|
|||
self._state = STATE_ON
|
||||
else:
|
||||
self._state = STATE_OFF
|
||||
|
||||
self._available = bool(self.tahoma_device.active_states.get(
|
||||
'core:StatusState') == 'available')
|
||||
|
||||
""" A RTS power socket doesn't have a feedback channel, so we must assume the
|
||||
socket is available. If not, the signal is lost in the endless expanse of the universe """
|
||||
if self.tahoma_device.type == 'rts:OnOffRTSComponent':
|
||||
self._available = True
|
||||
else:
|
||||
self._available = bool(self.tahoma_device.active_states.get(
|
||||
'core:StatusState') == 'available')
|
||||
|
||||
_LOGGER.debug("Update %s, state: %s", self._name, self._state)
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ TAHOMA_TYPES = {
|
|||
'io:ExteriorVenetianBlindIOComponent': 'cover',
|
||||
'io:HorizontalAwningIOComponent': 'cover',
|
||||
'io:LightIOSystemSensor': 'sensor',
|
||||
'io:TemperatureIOSystemSensor': 'sensor',
|
||||
'io:OnOffIOComponent': 'switch',
|
||||
'io:OnOffLightIOComponent': 'switch',
|
||||
'io:RollerShutterGenericIOComponent': 'cover',
|
||||
|
@ -57,7 +58,8 @@ TAHOMA_TYPES = {
|
|||
'rts:ExteriorVenetianBlindRTSComponent': 'cover',
|
||||
'rts:GarageDoor4TRTSComponent': 'switch',
|
||||
'rts:RollerShutterRTSComponent': 'cover',
|
||||
'rts:VenetianBlindRTSComponent': 'cover'
|
||||
'rts:VenetianBlindRTSComponent': 'cover',
|
||||
'rts:OnOffRTSComponent': 'switch'
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue