only notify on connected devices at start-up
This commit is contained in:
parent
6482670fdf
commit
7ae24488d9
|
|
@ -182,9 +182,11 @@ class DeviceStatus(dict):
|
||||||
self.clear()
|
self.clear()
|
||||||
if battery is not None:
|
if battery is not None:
|
||||||
self[BATTERY_LEVEL] = battery
|
self[BATTERY_LEVEL] = battery
|
||||||
if self.updated == 0:
|
|
||||||
|
if self.updated == 0 and active:
|
||||||
alert |= ALERT.NOTIFICATION
|
alert |= ALERT.NOTIFICATION
|
||||||
self.updated = timestamp or _timestamp()
|
self.updated = timestamp or _timestamp()
|
||||||
|
|
||||||
# if _log.isEnabledFor(_DEBUG):
|
# if _log.isEnabledFor(_DEBUG):
|
||||||
# _log.debug("device %d changed: active=%s %s", self._device.number, self._active, dict(self))
|
# _log.debug("device %d changed: active=%s %s", self._device.number, self._active, dict(self))
|
||||||
self._changed_callback(self._device, alert, reason)
|
self._changed_callback(self._device, alert, reason)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue