device: handle inaccessiable devices when determining protocol

This commit is contained in:
Peter F. Patel-Schneider 2025-12-31 06:31:09 -05:00
parent fc68521731
commit 4b7ad97fc6
1 changed files with 4 additions and 1 deletions

View File

@ -216,7 +216,10 @@ class Device:
@property
def protocol(self):
if not self._protocol:
self.ping()
try:
self.ping()
except exceptions.NoSuchDevice:
logger.warning("device %s inaccessible - no protocol set", self)
return self._protocol or 0
@property