Skip to content

add actions to state-badge element and state-label-badge (default Lovelace badge type)#4028

Merged
iantrich merged 2 commits into
home-assistant:devfrom
iantrich:state-badge-actions
Oct 21, 2019
Merged

add actions to state-badge element and state-label-badge (default Lovelace badge type)#4028
iantrich merged 2 commits into
home-assistant:devfrom
iantrich:state-badge-actions

Conversation

@iantrich
Copy link
Copy Markdown
Member

@iantrich iantrich commented Oct 16, 2019

@iantrich
Copy link
Copy Markdown
Member Author

will wait for home-assistant/home-assistant.io#10834 to be merged before adding docs

Comment thread src/components/entity/ha-state-label-badge.ts Outdated
Comment thread src/components/entity/ha-state-label-badge.ts Outdated
Comment thread src/panels/lovelace/elements/hui-state-badge-element.ts Outdated
@bramkragten
Copy link
Copy Markdown
Member

How many places use HaStateLabelBadge? Rather have 1 logic instead of 2, either have them all handle the clicks themselves or have HaStateLabelBadge deal with it.

@iantrich
Copy link
Copy Markdown
Member Author

How many places use HaStateLabelBadge? Rather have 1 logic instead of 2, either have them all handle the clicks themselves or have HaStateLabelBadge deal with it.

Agreed

state-label-badge no longer handles clicks
added actions to hui-state-label-badge
moved ha-badges-card to Lit
@iantrich
Copy link
Copy Markdown
Member Author

Went with a different approach and as suggested have the parent handling click events. I realized 3/4 the way through moving ha-badges-card to Lit that it was part of States, 🤷‍♂️

In doing this I also decided to add actions to badges 🎉

@iantrich iantrich changed the title add actions to state-badge element add actions to state-badge element and state-label-badge (default Lovelace badge type) Oct 18, 2019
@iantrich iantrich requested a review from bramkragten October 21, 2019 18:32
@iantrich iantrich merged commit c25a38b into home-assistant:dev Oct 21, 2019
@bramkragten bramkragten mentioned this pull request Oct 23, 2019
@iantrich iantrich deleted the state-badge-actions branch October 30, 2019 03:19
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants