From 3e8beb81324ededbfa543ec71c8930d03d631d13 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 15 Apr 2023 14:04:07 -0500 Subject: [PATCH] update python deps --- frigate/app.py | 1 - frigate/mypy.ini | 3 -- frigate/zeroconf.py | 63 ----------------------------------------- requirements-wheels.txt | 5 ++-- 4 files changed, 2 insertions(+), 70 deletions(-) delete mode 100644 frigate/zeroconf.py diff --git a/frigate/app.py b/frigate/app.py index df89dd8b6..ef77cd1dd 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -391,7 +391,6 @@ class FrigateApp: self.start_stats_emitter() self.start_watchdog() self.check_shm() - # self.zeroconf = broadcast_zeroconf(self.config.mqtt.client_id) def receiveSignal(signalNumber: int, frame: Optional[FrameType]) -> None: self.stop() diff --git a/frigate/mypy.ini b/frigate/mypy.ini index 881ae6c82..d8f849334 100644 --- a/frigate/mypy.ini +++ b/frigate/mypy.ini @@ -59,6 +59,3 @@ ignore_errors = false [mypy-frigate.watchdog] ignore_errors = false disallow_untyped_calls = false - -[mypy-frigate.zeroconf] -ignore_errors = false diff --git a/frigate/zeroconf.py b/frigate/zeroconf.py deleted file mode 100644 index 22c0b1e4e..000000000 --- a/frigate/zeroconf.py +++ /dev/null @@ -1,63 +0,0 @@ -import logging -import socket - -from zeroconf import ( - ServiceInfo, - NonUniqueNameException, - InterfaceChoice, - IPVersion, - Zeroconf, -) - -logger = logging.getLogger(__name__) - -ZEROCONF_TYPE = "_frigate._tcp.local." - - -# Taken from: http://stackoverflow.com/a/11735897 -def get_local_ip() -> bytes: - """Try to determine the local IP address of the machine.""" - host_ip_str = "" - try: - sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) - - # Use Google Public DNS server to determine own IP - sock.connect(("8.8.8.8", 80)) - - host_ip_str = sock.getsockname()[0] - except OSError: - try: - host_ip_str = socket.gethostbyname(socket.gethostname()) - except socket.gaierror: - host_ip_str = "127.0.0.1" - finally: - sock.close() - - try: - host_ip_pton = socket.inet_pton(socket.AF_INET, host_ip_str) - except OSError: - host_ip_pton = socket.inet_pton(socket.AF_INET6, host_ip_str) - - return host_ip_pton - - -def broadcast_zeroconf(frigate_id: str) -> Zeroconf: - zeroconf = Zeroconf(interfaces=InterfaceChoice.Default, ip_version=IPVersion.V4Only) - - host_ip = get_local_ip() - - info = ServiceInfo( - ZEROCONF_TYPE, - name=f"{frigate_id}.{ZEROCONF_TYPE}", - addresses=[host_ip], - port=5000, - ) - - logger.info("Starting Zeroconf broadcast") - try: - zeroconf.register_service(info) - except NonUniqueNameException: - logger.error( - "Frigate instance with identical name present in the local network" - ) - return zeroconf diff --git a/requirements-wheels.txt b/requirements-wheels.txt index f0e199de3..0b5da9315 100644 --- a/requirements-wheels.txt +++ b/requirements-wheels.txt @@ -11,15 +11,14 @@ peewee_migrate == 1.6.* psutil == 5.9.* pydantic == 1.10.* PyYAML == 6.0 -pytz == 2022.7 +pytz == 2023.3 tzlocal == 4.2 types-PyYAML == 6.0.* requests == 2.28.* types-requests == 2.28.* -scipy == 1.8.* +scipy == 1.10.* setproctitle == 1.3.* ws4py == 0.5.* -zeroconf == 0.47.* # Openvino Library - Custom built with MYRIAD support openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.2.0/openvino-2022.2.0-000-cp39-cp39-manylinux_2_31_x86_64.whl; platform_machine == 'x86_64' openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.2.0/openvino-2022.2.0-000-cp39-cp39-linux_aarch64.whl; platform_machine == 'aarch64'