Skip to content

Commit

Permalink
Changes to be committed:
Browse files Browse the repository at this point in the history
	modified:   custom_components/programmable_thermostat/climate.py
removed await since self.async_write_ha_state is not an async function
  • Loading branch information
MapoDan committed Jan 9, 2024
1 parent aa8ebe3 commit 00dd6e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions custom_components/programmable_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ async def _async_turn_on(self, mode=None):
if not self._is_device_active_function(forced=False) and self.is_active_long_enough(mode=mode):
self._set_hvac_action_on(mode=mode)
await self.hass.services.async_call(HA_DOMAIN, SERVICE_TURN_ON, data)
await self.async_write_ha_state()
self.async_write_ha_state()

async def _async_turn_off(self, mode=None, forced=False):
"""Turn heater toggleable device off."""
Expand All @@ -293,7 +293,7 @@ async def _async_turn_off(self, mode=None, forced=False):
if self._is_device_active_function(forced=forced) and self.is_active_long_enough(mode=mode):
self._set_hvac_action_off(mode=mode)
await self.hass.services.async_call(HA_DOMAIN, SERVICE_TURN_OFF, data)
await self.async_write_ha_state()
self.async_write_ha_state()

async def async_set_hvac_mode(self, hvac_mode):
"""Set hvac mode."""
Expand All @@ -320,7 +320,7 @@ async def async_set_temperature(self, **kwargs):
return
self._target_temp = float(temperature)
await self.control_system_mode()
await self.async_write_ha_state()
self.async_write_ha_state()

async def _async_sensor_changed(self, event):
"""Handle temperature changes."""
Expand All @@ -329,7 +329,7 @@ async def _async_sensor_changed(self, event):
return
self._async_update_temp(new_state.state)
await self.control_system_mode()
await self.async_write_ha_state()
self.async_write_ha_state()

async def _async_target_changed(self, event):
"""Handle temperature changes in the program."""
Expand All @@ -340,7 +340,7 @@ async def _async_target_changed(self, event):
if self._hvac_mode == HVACMode.HEAT_COOL:
self._async_restore_program_temp()
await self.control_system_mode()
await self.async_write_ha_state()
self.async_write_ha_state()

async def _async_control_thermo(self, mode=None):
"""Check if we need to turn heating on or off."""
Expand Down

0 comments on commit 00dd6e5

Please sign in to comment.