pytouchlinesl 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytouchlinesl-0.1.3/pytouchlinesl.egg-info → pytouchlinesl-0.1.4}/PKG-INFO +1 -1
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pyproject.toml +1 -1
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/client/base.py +5 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/client/client.py +8 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/client/models/models.py +1 -1
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/touchlinesl.py +4 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/zone.py +5 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4/pytouchlinesl.egg-info}/PKG-INFO +1 -1
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/LICENSE +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/README.md +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/__init__.py +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/client/__init__.py +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/client/models/__init__.py +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl/module.py +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl.egg-info/SOURCES.txt +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl.egg-info/dependency_links.txt +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl.egg-info/requires.txt +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/pytouchlinesl.egg-info/top_level.txt +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/setup.cfg +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/tests/test_module.py +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/tests/test_touchlinesl.py +0 -0
- {pytouchlinesl-0.1.3 → pytouchlinesl-0.1.4}/tests/test_zone.py +0 -0
|
@@ -10,6 +10,11 @@ from .models import ModuleModel
|
|
|
10
10
|
class BaseClient(ABC):
|
|
11
11
|
"""Base API client implementation for Roth API clients."""
|
|
12
12
|
|
|
13
|
+
@abstractmethod
|
|
14
|
+
async def user_id(self) -> str:
|
|
15
|
+
"""Return the unique user id for the authenticated account."""
|
|
16
|
+
pass
|
|
17
|
+
|
|
13
18
|
@abstractmethod
|
|
14
19
|
async def authenticated(self) -> bool:
|
|
15
20
|
"""Report whether or not the client is authenticated with the API."""
|
|
@@ -73,6 +73,14 @@ class RothAPI(BaseClient):
|
|
|
73
73
|
self._user_id = resp.get("user_id")
|
|
74
74
|
self._token = resp.get("token")
|
|
75
75
|
|
|
76
|
+
async def user_id(self) -> str:
|
|
77
|
+
"""Return the unique user id for the authenticated account."""
|
|
78
|
+
if self._token is None:
|
|
79
|
+
await self._login()
|
|
80
|
+
|
|
81
|
+
assert isinstance(self._user_id, str)
|
|
82
|
+
return self._user_id
|
|
83
|
+
|
|
76
84
|
async def authenticated(self) -> bool:
|
|
77
85
|
"""Report whether or not the client is authenticated with the API."""
|
|
78
86
|
if self._token is None:
|
|
@@ -30,7 +30,7 @@ class ZoneAttributesModel(BaseModel):
|
|
|
30
30
|
current_temperature: Optional[int] = Field(..., alias="currentTemperature")
|
|
31
31
|
set_temperature: int = Field(..., alias="setTemperature")
|
|
32
32
|
flags: ZoneFlagsModel
|
|
33
|
-
zone_state: Literal["zoneOff", "noAlarm"] = Field(..., alias="zoneState")
|
|
33
|
+
zone_state: Literal["zoneOff", "noAlarm", "zoneUnregistered"] = Field(..., alias="zoneState")
|
|
34
34
|
signal_strength: Optional[int] = Field(..., alias="signalStrength")
|
|
35
35
|
battery_level: Optional[int] = Field(..., alias="batteryLevel")
|
|
36
36
|
actuators_open: int = Field(..., alias="actuatorsOpen")
|
|
@@ -52,6 +52,10 @@ class TouchlineSL:
|
|
|
52
52
|
raise TypeError("username and password must be strings if no client is provided")
|
|
53
53
|
self._client = RothAPI(username=username, password=password)
|
|
54
54
|
|
|
55
|
+
async def user_id(self) -> str:
|
|
56
|
+
"""Return the unique user ID of the authenticated account."""
|
|
57
|
+
return await self._client.user_id()
|
|
58
|
+
|
|
55
59
|
async def modules(self, *, refresh: bool = False) -> list[Module]:
|
|
56
60
|
"""Report a list of Roth TouchlineSL modules associated with the account.
|
|
57
61
|
|
|
@@ -72,6 +72,11 @@ class Zone:
|
|
|
72
72
|
"""Return the ID of the zone."""
|
|
73
73
|
return self._raw_data.zone.id
|
|
74
74
|
|
|
75
|
+
@property
|
|
76
|
+
def battery_level(self) -> int | None:
|
|
77
|
+
"""Return the battery level of the zone."""
|
|
78
|
+
return self._raw_data.zone.battery_level
|
|
79
|
+
|
|
75
80
|
@property
|
|
76
81
|
def temperature(self) -> float | None:
|
|
77
82
|
"""Return the current temperature of the zone, if it's enabled, otherwise None."""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|