Skip to content

Commit

Permalink
Fix handing of "Wrong PIN"
Browse files Browse the repository at this point in the history
  • Loading branch information
dainnilsson committed Oct 23, 2024
1 parent 353766b commit 5f8a668
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions helper/helper/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,13 @@ def __call__(self, *args, **kwargs):
raise ChildResetException(str(e))
raise
except Exception as e: # TODO: Replace with ConnectionError once added
if "Wrong" in str(e):
raise ChildResetException(str(e))
words = str(e).split()
try:
word = words[words.index("Wrong") + 1]
if word in ("nonce", "channel", "sequence"):
raise ChildResetException(str(e))
except ValueError:
pass
raise

@property
Expand Down

0 comments on commit 5f8a668

Please sign in to comment.