Fix Unknown battery_low attribute as false#3956
Conversation
This fix aligns the actual return values from querying the battery_low atribute with the UI display
|
This allows you to filter false in battery+ but still see unknowns |
|
Hi, thanks for the PR, this looks sensible but in case you haven't noticed the main branch is what is currently in beta v3, which is a significant change from the current release. |
|
@andrew-codechimp I had not noticed betav3 until I saw your blog today. I'll get it tested on that branch and report back. Thanks for the catch on the commit you pushed. |
|
Thanks, I've done a quick check and it does not look like that code has been changed from v2, this has been in the works for so long I've forgotten what I have changed. |
|
I monkey-patched my v3.0.2 instance and it seems fine. However, I am not sure this patch should be merged. A side effect of this patch is that the entities that an an unknown state are always listed unless you get "crazy" with your include/exclude in the battery state card. It should be simpler to say that you want "OK", "low", and "unknown" batteries. The core of this seems to be that returning "none" is equated to "false" when interpreted through HA and the battery card. The solution is likely to move this from being a binary to being a set of values (ok, low, unknown) so the user can filter better. But I am not sure. |
|
I think you are on the right lines with this but if the battery state card gets very confused with them being unknown then more thought will be required. I'll try and revisit but with the changes in this version already I don't want to tell people they have to go and fix their battery cards as well. |
This fix aligns the actual return values from querying the battery_low atribute with the UI display