Skip to content

Commit

Permalink
device: catch errors when pinging to try to put device online
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps committed Nov 19, 2023
1 parent 4669cad commit b2eb039
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/logitech_receiver/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ def codename(self):
def name(self):
if not self._name:
if not self.online: # be very defensive
self.ping()
try:
self.ping()
except _base.NoSuchDevice:
pass
if self.online and self.protocol >= 2.0:
self._name = _hidpp20.get_name(self)
return self._name or self._codename or ('Unknown device %s' % (self.wpid or self.product_id))
Expand Down

0 comments on commit b2eb039

Please sign in to comment.