diff --git a/homeassistant/components/sensor/tahoma.py b/homeassistant/components/sensor/tahoma.py index 5918bd7c9f8..d16c945b643 100644 --- a/homeassistant/components/sensor/tahoma.py +++ b/homeassistant/components/sensor/tahoma.py @@ -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) diff --git a/homeassistant/components/switch/tahoma.py b/homeassistant/components/switch/tahoma.py index bcac038d43b..2dfba0cfdd5 100644 --- a/homeassistant/components/switch/tahoma.py +++ b/homeassistant/components/switch/tahoma.py @@ -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) diff --git a/homeassistant/components/tahoma.py b/homeassistant/components/tahoma.py index 5e30b845863..4b13d71d7b8 100644 --- a/homeassistant/components/tahoma.py +++ b/homeassistant/components/tahoma.py @@ -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' }