Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre0512 committed Mar 30, 2024
1 parent a746584 commit 54dd406
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion custom_components/hon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool
password=entry.data[CONF_PASSWORD],
mobile_id=MOBILE_ID,
session=session,
# test_data_path=Path(config_dir),
test_data_path=Path(config_dir),
refresh_token=entry.data.get(CONF_REFRESH_TOKEN, ""),
).create()

Expand Down
4 changes: 2 additions & 2 deletions custom_components/hon/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ async def async_set_preset_mode(self, preset_mode: str) -> None:
self._device.sync_command("startProgram", "settings")
self._set_temperature_bound()
self._handle_coordinator_update(update=False)
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})
self._attr_preset_mode = preset_mode
await self._device.commands["startProgram"].send()
self.async_write_ha_state()
Expand Down Expand Up @@ -408,7 +408,7 @@ async def async_set_preset_mode(self, preset_mode: str) -> None:
self._device.sync_command(command, "settings")
self._set_temperature_bound()
self._attr_preset_mode = preset_mode
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})
await self._device.commands[command].send()
self.async_write_ha_state()

Expand Down
2 changes: 1 addition & 1 deletion custom_components/hon/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def device_info(self) -> DeviceInfo:
model=self._device.model_name,
sw_version=self._device.get("fwVersion", ""),
hw_version=f"{self._device.appliance_type}{self._device.model_id}",
serial_number=self._device.get("serialNumber", "")
serial_number=self._device.get("serialNumber", ""),
)

@callback
Expand Down
4 changes: 2 additions & 2 deletions custom_components/hon/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ async def async_lock(self, **kwargs: Any) -> None:
setting.value = setting.max if isinstance(setting, HonParameterRange) else 1
self.async_write_ha_state()
await self._device.commands["settings"].send()
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

async def async_unlock(self, **kwargs: Any) -> None:
"""Unlock method."""
Expand All @@ -68,7 +68,7 @@ async def async_unlock(self, **kwargs: Any) -> None:
setting.value = setting.min if isinstance(setting, HonParameterRange) else 0
self.async_write_ha_state()
await self._device.commands["settings"].send()
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

@property
def available(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/hon/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ async def async_set_native_value(self, value: float) -> None:
await self._device.commands[command].send()
if command != "settings":
self._device.sync_command(command, "settings")
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

@callback
def _handle_coordinator_update(self, update: bool = True) -> None:
Expand Down Expand Up @@ -308,7 +308,7 @@ async def async_set_native_value(self, value: float) -> None:
setting = self._device.settings[self.entity_description.key]
if isinstance(setting, HonParameterRange):
setting.value = value
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

@property
def available(self) -> bool:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/hon/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def _option_to_number(self, option: str, values: list[str]) -> str:
async def async_select_option(self, option: str) -> None:
setting = self._device.settings[self.entity_description.key]
setting.value = self._option_to_number(option, setting.values)
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

@callback
def _handle_coordinator_update(self, update: bool = True) -> None:
Expand Down Expand Up @@ -317,7 +317,7 @@ async def async_select_option(self, option: str) -> None:
await self._device.commands[command].send()
if command != "settings":
self._device.sync_command(command, "settings")
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

@property
def available(self) -> bool:
Expand Down
12 changes: 6 additions & 6 deletions custom_components/hon/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ async def async_turn_on(self, **kwargs: Any) -> None:
setting.value = setting.max if isinstance(setting, HonParameterRange) else 1
self.async_write_ha_state()
await self._device.commands["settings"].send()
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

async def async_turn_off(self, **kwargs: Any) -> None:
setting = self._device.settings[f"settings.{self.entity_description.key}"]
Expand All @@ -456,7 +456,7 @@ async def async_turn_off(self, **kwargs: Any) -> None:
setting.value = setting.min if isinstance(setting, HonParameterRange) else 0
self.async_write_ha_state()
await self._device.commands["settings"].send()
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})

@property
def available(self) -> bool:
Expand Down Expand Up @@ -489,14 +489,14 @@ def is_on(self) -> bool | None:

async def async_turn_on(self, **kwargs: Any) -> None:
self._device.sync_command(self.entity_description.turn_on_key, "settings")
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})
await self._device.commands[self.entity_description.turn_on_key].send()
self._device.attributes[self.entity_description.key] = True
self.async_write_ha_state()

async def async_turn_off(self, **kwargs: Any) -> None:
self._device.sync_command(self.entity_description.turn_off_key, "settings")
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})
await self._device.commands[self.entity_description.turn_off_key].send()
self._device.attributes[self.entity_description.key] = False
self.async_write_ha_state()
Expand Down Expand Up @@ -541,15 +541,15 @@ async def async_turn_on(self, **kwargs: Any) -> None:
if type(setting) == HonParameter:
return
setting.value = setting.max if isinstance(setting, HonParameterRange) else "1"
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})
self.async_write_ha_state()

async def async_turn_off(self, **kwargs: Any) -> None:
setting = self._device.settings[self.entity_description.key]
if type(setting) == HonParameter:
return
setting.value = setting.min if isinstance(setting, HonParameterRange) else "0"
self.coordinator.async_set_updated_data(None)
self.coordinator.async_set_updated_data({})
self.async_write_ha_state()

@callback
Expand Down

0 comments on commit 54dd406

Please sign in to comment.