mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Add support for Somfy RTS power socket and Somfy io Temperature sensor (#30053)
* Added support for Somfy RTS wireless power socket and Somfy Temperature Sensore Thermos Wirefree io * Added code formatting fixes for commit 5faaf9c * added support for RollerShutterRTSComponent from Somfy * Added support for RTS roller shutter in set_cover_position * Add support for Somfy RTS power socket and Somfy io temperature sensor * black and isort fixes
This commit is contained in:
parent
b0a0871bed
commit
dedd1aec8c
@ -45,6 +45,7 @@ TAHOMA_TYPES = {
|
|||||||
"io:RollerShutterWithLowSpeedManagementIOComponent": "cover",
|
"io:RollerShutterWithLowSpeedManagementIOComponent": "cover",
|
||||||
"io:SomfyBasicContactIOSystemSensor": "sensor",
|
"io:SomfyBasicContactIOSystemSensor": "sensor",
|
||||||
"io:SomfyContactIOSystemSensor": "sensor",
|
"io:SomfyContactIOSystemSensor": "sensor",
|
||||||
|
"io:TemperatureIOSystemSensor": "sensor",
|
||||||
"io:VerticalExteriorAwningIOComponent": "cover",
|
"io:VerticalExteriorAwningIOComponent": "cover",
|
||||||
"io:VerticalInteriorBlindVeluxIOComponent": "cover",
|
"io:VerticalInteriorBlindVeluxIOComponent": "cover",
|
||||||
"io:WindowOpenerVeluxIOComponent": "cover",
|
"io:WindowOpenerVeluxIOComponent": "cover",
|
||||||
@ -59,6 +60,7 @@ TAHOMA_TYPES = {
|
|||||||
"rts:ExteriorVenetianBlindRTSComponent": "cover",
|
"rts:ExteriorVenetianBlindRTSComponent": "cover",
|
||||||
"rts:GarageDoor4TRTSComponent": "switch",
|
"rts:GarageDoor4TRTSComponent": "switch",
|
||||||
"rts:RollerShutterRTSComponent": "cover",
|
"rts:RollerShutterRTSComponent": "cover",
|
||||||
|
"rts:OnOffRTSComponent": "switch",
|
||||||
"rts:VenetianBlindRTSComponent": "cover",
|
"rts:VenetianBlindRTSComponent": "cover",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from homeassistant.const import ATTR_BATTERY_LEVEL
|
from homeassistant.const import ATTR_BATTERY_LEVEL, TEMP_CELSIUS
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
|
|
||||||
from . import DOMAIN as TAHOMA_DOMAIN, TahomaDevice
|
from . import DOMAIN as TAHOMA_DOMAIN, TahomaDevice
|
||||||
@ -40,8 +40,8 @@ class TahomaSensor(TahomaDevice, Entity):
|
|||||||
@property
|
@property
|
||||||
def unit_of_measurement(self):
|
def unit_of_measurement(self):
|
||||||
"""Return the unit of measurement of this entity, if any."""
|
"""Return the unit of measurement of this entity, if any."""
|
||||||
if self.tahoma_device.type == "Temperature Sensor":
|
if self.tahoma_device.type == "io:TemperatureIOSystemSensor":
|
||||||
return None
|
return TEMP_CELSIUS
|
||||||
if self.tahoma_device.type == "io:SomfyContactIOSystemSensor":
|
if self.tahoma_device.type == "io:SomfyContactIOSystemSensor":
|
||||||
return None
|
return None
|
||||||
if self.tahoma_device.type == "io:SomfyBasicContactIOSystemSensor":
|
if self.tahoma_device.type == "io:SomfyBasicContactIOSystemSensor":
|
||||||
@ -79,6 +79,11 @@ class TahomaSensor(TahomaDevice, Entity):
|
|||||||
if self.tahoma_device.type == "rtds:RTDSMotionSensor":
|
if self.tahoma_device.type == "rtds:RTDSMotionSensor":
|
||||||
self.current_value = self.tahoma_device.active_states["core:OccupancyState"]
|
self.current_value = self.tahoma_device.active_states["core:OccupancyState"]
|
||||||
self._available = True
|
self._available = True
|
||||||
|
if self.tahoma_device.type == "io:TemperatureIOSystemSensor":
|
||||||
|
self.current_value = round(
|
||||||
|
float(self.tahoma_device.active_states["core:TemperatureState"]), 1
|
||||||
|
)
|
||||||
|
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)
|
||||||
|
|
||||||
|
@ -45,9 +45,14 @@ class TahomaSwitch(TahomaDevice, SwitchDevice):
|
|||||||
else:
|
else:
|
||||||
self._state = STATE_OFF
|
self._state = STATE_OFF
|
||||||
|
|
||||||
self._available = bool(
|
# A RTS power socket doesn't have a feedback channel,
|
||||||
self.tahoma_device.active_states.get("core:StatusState") == "available"
|
# so we must assume the socket is available.
|
||||||
)
|
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)
|
_LOGGER.debug("Update %s, state: %s", self._name, self._state)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user