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:
Feng Wang
2024-12-30 20:54:50 +08:00
committed by GitHub
parent 310029d8ed
commit 196e19d10a
5 changed files with 493 additions and 471 deletions

View File

@ -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."""