From dfa5812021d18f6f8ad75a56fb5814b55d8203fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joris=20Pelgr=C3=B6m?= Date: Sat, 18 Apr 2026 19:15:05 +0200 Subject: [PATCH] Adjust descriptions for watering systems - Split DI-2/DI-3 - Update readme and package info to mention watering systems --- README.md | 17 ++++++++++------- letpot/converters.py | 12 +++++++++--- pyproject.toml | 2 +- tests/test_converter.py | 9 +++++---- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 110b7c7..56164b3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # python-letpot -Asynchronous Python client for interacting with LetPot hydroponic gardens via the manufacturer's cloud. You can listen for status updates (push) and change device settings. +Asynchronous Python client for interacting with LetPot hydroponic gardens and watering systems via the manufacturer's cloud. You can listen for status updates (push) and change device settings. The following models should be supported, although only LPH-AIR is tested: - - LPH-AIR - - LPH-MAX - - LPH-MINI - - LPH-PRO - - LPH-SE + - Hydroponic gardens + - LPH-AIR + - LPH-MAX + - LPH-MINI + - LPH-PRO + - LPH-SE + - Watering systems + - DI-2/DI-3 (Automatic Watering System 2.0) ## Example usage @@ -36,7 +39,7 @@ async def main(): await device_client.request_status_update(device_serial) # do work, and finally - device_client.disconnect(device_serial) + device_client.unsubscribe(device_serial) asyncio.run(main()) diff --git a/letpot/converters.py b/letpot/converters.py index cd7430b..e8b8a86 100644 --- a/letpot/converters.py +++ b/letpot/converters.py @@ -24,7 +24,8 @@ _LOGGER = logging.getLogger(__name__) MODEL_AIR = ("LetPot Air", "LPH-AIR") -MODEL_DI = ("LetPot Automatic Watering System", "DI") +MODEL_DI2 = ("LetPot Automatic Watering System 2.0", "DI-2") +MODEL_DI3 = ("LetPot Automatic Watering System 2.0", "DI-3") MODEL_MAX = ("LetPot Max", "LPH-MAX") MODEL_MINI = ("LetPot Mini", "LPH-MINI") MODEL_PRO = ("LetPot Pro", "LPH-PRO") @@ -414,14 +415,19 @@ def get_light_brightness_levels(self) -> list[int]: class ISEConverter(LetPotDeviceConverter): - """Converters and info for device type ISE05, ISE06 (Automatic Watering System).""" + """Converters and info for device type ISE05, ISE06 (Automatic Watering System 2.0).""" @staticmethod def supports_type(device_type: str) -> bool: return device_type in ["ISE05", "ISE06"] def get_device_model(self) -> tuple[str, str] | None: - return MODEL_DI + if self._device_type == "ISE05": + return MODEL_DI2 + elif self._device_type == "ISE06": + return MODEL_DI3 + else: + return None def supported_features(self) -> DeviceFeature: return DeviceFeature.CATEGORY_WATERING_SYSTEM diff --git a/pyproject.toml b/pyproject.toml index 2f9ce90..154e5a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "letpot" version = "0.1.0" -description = "Asynchronous Python client for LetPot hydroponic gardens." +description = "Asynchronous Python client for LetPot hydroponic gardens and watering systems." authors = ["Joris Pelgröm "] license = "MIT" readme = "README.md" diff --git a/tests/test_converter.py b/tests/test_converter.py index d771c26..afc0908 100644 --- a/tests/test_converter.py +++ b/tests/test_converter.py @@ -34,10 +34,11 @@ "LPH63", "LPH64", ] -SUPPORTED_DEVICE_TYPES_WATERING = ["ISE05", "ISE06"] -SUPPORTED_DEVICE_TYPES_ALL = ( - SUPPORTED_DEVICE_TYPES_GARDEN + SUPPORTED_DEVICE_TYPES_WATERING -) +SUPPORTED_DEVICE_TYPES_WATERING_SYSTEM = ["ISE05", "ISE06"] +SUPPORTED_DEVICE_TYPES_ALL = [ + *SUPPORTED_DEVICE_TYPES_GARDEN, + *SUPPORTED_DEVICE_TYPES_WATERING_SYSTEM, +] @pytest.mark.parametrize(