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

Added option to use entity icon #21

Merged
merged 2 commits into from
Oct 8, 2018
Merged

Conversation

emilp333
Copy link

@emilp333 emilp333 commented Oct 6, 2018

I wanted to have an option to defined different icons based on state but then I realized that sometimes the entity already contains the icon information as an attribute.
If you already customized the entity with your own icon it can fetch that attribute directly from the entity instead of defining it again.
In my scenario I wanted to show different icons based on my template cover state. The template cover already have a state_open and state_close icon.

So if you add icon: attribute it will look for the "icon" attribute in the entity.

I´m not familiar with javascript so the code might not be optimal but it´s working. Feel free to adjust if there is a better way.

@kuuji
Copy link
Collaborator

kuuji commented Oct 8, 2018

Awesome! Thanks for that @emilp333

I'll likely include that in the next release.

@kuuji kuuji changed the base branch from master to develop October 8, 2018 15:32
@kuuji kuuji merged commit 34b3ade into custom-cards:develop Oct 8, 2018
@kuuji kuuji mentioned this pull request Oct 16, 2018
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