Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: remove tev dependency for lan control & fixs #333

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions custom_components/xiaomi_home/miot/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ def randomize_int(value: int, ratio: float) -> int:
"""Randomize an integer value."""
return int(value * (1 - ratio + random.random()*2*ratio))

def randomize_float(value: float, ratio: float) -> float:
"""Randomize a float value."""
return value * (1 - ratio + random.random()*2*ratio)

class MIoTMatcher(MQTTMatcher):
"""MIoT Pub/Sub topic matcher."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_home/miot/miot_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ async def __on_miot_lan_state_change(self, state: bool) -> None:
handler=self.__on_lan_device_state_changed)
for did, info in (
await self._miot_lan.get_dev_list_async()).items():
self.__on_lan_device_state_changed(
await self.__on_lan_device_state_changed(
did=did, state=info, ctx=None)
_LOGGER.info('lan device list, %s', self._device_list_lan)
self._miot_lan.update_devices(devices={
Expand Down
Loading
Loading