From ea4a0422316089e899311965f4225eb7e3ef8a9e Mon Sep 17 00:00:00 2001 From: Andrea Pontecorvo Date: Fri, 3 Feb 2023 16:58:05 +0100 Subject: [PATCH] Disabled discovery/update on start if disabled --- example/main.py | 2 +- pyproject.toml | 2 +- src/govee_local_api/__init__.py | 2 +- src/govee_local_api/controller.py | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/example/main.py b/example/main.py index 9031492..1e585d9 100644 --- a/example/main.py +++ b/example/main.py @@ -30,7 +30,7 @@ async def main(controller: GoveeController): loop = asyncio.new_event_loop() controller: GoveeController = GoveeController( loop, - discovery=True, + discovery=False, discovered_callback=discovered_callback, evicted_callback=lambda device: print(f"Evicted {device}"), ) diff --git a/pyproject.toml b/pyproject.toml index 0cb5781..dbed416 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "govee-local-api" -version = "1.1.0" +version = "1.1.1" authors = [ { name="Galorhallen", email="andrea.ponte1987@gmail.com" }, ] diff --git a/src/govee_local_api/__init__.py b/src/govee_local_api/__init__.py index 4e30be6..fab67c6 100644 --- a/src/govee_local_api/__init__.py +++ b/src/govee_local_api/__init__.py @@ -2,4 +2,4 @@ from .controller import GoveeController from .device import GoveeDevice -__version__ = "1.1.0" +__version__ = "1.1.1" diff --git a/src/govee_local_api/controller.py b/src/govee_local_api/controller.py index b7404f6..4457279 100644 --- a/src/govee_local_api/controller.py +++ b/src/govee_local_api/controller.py @@ -93,8 +93,10 @@ async def start(self): lambda: self, local_addr=(self._listening_address, self._listening_port) ) - self.send_discovery_message() - self.send_update_message() + if self._discovery: + self.send_discovery_message() + if self._autoupdate: + self.send_update_message() def clenaup(self): if self._transport: