Skip to content

Conversation

@bexelbie
Copy link
Contributor

This fix aligns the actual return values from querying the battery_low atribute with the UI display

This fix aligns the actual return values from querying the battery_low
atribute with the UI display
@bexelbie
Copy link
Contributor Author

This allows you to filter false in battery+ but still see unknowns

@andrew-codechimp
Copy link
Owner

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.
Have you tested this fix by running the beta version?
I don't think this changed but there are a lot of moving pieces here.

@bexelbie
Copy link
Contributor Author

@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.

@andrew-codechimp
Copy link
Owner

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.
Please do feedback once you've tested, I'll check it my side as well then merge into a new beta release in a few days.
I try and keep the code type checked, really must put in a MyPy check into the workflow to catch myself as well.

@bexelbie
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants