mypy fixups

This commit is contained in:
Chris OBryan 2023-06-10 02:19:47 -05:00
parent 0788a1a1a4
commit 2e1e00fa38

View File

@ -103,10 +103,11 @@ class Dispatcher:
# Send SIGUSR1 to resume, SIGUSR2 to pause
new_state = True if payload == "ON" else False if payload == "OFF" else None
if new_state is not None:
sig = signal.SIGUSR1 if new_state else signal.SIGUSR2
self.config.cameras[camera_name].capture_enabled = new_state
os.kill(capture_proc.pid, sig)
self.publish(f"{camera_name}/capture/state", payload, retain=True)
if capture_proc and capture_proc.pid:
sig = signal.SIGUSR1 if new_state else signal.SIGUSR2
os.kill(capture_proc.pid, sig)
def _on_detect_command(self, camera_name: str, payload: str) -> None:
"""Callback for detect topic."""