Add support for sensor domain and binary_sensor domain #9
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.
This adds sensor and binary_sensor controllers. These are read-only entities, so by default the slider is disabled.
Sensor domain requested in mattieha#111
Binary_sensor domain requested in mattieha#128
Screenshot:
Notes:
Currently, tapping the card tries to trigger a non-existent toggle or turn_off/turn_on service. Neither of these domains have such services.
This is actually resolved by a separate feature I am working on to add configurable tap actions to cards regardless of slider being enabled or disabled (https://github.com/lizsugar/slider-button-card/tree/slider_tap_action), but that is not ready yet and it is larger than just these sensors cards. Once that is ready and merged, then these cards can be configured to have a tap_action of none, or more-info, or call-service, or whatever the user desires.
Sensors do not have built in min or max values, so they cannot be programmatically generated for the card per entity. The user has to add manual
min:
andmax:
values to theslider:
section of the card's YAML (no GUI config for min or max exist at this time). For example:The max is set to 70 because that's the AQI at which I start to have breathing problems.
or
a max of 100 for batteries.