diff --git a/custom_components/daikinskyport/climate.py b/custom_components/daikinskyport/climate.py index 5469aa8..0e9d1a1 100644 --- a/custom_components/daikinskyport/climate.py +++ b/custom_components/daikinskyport/climate.py @@ -571,7 +571,8 @@ def extra_state_attributes(self): heatpump_demand = "Unavailable" dehumidification_demand = "Unavailable" humidification_demand = "Unavailable" - + indoor_mode = "Unavailable" + if "ctAHCurrentIndoorAirflow" in self.thermostat: if self.thermostat["ctAHCurrentIndoorAirflow"] == 65535: fan_cfm = self.thermostat["ctIFCIndoorBlowerAirflow"] @@ -596,6 +597,11 @@ def extra_state_attributes(self): if "ctAHHumidificationRequestedDemand" in self.thermostat: humidification_demand = round(self.thermostat["ctAHHumidificationRequestedDemand"] / 2, 1) + if self.thermostat["ctAHUnitType"] != 255: + indoor_mode=self.thermostat["ctAHMode"].strip() + elif self.thermostat["ctIFCUnitType"] != 255: + indoor_mode=self.thermostat["ctIFCOperatingHeatCoolMode"].strip() + return { "fan": self.fan, "schedule_mode": self.thermostat["schedEnabled"], @@ -608,9 +614,14 @@ def extra_state_attributes(self): "humidification_demand": humidification_demand, "thermostat_version": self.thermostat["statFirmware"], "night_mode_active": self.thermostat["nightModeActive"], - "night_mode_enabled": self.thermostat["nightModeEnabled"] + "night_mode_enabled": self.thermostat["nightModeEnabled"], + "indoor_mode": indoor_mode, + "outdoor_mode": self.thermostat["ctOutdoorMode"].strip(), + "thermostat_unlocked": bool(self.thermostat["displayLockPIN"] == 0), + "media_filter_days": self.thermostat["alertMediaAirFilterDays"] } + def set_preset_mode(self, preset_mode): """Activate a preset.""" if preset_mode == self.preset_mode: diff --git a/custom_components/daikinskyport/switch.py b/custom_components/daikinskyport/switch.py index 9f1fd4c..b594a20 100644 --- a/custom_components/daikinskyport/switch.py +++ b/custom_components/daikinskyport/switch.py @@ -59,7 +59,7 @@ def turn_on(self, **kwargs: Any) -> None: send_command = self.data.daikinskyport.set_hvac_mode(self._index, DAIKIN_HVAC_MODE_AUXHEAT) if send_command: self.aux_on = True - self.async_write_ha_state() + self.schedule_update_ha_state() else: raise HomeAssistantError(f"Error {send_command}: Failed to turn on {self._name}") @@ -68,7 +68,7 @@ def turn_off(self, **kwargs: Any) -> None: if self.data.daikinskyport.get_thermostat(self._index)['mode'] == DAIKIN_HVAC_MODE_AUXHEAT: self.data.daikinskyport.set_hvac_mode(self._index, DAIKIN_HVAC_MODE_HEAT) self.aux_on = False - self.async_write_ha_state() + self.schedule_update_ha_state() @property def device_info(self) -> DeviceInfo: