Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Handle Button Entities Automatically #161

Open
mathmaniac43 opened this issue Oct 13, 2023 · 0 comments
Open

[FR]: Handle Button Entities Automatically #161

mathmaniac43 opened this issue Oct 13, 2023 · 0 comments

Comments

@mathmaniac43
Copy link

Is your feature request related to a problem? Please describe.

I am interested in using this card with button entities (both button.* entities provided by integrations and input_button.* entities that I create as helpers). The default tap action for these button entities is to open the info dialog, which I find confusing and unintuitive. I like that this card allows button behaviors to be modified using service calls, but that feels like a clunky workaround to me (and it doesn't work with cards like custom:auto-entities because I cannot use the {{ entity }} name for the target of the button press service call).

Describe the solution you'd like

I think it would be more intuitive for button entities to be triggered (call the button press service on themselves) with tap_action and to show the detailed information with hold_action by default.

Alternately, if there was a shorthand way to specify in the base_config that the entity used for service calls should be the entity itself, that would be pretty easy to implement without extra boilerplate for every button.

Describe alternatives you've considered

The workaround I have is to not use a tool like custom:auto-entities and instead manually add entries for each button, including manually specifying the service call for the tap_action on the button itself. This seems like a lot of unnecessary boilerplate to me.

Additional context

My current workaround that works but feels clunky/verbose/redundant:

type: custom:paper-buttons-row
name: hello
base_config:
  name: false
buttons:
  - entity: input_button.pool_hall_receiver_power_on
    tap_action:
      action: call-service
      service: input_button.press
      target:
        entity_id: input_button.pool_hall_receiver_power_on
  - entity: input_button.pool_hall_receiver_power_off
    tap_action:
      action: call-service
      service: input_button.press
      target:
        entity_id: input_button.pool_hall_receiver_power_off
  - entity: input_button.pool_hall_receiver_mute
    tap_action:
      action: call-service
      service: input_button.press
      target:
        entity_id: input_button.pool_hall_receiver_mute
  - entity: input_button.pool_hall_receiver_volume_up
    tap_action:
      action: call-service
      service: input_button.press
      target:
        entity_id: input_button.pool_hall_receiver_volume_up
  - entity: input_button.pool_hall_receiver_volume_down
    tap_action:
      action: call-service
      service: input_button.press
      target:
        entity_id: input_button.pool_hall_receiver_volume_down

What I would like to be able to do instead:

type: custom:paper-buttons-row
name: hello
base_config:
  name: false
buttons:
  - entity: input_button.pool_hall_receiver_power_on
  - entity: input_button.pool_hall_receiver_power_off
  - entity: input_button.pool_hall_receiver_mute
  - entity: input_button.pool_hall_receiver_volume_up
  - entity: input_button.pool_hall_receiver_volume_down
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

No branches or pull requests

1 participant