Skip to content

Commit

Permalink
Trying to solves issues asev#52 asev#62 asev#63
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-code-ruiz authored Jan 13, 2025
1 parent 2b44b2a commit 440681d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions custom_components/uponor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ async def async_switch_to_cooling(self):

await self._hass.async_add_executor_job(lambda: self._client.send_data({'sys_heat_cool_mode': '1'}))
self._data['sys_heat_cool_mode'] = '1'
await self.call_state_update()
self._hass.async_create_task(self.call_state_update())

async def async_switch_to_heating(self):
for thermostat in self._hass.data[DOMAIN]['thermostats']:
Expand All @@ -234,7 +234,7 @@ async def async_switch_to_heating(self):

await self._hass.async_add_executor_job(lambda: self._client.send_data({'sys_heat_cool_mode': '0'}))
self._data['sys_heat_cool_mode'] = '0'
await self.call_state_update()
self._hass.async_create_task(self.call_state_update())

async def async_turn_on(self, thermostat):
data = await self._store.async_load()
Expand Down Expand Up @@ -273,7 +273,7 @@ async def async_set_away(self, is_away):
data = "1" if is_away else "0"
await self._hass.async_add_executor_job(lambda: self._client.send_data({var: data}))
self._data[var] = data
await self.call_state_update()
self._hass.async_create_task(self.call_state_update())

def is_eco(self, thermostat):
if self.get_eco_setback(thermostat) == 0:
Expand All @@ -299,19 +299,19 @@ async def async_update(self,_=None):
try:
self.next_sp_from_dt = dt_util.now()
self._data = await self._hass.async_add_executor_job(lambda: self._client.get_data())
await self.call_state_update()
self._hass.async_create_task(self.call_state_update())
except Exception as ex:
_LOGGER.error("Uponor thermostat was unable to update: %s", ex)

async def set_variable(self, var_name, var_value):
_LOGGER.debug("Called set variable: name: %s, value: %s, data: %s", var_name, var_value, self._data)
self._client.send_data({var_name: var_value})
self._data[var_name] = var_value
await self.call_state_update()
self._hass.async_create_task(self.call_state_update())

async def set_setpoint(self, thermostat, temp):
var = thermostat + '_setpoint'
setpoint = int(temp * 18 + self.get_active_setback(thermostat, temp) + 320)
await self._hass.async_add_executor_job(lambda: self._client.send_data({var: setpoint}))
self._data[var] = setpoint
await self.call_state_update()
self._hass.async_create_task(self.call_state_update())

0 comments on commit 440681d

Please sign in to comment.