api: implement operating locks
This commit is contained in:
parent
b7aeeab762
commit
60c4770280
3 changed files with 45 additions and 12 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue