Skip to content

Commit 08fb873

Browse files
committed
device: report symbolic names for pairing errors
1 parent 1a9725f commit 08fb873

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/logitech_receiver/notifications.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def handle_pairing_lock(receiver: Receiver, notification: HIDPPNotification) ->
433433
receiver.pairing.new_device = None
434434
pair_error = ord(notification.data[:1])
435435
if pair_error:
436-
receiver.pairing.error = error_string = hidpp10_constants.PairingError(pair_error)
436+
receiver.pairing.error = error_string = hidpp10_constants.PairingError(pair_error).name
437437
receiver.pairing.new_device = None
438438
logger.warning("pairing error %d: %s", pair_error, error_string)
439439
receiver.changed(reason=reason)
@@ -453,7 +453,7 @@ def handle_discovery_status(receiver: Receiver, notification: HIDPPNotification)
453453
receiver.pairing.device_passkey = None
454454
discover_error = ord(notification.data[:1])
455455
if discover_error:
456-
receiver.pairing.error = discover_string = hidpp10_constants.BoltPairingError(discover_error)
456+
receiver.pairing.error = discover_string = hidpp10_constants.BoltPairingError(discover_error).name
457457
logger.warning("bolt discovering error %d: %s", discover_error, discover_string)
458458
receiver.changed(reason=reason)
459459
return True
@@ -495,7 +495,7 @@ def handle_pairing_status(receiver: Receiver, notification: HIDPPNotification) -
495495
elif notification.address == 0x02 and not pair_error:
496496
receiver.pairing.new_device = receiver.register_new_device(notification.data[7])
497497
if pair_error:
498-
receiver.pairing.error = error_string = hidpp10_constants.BoltPairingError(pair_error)
498+
receiver.pairing.error = error_string = hidpp10_constants.BoltPairingError(pair_error).name
499499
receiver.pairing.new_device = None
500500
logger.warning("pairing error %d: %s", pair_error, error_string)
501501
receiver.changed(reason=reason)

0 commit comments

Comments
 (0)