mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
lights will now show as on after being turned on
This commit is contained in:
parent
68f8fd290a
commit
7db8bc6423
@ -1,2 +1,2 @@
|
|||||||
""" DO NOT MODIFY. Auto-generated by build_polymer script """
|
""" DO NOT MODIFY. Auto-generated by build_polymer script """
|
||||||
VERSION = "e40dd5a3de19a9351e55be788b5bb526"
|
VERSION = "58011acca6d6fb5ec54edf5714b8c476"
|
||||||
|
@ -10300,7 +10300,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||||||
<template if="{{!state_unknown}}">
|
<template if="{{!state_unknown}}">
|
||||||
<template if="{{state == 'on' || state == 'off'}}">
|
<template if="{{state == 'on' || state == 'off'}}">
|
||||||
<div class="state toggle" self-center="" flex="">
|
<div class="state toggle" self-center="" flex="">
|
||||||
<paper-toggle-button id="toggleButton" on-change="{{toggle}}">
|
<paper-toggle-button checked="{{toggleChecked}}">
|
||||||
</paper-toggle-button>
|
</paper-toggle-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -10329,17 +10329,28 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||||||
cb_turn_off: null,
|
cb_turn_off: null,
|
||||||
cb_edit: null,
|
cb_edit: null,
|
||||||
state_unknown: false,
|
state_unknown: false,
|
||||||
|
toggleChecked: -1,
|
||||||
|
|
||||||
// computed
|
// computed
|
||||||
domain: "",
|
domain: "",
|
||||||
entity_id: "",
|
entity_id: "",
|
||||||
|
|
||||||
|
toggleCheckedChanged: function(oldVal, newVal) {
|
||||||
|
// to filter out init
|
||||||
|
if(oldVal === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newVal && this.state == "off") {
|
||||||
|
this.turn_on();
|
||||||
|
} else if(!newVal && this.state == "on") {
|
||||||
|
this.turn_off();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
stateChanged: function(oldVal, newVal) {
|
stateChanged: function(oldVal, newVal) {
|
||||||
this.state_unknown = newVal == null;
|
this.state_unknown = newVal == null;
|
||||||
|
this.toggleChecked = newVal == "on"
|
||||||
if(this.$.toggleButton) {
|
|
||||||
this.$.toggleButton.checked = this.state == 'on';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
entityChanged: function(oldVal, newVal) {
|
entityChanged: function(oldVal, newVal) {
|
||||||
@ -10358,29 +10369,27 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||||||
this.last_changed_from_now = moment(this.last_changed, "HH:mm:ss DD-MM-YYYY").fromNow()
|
this.last_changed_from_now = moment(this.last_changed, "HH:mm:ss DD-MM-YYYY").fromNow()
|
||||||
},
|
},
|
||||||
|
|
||||||
toggle: function(ev) {
|
|
||||||
if(this.state == "off") {
|
|
||||||
this.turn_on();
|
|
||||||
} else {
|
|
||||||
this.turn_off();
|
|
||||||
}
|
|
||||||
|
|
||||||
// unset state while we wait for an update
|
|
||||||
var delayUnsetSate = function() {
|
|
||||||
this.state = null;
|
|
||||||
}
|
|
||||||
setTimeout(delayUnsetSate.bind(this), 500);
|
|
||||||
},
|
|
||||||
|
|
||||||
turn_on: function() {
|
turn_on: function() {
|
||||||
if(this.cb_turn_on) {
|
if(this.cb_turn_on) {
|
||||||
this.cb_turn_on(this.entity);
|
this.cb_turn_on(this.entity);
|
||||||
|
|
||||||
|
// unset state while we wait for an update
|
||||||
|
var delayUnsetSate = function() {
|
||||||
|
this.state = null;
|
||||||
|
}
|
||||||
|
setTimeout(delayUnsetSate.bind(this), 500);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
turn_off: function() {
|
turn_off: function() {
|
||||||
if(this.cb_turn_off) {
|
if(this.cb_turn_off) {
|
||||||
this.cb_turn_off(this.entity);
|
this.cb_turn_off(this.entity);
|
||||||
|
|
||||||
|
// unset state while we wait for an update
|
||||||
|
var delayUnsetSate = function() {
|
||||||
|
this.state = null;
|
||||||
|
}
|
||||||
|
setTimeout(delayUnsetSate.bind(this), 500);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -10440,7 +10449,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||||||
raw_states: [],
|
raw_states: [],
|
||||||
states: [],
|
states: [],
|
||||||
filter: null,
|
filter: null,
|
||||||
filter_state: null,
|
|
||||||
filter_substates: null,
|
filter_substates: null,
|
||||||
|
|
||||||
filterChanged: function(oldVal, newVal) {
|
filterChanged: function(oldVal, newVal) {
|
||||||
|
@ -98,9 +98,7 @@
|
|||||||
<template if="{{!state_unknown}}">
|
<template if="{{!state_unknown}}">
|
||||||
<template if="{{state == 'on' || state == 'off'}}">
|
<template if="{{state == 'on' || state == 'off'}}">
|
||||||
<div class='state toggle' self-center flex>
|
<div class='state toggle' self-center flex>
|
||||||
<paper-toggle-button
|
<paper-toggle-button checked="{{toggleChecked}}">
|
||||||
id="toggleButton"
|
|
||||||
on-change="{{toggle}}">
|
|
||||||
</paper-toggle-button>
|
</paper-toggle-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -129,17 +127,28 @@
|
|||||||
cb_turn_off: null,
|
cb_turn_off: null,
|
||||||
cb_edit: null,
|
cb_edit: null,
|
||||||
state_unknown: false,
|
state_unknown: false,
|
||||||
|
toggleChecked: -1,
|
||||||
|
|
||||||
// computed
|
// computed
|
||||||
domain: "",
|
domain: "",
|
||||||
entity_id: "",
|
entity_id: "",
|
||||||
|
|
||||||
|
toggleCheckedChanged: function(oldVal, newVal) {
|
||||||
|
// to filter out init
|
||||||
|
if(oldVal === -1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(newVal && this.state == "off") {
|
||||||
|
this.turn_on();
|
||||||
|
} else if(!newVal && this.state == "on") {
|
||||||
|
this.turn_off();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
stateChanged: function(oldVal, newVal) {
|
stateChanged: function(oldVal, newVal) {
|
||||||
this.state_unknown = newVal == null;
|
this.state_unknown = newVal == null;
|
||||||
|
this.toggleChecked = newVal == "on"
|
||||||
if(this.$.toggleButton) {
|
|
||||||
this.$.toggleButton.checked = this.state == 'on';
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
entityChanged: function(oldVal, newVal) {
|
entityChanged: function(oldVal, newVal) {
|
||||||
@ -158,29 +167,27 @@
|
|||||||
this.last_changed_from_now = moment(this.last_changed, "HH:mm:ss DD-MM-YYYY").fromNow()
|
this.last_changed_from_now = moment(this.last_changed, "HH:mm:ss DD-MM-YYYY").fromNow()
|
||||||
},
|
},
|
||||||
|
|
||||||
toggle: function(ev) {
|
|
||||||
if(this.state == "off") {
|
|
||||||
this.turn_on();
|
|
||||||
} else {
|
|
||||||
this.turn_off();
|
|
||||||
}
|
|
||||||
|
|
||||||
// unset state while we wait for an update
|
|
||||||
var delayUnsetSate = function() {
|
|
||||||
this.state = null;
|
|
||||||
}
|
|
||||||
setTimeout(delayUnsetSate.bind(this), 500);
|
|
||||||
},
|
|
||||||
|
|
||||||
turn_on: function() {
|
turn_on: function() {
|
||||||
if(this.cb_turn_on) {
|
if(this.cb_turn_on) {
|
||||||
this.cb_turn_on(this.entity);
|
this.cb_turn_on(this.entity);
|
||||||
|
|
||||||
|
// unset state while we wait for an update
|
||||||
|
var delayUnsetSate = function() {
|
||||||
|
this.state = null;
|
||||||
|
}
|
||||||
|
setTimeout(delayUnsetSate.bind(this), 500);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
turn_off: function() {
|
turn_off: function() {
|
||||||
if(this.cb_turn_off) {
|
if(this.cb_turn_off) {
|
||||||
this.cb_turn_off(this.entity);
|
this.cb_turn_off(this.entity);
|
||||||
|
|
||||||
|
// unset state while we wait for an update
|
||||||
|
var delayUnsetSate = function() {
|
||||||
|
this.state = null;
|
||||||
|
}
|
||||||
|
setTimeout(delayUnsetSate.bind(this), 500);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -41,7 +41,6 @@
|
|||||||
raw_states: [],
|
raw_states: [],
|
||||||
states: [],
|
states: [],
|
||||||
filter: null,
|
filter: null,
|
||||||
filter_state: null,
|
|
||||||
filter_substates: null,
|
filter_substates: null,
|
||||||
|
|
||||||
filterChanged: function(oldVal, newVal) {
|
filterChanged: function(oldVal, newVal) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user