Skip to content

Commit 4bc7d74

Browse files
authored
Merge pull request #85 from erwindouna/dev
Add childLock feature
2 parents 0f6216f + 0da889e commit 4bc7d74

File tree

4 files changed

+62
-258
lines changed

4 files changed

+62
-258
lines changed

poetry.lock

Lines changed: 26 additions & 254 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "tadoasync"
3-
version = "0.1.14"
3+
version = "0.1.15"
44
authors = ["Erwin Douna <[email protected]>"]
55
classifiers = [
66
"Development Status :: 5 - Production/Stable",
@@ -26,10 +26,7 @@ mashumaro = ">=3.10"
2626
orjson = ">=3.9.8"
2727
python = "^3.12"
2828
yarl = ">=1.6.0"
29-
oauthlib = "^3.2.2"
30-
requests-oauthlib = "^1.3.1"
3129
aioresponses = "^0.7.6"
32-
sphinx-rtd-theme = "^2.0.0"
3330

3431
[tool.poetry.urls]
3532
"Bug Tracker" = "https://github.com/erwindouna/python-tado/issues"
@@ -51,6 +48,7 @@ ruff = "0.1.13"
5148
safety = "3.0.1"
5249
yamllint = "1.33.0"
5350
syrupy = "4.6.1"
51+
deptry = "^0.19.1"
5452

5553
[tool.coverage.report]
5654
show_missing = true

src/tadoasync/tadoasync.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,17 @@ async def get_device_info(
339339
response = await self._request(f"devices/{serial_no}/{attribute}")
340340
return TemperatureOffset.from_json(response)
341341

342+
async def set_child_lock(self, serial_no: str, child_lock: bool | None) -> None:
343+
"""Set the child lock."""
344+
if not isinstance(child_lock, bool):
345+
raise TadoBadRequestError("child_lock must be a boolean")
346+
347+
await self._request(
348+
f"devices/{serial_no}/childLock",
349+
data={"childLockEnabled": child_lock},
350+
method=HttpMethod.PUT,
351+
)
352+
342353
async def set_meter_readings(
343354
self, date: str | None = None, reading: int = 0
344355
) -> str:

0 commit comments

Comments
 (0)