mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 03:06:41 +00:00
Remove ha-state-domain-icon
This commit is contained in:
parent
03eddbde0a
commit
e550b0cec2
@ -1,22 +0,0 @@
|
|||||||
<link rel='import' href='../../../bower_components/polymer/polymer.html'>
|
|
||||||
<link rel='import' href='../../../bower_components/iron-image/iron-image.html'>
|
|
||||||
|
|
||||||
<link rel='import' href='../domain-icon.html'>
|
|
||||||
|
|
||||||
<dom-module id='ha-state-domain-icon'>
|
|
||||||
<style>
|
|
||||||
/* Color the icon if light or sun is on */
|
|
||||||
domain-icon[data-domain=light][data-state=on],
|
|
||||||
domain-icon[data-domain=switch][data-state=on],
|
|
||||||
domain-icon[data-domain=sun][data-state=above_horizon] {
|
|
||||||
color: #fff176;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<domain-icon id='icon'
|
|
||||||
domain='[[stateObj.domain]]' data-domain$='[[stateObj.domain]]'
|
|
||||||
state='[[stateObj.state]]' data-state$='[[stateObj.state]]'>
|
|
||||||
</domain-icon>
|
|
||||||
</template>
|
|
||||||
</dom-module>
|
|
@ -1,28 +0,0 @@
|
|||||||
import Polymer from '../../polymer';
|
|
||||||
|
|
||||||
require('./domain-icon');
|
|
||||||
|
|
||||||
export default new Polymer({
|
|
||||||
is: 'ha-state-domain-icon',
|
|
||||||
|
|
||||||
properties: {
|
|
||||||
stateObj: {
|
|
||||||
type: Object,
|
|
||||||
observer: 'updateIconColor',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called when an attribute changes that influences the color of the icon.
|
|
||||||
*/
|
|
||||||
updateIconColor(newVal) {
|
|
||||||
// for domain light, set color of icon to light color if available
|
|
||||||
if (newVal.domain === 'light' && newVal.state === 'on' &&
|
|
||||||
newVal.attributes.rgb_color) {
|
|
||||||
this.$.icon.style.color = 'rgb(' + newVal.attributes.rgb_color.join(',') + ')';
|
|
||||||
} else {
|
|
||||||
this.$.icon.style.color = null;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
});
|
|
Loading…
x
Reference in New Issue
Block a user