Closed dshokouhi closed 2 weeks ago
This will probably change on every sensor update, lots of updates in the state machine.
Would it make sense to round this to minutes (as all devices seem to do this in settings etc.), and/or maybe report is a timestamp?
Would it make sense to round this to minutes (as all devices seem to do this in settings etc.)
This sounds reasonable and good point about too many updates, every minute will also line up with fast while charging update frequency :)
and/or maybe report is a timestamp?
I think this may still be subject to a lot of updates right? Using the phone while charging may also impact this number as I can see battery temp and voltage being impacted too
This does not appear to work correctly / produces results that are different from the settings app and lock screen and seem impossible. (Pixel 7a with Android 14)
The sensor does correctly change from unavailable when unplugged > 0 min at first > 4 min after a while > stays at 4 min despite charging and the estimate in the settings app changing.
Also suggestion: use sentence case for the sensor name to be more consistent with others.
Thank you! Both should be corrected in the next push :)
Awesome, this seems to match the system's estimate almost perfectly during the ~15 min I observed.
Almost, because the system seems to always show 1 minute less remaining, meaning it rounds down whereas the app rounds up. Can we change that for consistency?
Almost, because the system seems to always show 1 minute less remaining, meaning it rounds down whereas the app rounds up. Can we change that for consistency?
So always round down or round down in certain cases?
Right now it looks like always round down is the way to do this.
Summary
Fixes: #3934 by adding the sensor for devices on Android P +
Sensor reports in minutes so have used the
duration
class. This sensor will only update during the normal sensor update interval and may work better if using the fast while charging sensor update frequency setting.Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#1058
Any other notes