Skip to content

Commit

Permalink
Fix reboot flag not being reset (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaskivskyi authored Nov 21, 2023
1 parent d35b92b commit 362bd39
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions asusrouter/asusrouter.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,30 @@ async def _async_handle_reboot(self) -> None:
self.async_run_service, led_state.data["state"], self._identity
)

# Reset the reboot flag
self._reset_flag("reboot")

def _reset_flag(self, flag: str) -> None:
"""Reset a flag."""

_LOGGER.debug("Triggered method _reset_flag")

# Check that AsusData.FLAGS is available
if AsusData.FLAGS not in self._state:
return

# Get the data from the state
data = self._state[AsusData.FLAGS].data

# Check that data is a dict
if not isinstance(data, dict):
return

# Reset the flag
data.pop(flag, None)

_LOGGER.debug("Flag `%s` reset", flag)

# ---------------------------
# <-- Connection-related methods
# ---------------------------
Expand Down

0 comments on commit 362bd39

Please sign in to comment.