Skip to content

Commit

Permalink
Fix climatisation target temperature setting
Browse files Browse the repository at this point in the history
  • Loading branch information
milkboy committed Apr 19, 2022
1 parent 7c2c408 commit 57b9eaa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions custom_components/volkswagencarnet/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,16 @@ async def set_timer_basic_settings(self, service_call: ServiceCall) -> bool:
_LOGGER.debug(f"Setting target temperature to {tt} {self.hass.config.units.temperature_unit}")
# get timers
t = await c.connection.getTimers(c.vin)
if self.hass.config.units.is_metric:
t.timersAndProfiles.timerBasicSetting.set_target_temperature_celsius(float(tt))
if t.timersAndProfiles.timerBasicSetting.targetTemperature is not None:
if self.hass.config.units.is_metric:
t.timersAndProfiles.timerBasicSetting.set_target_temperature_celsius(float(tt))
else:
t.timersAndProfiles.timerBasicSetting.set_target_temperature_fahrenheit(int(tt))
temp = t.timersAndProfiles.timerBasicSetting.targetTemperature
else:
t.timersAndProfiles.timerBasicSetting.set_target_temperature_fahrenheit(int(tt))
temp = float(tt)
# send command to volkswagencarnet
res = res and await v.set_climatisation_temp(t.timersAndProfiles.timerBasicSetting.targetTemperature)
res = res and await v.set_climatisation_temp(temp)
if ml is not None:
_LOGGER.debug(f"Setting minimum charge level to {ml}%")
# send charge limit command to volkswagencarnet
Expand Down

0 comments on commit 57b9eaa

Please sign in to comment.