diff --git a/lib/logitech/unifying_receiver/common.py b/lib/logitech/unifying_receiver/common.py index a506a5cf..c2f437f4 100644 --- a/lib/logitech/unifying_receiver/common.py +++ b/lib/logitech/unifying_receiver/common.py @@ -17,7 +17,7 @@ class NamedInt(int): def __new__(cls, value, name): assert isinstance(name, str) or isinstance(name, unicode) obj = int.__new__(cls, value) - obj.name = unicode(name) + obj.name = str(name) return obj def bytes(self, count=2): diff --git a/lib/logitech/unifying_receiver/receiver.py b/lib/logitech/unifying_receiver/receiver.py index 8e7fd564..12ee6475 100644 --- a/lib/logitech/unifying_receiver/receiver.py +++ b/lib/logitech/unifying_receiver/receiver.py @@ -214,7 +214,7 @@ class Receiver(object): serial_reply = self.request(0x83B5, 0x03) assert serial_reply self._serial = _strhex(serial_reply[1:5]) - self.max_devices = ord(serial_reply[6:7][0]) + self.max_devices = ord(serial_reply[6:7][0:1]) if self.max_devices == 1: self.name = 'Nano Receiver' diff --git a/lib/logitech/unifying_receiver/status.py b/lib/logitech/unifying_receiver/status.py index 32052aff..bcc6e0d5 100644 --- a/lib/logitech/unifying_receiver/status.py +++ b/lib/logitech/unifying_receiver/status.py @@ -283,11 +283,11 @@ class DeviceStatus(dict): alert = ALERT.NONE reason = self[ERROR] = None if _log.isEnabledFor(_DEBUG): - _log.debug("%s: battery %d% charged, %s", self._device, discharge, self[BATTERY_STATUS]) + _log.debug("%s: battery %d%% charged, %s", self._device, discharge, self[BATTERY_STATUS]) else: alert = ALERT.ALL reason = self[ERROR] = self[BATTERY_STATUS] - _log.warn("%s: battery %d% charged, ALERT %s", self._device, discharge, reason) + _log.warn("%s: battery %d%% charged, ALERT %s", self._device, discharge, reason) self._changed(alert=alert, reason=reason) else: _log.info("%s: unknown BATTERY %s", self._device, n)