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
5 changes: 1 addition & 4 deletions src/tadoasync/tadoasync.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,8 @@ async def get_device_info(
response = await self._request(f"devices/{serial_no}/")
return Device.from_json(response)

async def set_child_lock(self, serial_no: str, child_lock: bool | None) -> None:
async def set_child_lock(self, serial_no: str, *, child_lock: bool) -> None:
"""Set the child lock."""
if not isinstance(child_lock, bool):
raise TadoBadRequestError("child_lock must be a boolean")

await self._request(
f"devices/{serial_no}/childLock",
data={"childLockEnabled": child_lock},
Expand Down
11 changes: 0 additions & 11 deletions tests/test_tado.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,17 +498,6 @@ async def test_set_child_lock(python_tado: Tado, responses: aioresponses) -> Non
)
await python_tado.set_child_lock(serial_no=device_id, child_lock=child_lock)

invalid_child_lock = None
responses.put(
f"{TADO_API_URL}/devices/{device_id}/childLock",
status=204,
payload={"childLockEnabled": child_lock},
)
with pytest.raises(TadoBadRequestError):
await python_tado.set_child_lock(
serial_no=device_id, child_lock=invalid_child_lock
)


async def test_add_meter_readings_duplicated(
python_tado: Tado, responses: aioresponses, snapshot: SnapshotAssertion
Expand Down
Loading