mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Prevent verisure lock from looping forever and sleeping in test (#37425)
This commit is contained in:
parent
0c771f1c42
commit
78e53e35c2
@ -126,9 +126,14 @@ class VerisureDoorlock(LockEntity):
|
||||
)["doorLockStateChangeTransactionId"]
|
||||
_LOGGER.debug("Verisure doorlock %s", state)
|
||||
transaction = {}
|
||||
attempts = 0
|
||||
while "result" not in transaction:
|
||||
sleep(0.5)
|
||||
transaction = hub.session.get_lock_state_transaction(transaction_id)
|
||||
attempts += 1
|
||||
if attempts == 30:
|
||||
break
|
||||
if attempts > 1:
|
||||
sleep(0.5)
|
||||
if transaction["result"] == "OK":
|
||||
self._state = state
|
||||
self._change_timestamp = monotonic()
|
||||
|
Loading…
x
Reference in New Issue
Block a user