I have an app that among other things have an battery alarm.
Unfortunately the device implementation is implemented so that an battery alarm is triggered by an negative power measure.
This means that when the alarm is triggered it is restored the next time an power measure is sent.
Is there any way to check the last time an value was set by an app and what value it have.
I would like to check if the value equals x and if it was updated in the last 30 min to prevent spammy messages to the user.
I am the app developer
The problem is that the device have an hacky way to report battery level.
If value is -10 or -30 the battery is triggerd. There is no way to get the actual value just the alarm state.
The problem is that if there is an actual power reading (occurs all the time) alarm should be resolved.
My plan was to have some logic so if the alarm battery is active I do not make any changes until it have been resolved for x minutes.