only notify on connected devices at start-up

This commit is contained in:
Daniel Pavel 2013-05-18 02:20:22 +03:00
parent 6482670fdf
commit 7ae24488d9
1 changed files with 3 additions and 1 deletions

View File

@ -182,9 +182,11 @@ class DeviceStatus(dict):
self.clear()
if battery is not None:
self[BATTERY_LEVEL] = battery
if self.updated == 0:
if self.updated == 0 and active:
alert |= ALERT.NOTIFICATION
self.updated = timestamp or _timestamp()
# if _log.isEnabledFor(_DEBUG):
# _log.debug("device %d changed: active=%s %s", self._device.number, self._active, dict(self))
self._changed_callback(self._device, alert, reason)