mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-08-05 14:58:52 +08:00
misc: remove tev dependency for lan control & fixs (#333)
* Remove tev & fix some type issues * Use call_soon_threadsafe instead of event fd for ipc * fix lint * add tev back * fix lint * ignore broad exception warning * revert changes in the license * do not set asyncio event loop * fix racing condition * remove unused data classes * change internal class scope * set timers to None after cancel * Adjust import order * fix typo * Fix typo in comments * guard lan apis with init_done
This commit is contained in:
@ -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."""
|
||||
|
Reference in New Issue
Block a user