Skip to content

Commit

Permalink
Merge pull request #156 from Chupaka/fix_await_self.async_write_ha_state
Browse files Browse the repository at this point in the history
Remove `await` in front of self.async_write_ha_state() calls
  • Loading branch information
ScratMan authored Jun 5, 2023
2 parents 9adaccb + ea09cd3 commit 9376d1c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/smart_thermostat/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ async def clear_integral(self, **kwargs):
"""Clear the integral value."""
self._pid_controller.integral = 0.0
self._i = self._pid_controller.integral
await self.async_write_ha_state()
self.async_write_ha_state()

@property
def min_temp(self):
Expand Down Expand Up @@ -877,7 +877,7 @@ async def _async_control_heating(self, time_func=None, calc_pid=False):
data = {ATTR_ENTITY_ID: self._heater_entity_id,
ATTR_VALUE: self._control_output}
await self.hass.services.async_call(NUMBER_DOMAIN, SERVICE_SET_VALUE, data)
await self.async_write_ha_state()
self.async_write_ha_state()
return

if self._sensor_stall != 0 and time.time() - self._last_sensor_update > \
Expand All @@ -887,7 +887,7 @@ async def _async_control_heating(self, time_func=None, calc_pid=False):
elif calc_pid or self._sampling_period != 0:
await self.calc_output()
await self.set_control_value()
await self.async_write_ha_state()
self.async_write_ha_state()

@property
def _is_device_active(self):
Expand Down

0 comments on commit 9376d1c

Please sign in to comment.