Skip to content

Commit

Permalink
client: Add refresh_device_states (#956)
Browse files Browse the repository at this point in the history
This method can be used to refresh all states of a single device.
It's mostly useful for devices that don't automatically send state
updates such as gate or garage door motors.
  • Loading branch information
fetzerch committed Sep 19, 2023
1 parent de39e10 commit e0ee1a7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pyoverkiz/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,17 @@ async def refresh_states(self) -> None:
"""
await self.__post("setup/devices/states/refresh")

@backoff.on_exception(
backoff.expo, NotAuthenticatedException, max_tries=2, on_backoff=relogin
)
async def refresh_device_states(self, deviceurl: str) -> None:
"""
Ask the box to refresh all states of the given device for protocols supporting that operation
"""
await self.__post(
f"setup/devices/{urllib.parse.quote_plus(deviceurl)}/states/refresh"
)

@backoff.on_exception(backoff.expo, TooManyConcurrentRequestsException, max_tries=5)
async def register_event_listener(self) -> str:
"""
Expand Down

0 comments on commit e0ee1a7

Please sign in to comment.