This adds sensor and binary_sensor controllers. These are read-only entities, so by default the slider is disabled.
Sensor domain requested in #111
Binary_sensor domain requested in #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: and max: values to the slider: section of the card's YAML (no GUI config for min or max exist at this time). For example:
type: custom:slider-button-card
name: Local AQI
entity: sensor.purple_air_aqi
slider:
max: 70
The max is set to 70 because that's the AQI at which I start to have breathing problems.
This looks great! And I think it's ready to merge. Do you want to do a README change on this branch or include that separately with a global README change?
This adds sensor and binary_sensor controllers. These are read-only entities, so by default the slider is disabled.
Sensor domain requested in #111 Binary_sensor domain requested in #128
Screenshot:![image](https://user-images.githubusercontent.com/187255/166392657-8d654a60-2f60-4dbb-b71c-40676f3ee0d3.png)
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.