Recover on ConnectionFailure of stale device nodes

This commit is contained in:
Dain Nilsson 2024-03-27 16:01:40 +01:00
parent bb973bb508
commit 67c6db5db7
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8

View File

@ -185,7 +185,15 @@ class DevicesNode(RpcNode):
def __call__(self, *args, **kwargs):
with self._get_state:
return super().__call__(*args, **kwargs)
try:
return super().__call__(*args, **kwargs)
except ConnectionException as e:
raise ChildResetException(f"{e}")
def close(self):
self._list_state = 0
self._device_mapping = {}
super().close()
@action(closes_child=False)
def scan(self, *ignored):