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

Add shortcuts icon toggle #597

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

gtxaspec
Copy link

@gtxaspec gtxaspec commented Nov 1, 2023

Add toggledIcon capability:

- name: Record
  icon: mdi:record-circle-outline
  toggledIcon: mdi:lightbulb-outline
  isToggled: false
  entity: binary_sensor.example
  service: switch.toggle
  service_data:
    entity_id: switch.camera_record

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 1, 2023

I don't think this is good idea because we don't know start state. Service may be toggle from different start state and icon will be wrong.

@gtxaspec
Copy link
Author

gtxaspec commented Nov 1, 2023

@AlexxIT
the user can set the start state:
isToggled: false or isToggled: true

I think it is an intermediary solution for now to enhance the UI... We could try to figure out how to query state and update the icon dynamically?

@gtxaspec
Copy link
Author

gtxaspec commented Nov 1, 2023

@AlexxIT I added support for entity: binary_sensor.example, and i tested reading the state, it works well.

@gtxaspec gtxaspec force-pushed the toggle-icon branch 3 times, most recently from 4ab44e7 to 6d10d63 Compare November 1, 2023 17:31
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.

None yet

2 participants