diff --git a/lib/logitech_receiver/notifications.py b/lib/logitech_receiver/notifications.py index 0cfc142c..b746406b 100644 --- a/lib/logitech_receiver/notifications.py +++ b/lib/logitech_receiver/notifications.py @@ -343,6 +343,8 @@ def _process_feature_notification(device, status, n, feature): if result: _ignore, level, next, battery_status, voltage = result status.set_battery_info(level, next, battery_status, voltage) + else: # this feature is used to signal device becoming inactive + status.changed(active=False) else: _log.warn('%s: unknown ADC MEASUREMENT %s', device, n) diff --git a/lib/logitech_receiver/status.py b/lib/logitech_receiver/status.py index bce7fea6..ca9bc5c8 100644 --- a/lib/logitech_receiver/status.py +++ b/lib/logitech_receiver/status.py @@ -237,7 +237,7 @@ class DeviceStatus(dict): else: reason = _('Battery: %(percent)d%% (%(status)s)') % {'percent': level, 'status': status.name} - if changed or reason: + if changed or reason or not self._active: # a battery response means device is active # update the leds on the device, if any _hidpp10.set_3leds(self._device, level, charging=charging, warning=bool(alert)) self.changed(active=True, alert=alert, reason=reason, timestamp=timestamp)