Tado AIR_CONDITIONING module was not working propertly (#25677)
* Tado AIR_CONDITIONING module was not working propertly AIR_CONDITIONING modules differs from HEATING module int he parameters. * Tado Cooling Sensor was not read proprtly * TADO correct file permissions * Tado: Fix compilation error * Fix Lint errors * Fix Black formatting * TADO More AC functionality Also Black formatting * Tado Fix Lint * Tado Fix Lint II
This commit is contained in:
parent
af70b6da20
commit
5f0334d208
3 changed files with 264 additions and 49 deletions
|
@ -12,7 +12,7 @@ ATTR_DATA_ID = "data_id"
|
|||
ATTR_DEVICE = "device"
|
||||
ATTR_ZONE = "zone"
|
||||
|
||||
CLIMATE_SENSOR_TYPES = [
|
||||
CLIMATE_HEAT_SENSOR_TYPES = [
|
||||
"temperature",
|
||||
"humidity",
|
||||
"power",
|
||||
|
@ -22,6 +22,16 @@ CLIMATE_SENSOR_TYPES = [
|
|||
"overlay",
|
||||
]
|
||||
|
||||
CLIMATE_COOL_SENSOR_TYPES = [
|
||||
"temperature",
|
||||
"humidity",
|
||||
"power",
|
||||
"link",
|
||||
"ac",
|
||||
"tado mode",
|
||||
"overlay",
|
||||
]
|
||||
|
||||
HOT_WATER_SENSOR_TYPES = ["power", "link", "tado mode", "overlay"]
|
||||
|
||||
|
||||
|
@ -38,7 +48,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
sensor_items = []
|
||||
for zone in zones:
|
||||
if zone["type"] == "HEATING":
|
||||
for variable in CLIMATE_SENSOR_TYPES:
|
||||
for variable in CLIMATE_HEAT_SENSOR_TYPES:
|
||||
sensor_items.append(
|
||||
create_zone_sensor(tado, zone, zone["name"], zone["id"], variable)
|
||||
)
|
||||
|
@ -47,6 +57,11 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
sensor_items.append(
|
||||
create_zone_sensor(tado, zone, zone["name"], zone["id"], variable)
|
||||
)
|
||||
elif zone["type"] == "AIR_CONDITIONING":
|
||||
for variable in CLIMATE_COOL_SENSOR_TYPES:
|
||||
sensor_items.append(
|
||||
create_zone_sensor(tado, zone, zone["name"], zone["id"], variable)
|
||||
)
|
||||
|
||||
me_data = tado.get_me()
|
||||
sensor_items.append(
|
||||
|
@ -138,6 +153,8 @@ class TadoSensor(Entity):
|
|||
return "%"
|
||||
if self.zone_variable == "heating":
|
||||
return "%"
|
||||
if self.zone_variable == "ac":
|
||||
return ""
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
|
@ -198,10 +215,25 @@ class TadoSensor(Entity):
|
|||
elif self.zone_variable == "heating":
|
||||
if "activityDataPoints" in data:
|
||||
activity_data = data["activityDataPoints"]
|
||||
self._state = float(activity_data["heatingPower"]["percentage"])
|
||||
self._state_attributes = {
|
||||
"time": activity_data["heatingPower"]["timestamp"]
|
||||
}
|
||||
|
||||
if (
|
||||
"heatingPower" in activity_data
|
||||
and activity_data["heatingPower"] is not None
|
||||
):
|
||||
self._state = float(activity_data["heatingPower"]["percentage"])
|
||||
self._state_attributes = {
|
||||
"time": activity_data["heatingPower"]["timestamp"]
|
||||
}
|
||||
|
||||
elif self.zone_variable == "ac":
|
||||
if "activityDataPoints" in data:
|
||||
activity_data = data["activityDataPoints"]
|
||||
|
||||
if "acPower" in activity_data and activity_data["acPower"] is not None:
|
||||
self._state = activity_data["acPower"]["value"]
|
||||
self._state_attributes = {
|
||||
"time": activity_data["acPower"]["timestamp"]
|
||||
}
|
||||
|
||||
elif self.zone_variable == "tado bridge status":
|
||||
if "connectionState" in data:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue