api: implement operating locks

This commit is contained in:
lilly 2026-05-14 15:47:59 +02:00
commit 60c4770280
Signed by: lilly
SSH key fingerprint: SHA256:y9T5GFw2A20WVklhetIxG1+kcg/Ce0shnQmbu1LQ37g
3 changed files with 45 additions and 12 deletions

View file

@ -83,13 +83,14 @@ class CCUJackClient:
]
async def query_param_value(self, address):
async def query_param_value(self, address: str):
logger.debug("Querying parameter value from '%s'", address)
async with self.http.get(f"/device/{address}/~pv") as resp:
return CCUValue.model_validate(await resp.json())
# async def toggle_lock(self, lock_id, new_state):
# pass
async def set_param_value(self, address: str, value: Any):
logger.debug("Writing parameter value '%s' to '%s'", value, address)
await self.http.put(f"/device/{address}/~pv", json={"v": value})
async def _inspect_ccu_device(self, device_ref: CCURef) -> Tuple[CCUDeviceInfo, List[Tuple[CCUChannelInfo, List[CCUParamInfo]]]]:
logger.debug("Inspecting device '%s' (%s)", device_ref.href, device_ref.title)