mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add more tahoma sensors (#36256)
This commit is contained in:
parent
b5f12bd9c1
commit
7e2872bab3
@ -66,6 +66,8 @@ TAHOMA_TYPES = {
|
||||
"rts:RollerShutterRTSComponent": "cover",
|
||||
"rts:OnOffRTSComponent": "switch",
|
||||
"rts:VenetianBlindRTSComponent": "cover",
|
||||
"somfythermostat:SomfyThermostatTemperatureSensor": "sensor",
|
||||
"somfythermostat:SomfyThermostatHumiditySensor": "sensor",
|
||||
}
|
||||
|
||||
|
||||
|
@ -56,6 +56,13 @@ class TahomaSensor(TahomaDevice, Entity):
|
||||
return None
|
||||
if self.tahoma_device.type == "rtds:RTDSMotionSensor":
|
||||
return None
|
||||
if (
|
||||
self.tahoma_device.type
|
||||
== "somfythermostat:SomfyThermostatTemperatureSensor"
|
||||
):
|
||||
return TEMP_CELSIUS
|
||||
if self.tahoma_device.type == "somfythermostat:SomfyThermostatHumiditySensor":
|
||||
return UNIT_PERCENTAGE
|
||||
|
||||
def update(self):
|
||||
"""Update the state."""
|
||||
@ -86,6 +93,19 @@ class TahomaSensor(TahomaDevice, Entity):
|
||||
float(self.tahoma_device.active_states["core:TemperatureState"]), 1
|
||||
)
|
||||
self._available = True
|
||||
if (
|
||||
self.tahoma_device.type
|
||||
== "somfythermostat:SomfyThermostatTemperatureSensor"
|
||||
):
|
||||
self.current_value = float(
|
||||
f"{self.tahoma_device.active_states['core:TemperatureState']:.2f}"
|
||||
)
|
||||
self._available = True
|
||||
if self.tahoma_device.type == "somfythermostat:SomfyThermostatHumiditySensor":
|
||||
self.current_value = float(
|
||||
f"{self.tahoma_device.active_states['core:RelativeHumidityState']:.2f}"
|
||||
)
|
||||
self._available = True
|
||||
|
||||
_LOGGER.debug("Update %s, value: %d", self._name, self.current_value)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user