Skip to content

Commit

Permalink
fix missing await
Browse files Browse the repository at this point in the history
  • Loading branch information
pail23 committed Jun 28, 2024
1 parent 7751e4d commit ea5e2d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions custom_components/stiebel_eltron_isg/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ def set_temperature(self, **kwargs) -> None:
"""Set new target temperature."""
value = kwargs["temperature"]
if self.coordinator.data.get(OPERATION_MODE) == ECO_MODE:
self.coordinator.set_data(
await self.coordinator.set_data(
TEMPERATURE_KEY_MAP[self.entity_description.key][0],
value,
)
else:
self.coordinator.set_data(
await self.coordinator.set_data(
TEMPERATURE_KEY_MAP[self.entity_description.key][1],
value,
)
Expand Down Expand Up @@ -260,7 +260,7 @@ def hvac_mode(self) -> HVACMode | None:
def set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new operation mode."""
new_mode = HA_TO_WPM_HVAC.get(hvac_mode)
self.coordinator.set_data(OPERATION_MODE, new_mode)
await self.coordinator.set_data(OPERATION_MODE, new_mode)

@property
def preset_mode(self) -> str | None:
Expand All @@ -270,7 +270,7 @@ def preset_mode(self) -> str | None:
def set_preset_mode(self, preset_mode):
"""Set new target preset mode."""
new_mode = HA_TO_WPM_PRESET.get(preset_mode)
self.coordinator.set_data(OPERATION_MODE, new_mode)
await self.coordinator.set_data(OPERATION_MODE, new_mode)


class StiebelEltronLWZClimateEntity(StiebelEltronISGClimateEntity):
Expand Down Expand Up @@ -302,7 +302,7 @@ def hvac_mode(self) -> HVACMode | None:
def set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set new operation mode."""
new_mode = HA_TO_LWZ_HVAC.get(hvac_mode)
self.coordinator.set_data(OPERATION_MODE, new_mode)
await self.coordinator.set_data(OPERATION_MODE, new_mode)

@property
def preset_mode(self) -> str | None:
Expand All @@ -312,7 +312,7 @@ def preset_mode(self) -> str | None:
def set_preset_mode(self, preset_mode):
"""Set new target preset mode."""
new_mode = HA_TO_LWZ_PRESET.get(preset_mode)
self.coordinator.set_data(OPERATION_MODE, new_mode)
await self.coordinator.set_data(OPERATION_MODE, new_mode)

@property
def fan_mode(self) -> str | None:
Expand All @@ -325,6 +325,6 @@ def set_fan_mode(self, fan_mode: str) -> None:
"""Set new target fan mode."""
new_mode = HA_TO_LWZ_FAN.get(fan_mode)
if self.coordinator.data.get(OPERATION_MODE) == ECO_MODE:
self.coordinator.set_data(FAN_LEVEL_NIGHT, new_mode)
await self.coordinator.set_data(FAN_LEVEL_NIGHT, new_mode)
else:
self.coordinator.set_data(FAN_LEVEL_DAY, new_mode)
await self.coordinator.set_data(FAN_LEVEL_DAY, new_mode)
4 changes: 2 additions & 2 deletions custom_components/stiebel_eltron_isg/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ def is_on(self) -> bool:

async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the switch on."""
self.coordinator.set_data(self.entity_description.key, 1)
await self.coordinator.set_data(self.entity_description.key, 1)
await self.async_update()

async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the device off."""
self.coordinator.set_data(self.entity_description.key, 0)
await self.coordinator.set_data(self.entity_description.key, 0)
await self.async_update()

@property
Expand Down

0 comments on commit ea5e2d9

Please sign in to comment.