Skip to content

Add support for sensor domain and binary_sensor domain#9

Open
lizsugar wants to merge 1 commit intocustom-cards:mainfrom
lizsugar:sensor_cards
Open

Add support for sensor domain and binary_sensor domain#9
lizsugar wants to merge 1 commit intocustom-cards:mainfrom
lizsugar:sensor_cards

Conversation

@lizsugar
Copy link
Copy Markdown
Collaborator

@lizsugar lizsugar commented Jun 2, 2022

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:
image

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.

or

type: custom:slider-button-card
name: Pixel 6 Battery Level
entity: sensor.pixel_6_battery_level
slider:
  max: 100

a max of 100 for batteries.

@rohankapoorcom
Copy link
Copy Markdown
Member

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?

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