Skip to content

Commit

Permalink
localapi: Zone: add support for double set point
Browse files Browse the repository at this point in the history
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
  • Loading branch information
Noltari committed Mar 31, 2022
1 parent 1e772a0 commit 0140976
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aioairzone/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
API_COOL_MIN_TEMP = "coolmintemp"
API_COOL_SET_POINT = "coolsetpoint"
API_DATA = "data"
API_DOUBLE_SET_POINT = "double_sp"
API_ERRORS = "errors"
API_FLOOR_DEMAND = "floor_demand"
API_HEAT_MAX_TEMP = "heatmaxtemp"
Expand Down Expand Up @@ -66,6 +67,7 @@
AZD_COOL_TEMP_MIN = "cool_temp_min"
AZD_COOL_TEMP_SET = "cool_temp_set"
AZD_DEMAND = "demand"
AZD_DOUBLE_SET_POINT = "double_set_point"
AZD_ERRORS = "errors"
AZD_FIRMWARE = "firmware"
AZD_FLOOR_DEMAND = "floor_demand"
Expand Down
10 changes: 10 additions & 0 deletions aioairzone/localapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
API_COOL_MIN_TEMP,
API_COOL_SET_POINT,
API_DATA,
API_DOUBLE_SET_POINT,
API_ERROR_SYSTEM_ID_OUT_RANGE,
API_ERROR_ZONE_ID_NOT_AVAILABLE,
API_ERROR_ZONE_ID_OUT_RANGE,
Expand Down Expand Up @@ -72,6 +73,7 @@
AZD_COOL_TEMP_MIN,
AZD_COOL_TEMP_SET,
AZD_DEMAND,
AZD_DOUBLE_SET_POINT,
AZD_ERRORS,
AZD_FIRMWARE,
AZD_FLOOR_DEMAND,
Expand Down Expand Up @@ -548,6 +550,7 @@ def __init__(self, system: System, zone: dict[str, Any]):
self.cool_temp_max: float | None = None
self.cool_temp_min: float | None = None
self.cool_temp_set: float | None = None
self.double_set_point: bool = False
self.errors: list | None = None
self.floor_demand = bool(zone[API_FLOOR_DEMAND])
self.heat_temp_max: float | None = None
Expand Down Expand Up @@ -587,6 +590,8 @@ def __init__(self, system: System, zone: dict[str, Any]):
self.cool_temp_min = float(zone[API_COOL_MIN_TEMP])
if API_COOL_SET_POINT in zone:
self.cool_temp_set = float(zone[API_COOL_SET_POINT])
if API_DOUBLE_SET_POINT in zone:
self.double_set_point = bool(zone[API_DOUBLE_SET_POINT])
if API_HEAT_MAX_TEMP in zone:
self.heat_temp_max = float(zone[API_HEAT_MAX_TEMP])
if API_HEAT_MIN_TEMP in zone:
Expand All @@ -610,6 +615,7 @@ def data(self) -> dict[str, Any]:
AZD_AIR_DEMAND: self.get_air_demand(),
AZD_COLD_STAGE: self.get_cold_stage(),
AZD_DEMAND: self.get_demand(),
AZD_DOUBLE_SET_POINT: self.get_double_set_point(),
AZD_FLOOR_DEMAND: self.get_floor_demand(),
AZD_HEAT_STAGE: self.get_heat_stage(),
AZD_HUMIDITY: self.get_humidity(),
Expand Down Expand Up @@ -695,6 +701,10 @@ def get_demand(self) -> bool:
"""Return zone demand."""
return self.get_air_demand() or self.get_floor_demand()

def get_double_set_point(self) -> bool:
"""Return zone double set point."""
return self.double_set_point

def get_heat_temp_max(self) -> float | None:
"""Return zone maximum heat temperature."""
if self.heat_temp_max:
Expand Down

0 comments on commit 0140976

Please sign in to comment.