From 42e1b14caadc6639690ac5a4d8c3e1c5d7e283a9 Mon Sep 17 00:00:00 2001 From: Rob Hofmann Date: Mon, 12 Jun 2023 23:43:15 +0200 Subject: [PATCH] Fix for secondary features --- custom_components/gree/climate.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/custom_components/gree/climate.py b/custom_components/gree/climate.py index 26f8673..15eff1c 100644 --- a/custom_components/gree/climate.py +++ b/custom_components/gree/climate.py @@ -463,8 +463,7 @@ async def _async_temp_sensor_changed(self, entity_id, old_state, new_state): if new_state is None: return self._async_update_current_temp(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_temp(self, state): @@ -496,8 +495,7 @@ async def _async_lights_entity_state_changed(self, entity_id, old_state, new_sta # do nothing if state change is triggered due to Sync with HVAC return self._async_update_current_lights(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_lights(self, state): @@ -522,8 +520,7 @@ async def _async_xfan_entity_state_changed(self, entity_id, old_state, new_state _LOGGER.info('Cant set xfan in %s mode' % str(self._hvac_mode)) return self._async_update_current_xfan(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_xfan(self, state): @@ -544,8 +541,7 @@ async def _async_health_entity_state_changed(self, entity_id, old_state, new_sta # do nothing if state change is triggered due to Sync with HVAC return self._async_update_current_health(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_health(self, state): @@ -570,8 +566,7 @@ async def _async_powersave_entity_state_changed(self, entity_id, old_state, new_ _LOGGER.info('Cant set powersave in %s mode' % str(self._hvac_mode)) return self._async_update_current_powersave(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_powersave(self, state): @@ -597,8 +592,7 @@ async def _async_sleep_entity_state_changed(self, entity_id, old_state, new_stat _LOGGER.info('Cant set sleep in %s mode' % str(self._hvac_mode)) return self._async_update_current_sleep(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_sleep(self, state): @@ -623,8 +617,7 @@ async def _async_eightdegheat_entity_state_changed(self, entity_id, old_state, n _LOGGER.info('Cant set 8℃ heat in %s mode' % str(self._hvac_mode)) return self._async_update_current_eightdegheat(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_eightdegheat(self, state): @@ -645,8 +638,7 @@ async def _async_air_entity_state_changed(self, entity_id, old_state, new_state) # do nothing if state change is triggered due to Sync with HVAC return self._async_update_current_air(new_state) - for x in self.async_update_ha_state(): - yield x + return self.async_update_ha_state() @callback def _async_update_current_air(self, state):