diff --git a/aioairzone_cloud/device.py b/aioairzone_cloud/device.py index 2892af1..03d156f 100644 --- a/aioairzone_cloud/device.py +++ b/aioairzone_cloud/device.py @@ -16,6 +16,7 @@ API_AQ_STATUS, API_CONFIG, API_DEVICE_ID, + API_DOUBLE_SET_POINT, API_ERRORS, API_IS_CONNECTED, API_META, @@ -31,6 +32,7 @@ AZD_AQ_PRESENT, AZD_AQ_STATUS, AZD_AVAILABLE, + AZD_DOUBLE_SET_POINT, AZD_ERRORS, AZD_ID, AZD_INSTALLATION, @@ -62,6 +64,7 @@ def __init__(self, inst_id: str, ws_id: str, device_data: dict[str, Any]): self.aq_pm_10: int | None = None self.aq_present: bool | None = None self.aq_status: str | None = None + self.double_set_point: bool | None = None self.errors: list[str] = [] self.id = str(device_data[API_DEVICE_ID]) self.installation_id = inst_id @@ -96,6 +99,7 @@ def data(self) -> dict[str, Any]: """Return Device data.""" data: dict[str, Any] = { AZD_AVAILABLE: self.get_available(), + AZD_DOUBLE_SET_POINT: self.get_double_set_point(), AZD_ID: self.get_id(), AZD_INSTALLATION: self.get_installation(), AZD_IS_CONNECTED: self.get_is_connected(), @@ -183,6 +187,12 @@ def get_available(self) -> bool: """Return availability status.""" return self.is_connected and self.ws_connected + def get_double_set_point(self) -> bool: + """Return Device double set point.""" + if self.double_set_point is not None: + return self.double_set_point + return False + def get_errors(self) -> list[str]: """Return Device errors.""" return self.errors @@ -276,6 +286,10 @@ def update_data(self, update: EntityUpdate) -> None: if aq_status is not None: self.aq_status = aq_status + double_set_point = parse_bool(data.get(API_DOUBLE_SET_POINT)) + if double_set_point is not None: + self.double_set_point = double_set_point + errors = data.get(API_ERRORS) if errors is not None: self.errors = [] diff --git a/aioairzone_cloud/hvac.py b/aioairzone_cloud/hvac.py index 70198e4..de41686 100644 --- a/aioairzone_cloud/hvac.py +++ b/aioairzone_cloud/hvac.py @@ -24,7 +24,6 @@ API_CONSUMPTION_UE, API_DEFAULT_TEMP_STEP, API_DISCH_COMP_TEMP_UE, - API_DOUBLE_SET_POINT, API_EXCH_HEAT_TEMP_IU, API_EXCH_HEAT_TEMP_UE, API_EXT_TEMP, @@ -71,7 +70,6 @@ AZD_AQ_ACTIVE, AZD_AQ_MODE_CONF, AZD_AQ_MODE_VALUES, - AZD_DOUBLE_SET_POINT, AZD_HUMIDITY, AZD_INDOOR_EXCHANGER_TEMP, AZD_INDOOR_RETURN_TEMP, @@ -133,7 +131,6 @@ def __init__(self, inst_id: str, ws_id: str, device_data: dict[str, Any]): self.aq_active: bool | None = None self.aq_mode_conf: AirQualityMode | None = None self.aq_mode_values: list[AirQualityMode] | None = None - self.double_set_point: bool | None = None self.floor_demand: bool | None = None self.humidity: int | None = None self.indoor_exchanger_temp: float | None = None @@ -185,7 +182,6 @@ def data(self) -> dict[str, Any]: data[AZD_ACTION] = self.get_action() data[AZD_ACTIVE] = self.get_active() - data[AZD_DOUBLE_SET_POINT] = self.get_double_set_point() data[AZD_POWER] = self.get_power() data[AZD_TEMP] = self.get_temperature() data[AZD_TEMP_STEP] = self.get_temp_step() @@ -411,12 +407,6 @@ def get_aq_mode_values(self) -> list[AirQualityMode] | None: return self.aq_mode_values return None - def get_double_set_point(self) -> bool: - """Return HVAC double set point.""" - if self.double_set_point is not None: - return self.double_set_point - return False - def get_floor_demand(self) -> bool | None: """Return HVAC device floor demand status.""" return self.floor_demand @@ -797,10 +787,6 @@ def update_data(self, update: EntityUpdate) -> None: for aq_mode_value in aq_mode_values: self.aq_mode_values += [AirQualityMode(aq_mode_value)] - double_set_point = parse_bool(data.get(API_DOUBLE_SET_POINT)) - if double_set_point is not None: - self.double_set_point = double_set_point - humidity = parse_int(data.get(API_HUMIDITY)) if humidity is not None: self.humidity = humidity