Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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())
Expand Down
12 changes: 9 additions & 3 deletions letpot/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <joris.pelgrom@gmail.com>"]
license = "MIT"
readme = "README.md"
Expand Down
9 changes: 5 additions & 4 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading