Let timedelta do the time delta calculation for me.
Get rid of distinction between 'level' and 'state' at the eventbus
and persist layers. Just use level.

Also, for gateway plugins that get a new level/state value payload
along with device change notifications, ignore that and just send
the event notification; if any event handlers care (and persist
definitely will), they can call get_level themselves. My current
philosophy on this is there should be a data channel and a notification
channel, and you don't announce data on the notification channel. Time
will tell if that's a good line to hold.

The combination of these changes is certainly simpler and less code,
and seems to hold less chance for inconsistency.