Add support for individual LED themes #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Manual says
Complaining right now 😉
You can the test case in this PR. As I understand from the manual, the device should just take the complex object as the theme.
Testing with
pytest -k individual_led_theme
.With adding a
print
statement, you see the air-Q's error:just like an unsupported string was provided.
Since I am not sure what the current state with the "known bug" is, a few thoughts.
If "known bug" is "not implemented yet", you might want to use that chance and improve the options a little.
Current use-case
My current use-case is to bring air-Q's LED to show a fine-granular VOC scale. With
low=0, high=360, datasource="voc"
I would get one LED per 20 ppb VOC. That would be sufficient for now.The default VOC theme will only light one LED per 100 ppb.
Thinking possibilities
If the endpoint is not yet fix, you might think the current proposal does not give all the options.
I like the
Noise
theme, having a green-yellow-red bar.Doing this for example with CO2 value is not possible.
The same goes for the
Noise (contrast)
theme where LEDs are just unlit, when the value is not reached.Last year when mailing to Mario, I had the idea you could split the LEDs into 4x4 scales (with one LED unlit as separator) showing 4 values at once.
Thinking towards HomeAssistant
Given the fact, a user cannot (or better: does not want to) click together a complex data object for such an individual theme, it would be nice (and maybe easier for you to implement) if a theme could be defined up front.
Like:
A perfect move would be to provide all LED themes customizable and retrieveable by API, even your default ones you currently provide.
After defining themes, they can be selected like the default themes:
With such defined themes a user-interaction would be made more easily in HA UI.

A 5-minute GIMPing to visualize, how it could look:
Sorry, posting got longer than expected, but I had a lot of ideas.
What do you think?
Since the LEDs are air-Q's optical sugar ("Look, what things my air-Q can all do?"), I would love to see more options available.