mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-08 05:31:56 +00:00
Since we have been receiving a lot of reports and complaints about the battery readings on the smartsense devices that received battery updates (multi and motion), we are adding this code to smooth out the readings so it doesn't constantly oscillate between two values. The basic logic is, only create an event if we have two readings in a row that are the same, or a reading is more than 100 millivolts off of the current battery percentage.