Typing Part 3: events.py (#3352)

* Typing: events.py

* Remove unused variable

* Fix return Any from return statement

Not all elements from the event dict are sure to be something that can be evaluated

See e.g.: https://github.com/python/mypy/issues/5697

* Sort out Event disambiguity

There was a name collision of multiprocessing Event type and frigate events

Co-authored-by: Sebastian Englbrecht <sebastian.englbrecht@kabelmail.de>
This commit is contained in:
herostrat
2022-11-19 14:16:33 +01:00
committed by GitHub
parent a04fa105ef
commit 2e81c94d8e
5 changed files with 40 additions and 24 deletions

View File

@@ -7,13 +7,13 @@ import signal
from frigate.object_detection import ObjectDetectProcess
from frigate.util import restart_frigate
from multiprocessing.synchronize import Event
from multiprocessing.synchronize import Event as MpEvent
logger = logging.getLogger(__name__)
class FrigateWatchdog(threading.Thread):
def __init__(self, detectors: dict[str, ObjectDetectProcess], stop_event: Event):
def __init__(self, detectors: dict[str, ObjectDetectProcess], stop_event: MpEvent):
threading.Thread.__init__(self)
self.name = "frigate_watchdog"
self.detectors = detectors