power: Don't warn more than once per warning level for devices

A lot of wireless input devices, such as Logitech mice and touchpads, or
Bluetooth LE input devices, will disconnect and reconnect frequently
from the computer when unused.

This causes a problem when the battery on the device is low because
a new notification will be generated each time the device reconnects, as
if it was the first time it connected.

Saving the last warning-level for every external peripheral ensures that
we only emit one low battery notification for each warning-level, when
the threshold is crossed, rather than at every reconnect.

The last warning-level is not stored, so a new session, or a reboot will
cause devices to warn again once.

Closes: #108
6 jobs for wip/hadess/low-device-warn-once in 2 minutes and 45 seconds (queued for 1 second)
Status Job ID Name Coverage
  Build
passed #997749
build

00:00:46

 
  Test
passed #997750
test

00:01:58

 
  Manual
manual #997751
privileged allowed to fail manual
asan
manual #997754
allowed to fail manual
msan
manual #997752
allowed to fail manual
tsan
manual #997753
allowed to fail manual
ubsan