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

tap event not working as expected on light #74

Open
turboc1208 opened this issue Aug 30, 2023 · 2 comments
Open

tap event not working as expected on light #74

turboc1208 opened this issue Aug 30, 2023 · 2 comments

Comments

@turboc1208
Copy link

I have a light that I want to control. The horseshoe will show the brightness while an icon will simply turn it on or off. Clicking on the horseshoe will bring up the normal brightness/on/off control while clicking on the little fan-light icon should toggle it on or off. At least that's what I want. What's happening is that in either case, clicking just brings up the standard brightness/on/off control.
I have tried having the entity_id: light.office_light in both the service_data and in the target lists. Same results both ways. Any advice would be appreciated.

type: custom:flex-horseshoe-card
entities:
  - entity: light.office_light
    attribute: brightness
    decimals: 1
    unit: '%'
    area: Office
  - entity: light.office_light
    name: Light
    icon: mdi:ceiling-fan-light
    tap_action:
      action: call-service
      service: light.toggle
      service_data: 
      target:
        entity_id: light.office_light
        ```
@papperone
Copy link

I mainly use switches and it does work with code below:

  - entity: switch.microonde
    name: ' '
    icon: mdi:microwave
    tap_action:
      action: call-service
      service: switch.toggle
      service_data:
        entity_id: switch.microonde

@turboc1208
Copy link
Author

Try just toggle: for the tap action.

tap_action
    toggle

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

2 participants