Merge 822b762b3c into 8a941c5553
This commit is contained in:
commit
9f7b2484e7
|
|
@ -1891,7 +1891,7 @@ class Hidpp20:
|
|||
logger.error("failed to read whole name of %s (expected %d chars)", device, name_length)
|
||||
return None
|
||||
|
||||
return name.decode("utf-8")
|
||||
return name.decode("utf-8", errors="replace")
|
||||
|
||||
def get_battery_status(self, device: Device):
|
||||
report = device.feature_request(SupportedFeature.BATTERY_STATUS)
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ def handle_device_discovery(receiver: Receiver, notification: HIDPPNotification)
|
|||
receiver.pairing.device_address = notification.data[6:12]
|
||||
receiver.pairing.device_authentication = notification.data[14]
|
||||
elif notification.data[1] == 1:
|
||||
receiver.pairing.device_name = notification.data[3 : 3 + notification.data[2]].decode("utf-8")
|
||||
receiver.pairing.device_name = notification.data[3 : 3 + notification.data[2]].decode("utf-8", errors="replace")
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -497,7 +497,7 @@ class BoltReceiver(Receiver):
|
|||
codename = self.read_register(Registers.RECEIVER_INFO, InfoSubRegisters.BOLT_DEVICE_NAME + n, 0x01)
|
||||
if codename:
|
||||
codename = codename[3 : 3 + min(14, ord(codename[2:3]))]
|
||||
return codename.decode("ascii")
|
||||
return codename.decode("ascii", errors="replace")
|
||||
|
||||
def device_pairing_information(self, n: int) -> dict:
|
||||
pair_info = self.read_register(Registers.RECEIVER_INFO, InfoSubRegisters.BOLT_PAIRING_INFORMATION + n)
|
||||
|
|
|
|||
Loading…
Reference in New Issue