mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-20 02:38:53 +00:00
* Organize files * Import EventsMixin * Import NavigateMixin * Dissolve window.hassMixins * Apply ElementMixin when we use it * Update tests to point at right dir * Eslint * Clean * Update mixins inside hassio * Update lint command" * Fix polymer lint
34 lines
705 B
JavaScript
34 lines
705 B
JavaScript
import '@polymer/iron-icon/iron-icon.js';
|
|
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
|
|
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
|
|
import domainIcon from '../common/entity/domain_icon.js';
|
|
|
|
class DomainIcon extends PolymerElement {
|
|
static get template() {
|
|
return html`
|
|
<iron-icon icon="[[computeIcon(domain, state)]]"></iron-icon>
|
|
`;
|
|
}
|
|
|
|
static get properties() {
|
|
return {
|
|
domain: {
|
|
type: String,
|
|
value: '',
|
|
},
|
|
|
|
state: {
|
|
type: String,
|
|
value: '',
|
|
},
|
|
};
|
|
}
|
|
|
|
computeIcon(domain, state) {
|
|
return domainIcon(domain, state);
|
|
}
|
|
}
|
|
|
|
customElements.define('domain-icon', DomainIcon);
|