From 5f8a668f4a284646076c4ae6801ded702d5dabf2 Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Wed, 23 Oct 2024 09:26:27 +0200 Subject: [PATCH] Fix handing of "Wrong PIN" --- helper/helper/device.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/helper/helper/device.py b/helper/helper/device.py index 846fbc077..1417dd860 100644 --- a/helper/helper/device.py +++ b/helper/helper/device.py @@ -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