mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-14 21:06:34 +00:00
Use state as a fallback if current_position == undefined (#117)
* Use state as a fallback if current_position == undefined * Fix lint errors
This commit is contained in:
parent
f4089b6473
commit
71278d7d6b
@ -54,11 +54,17 @@ Polymer({
|
|||||||
},
|
},
|
||||||
|
|
||||||
computeIsFullyOpen: function (stateObj) {
|
computeIsFullyOpen: function (stateObj) {
|
||||||
|
if (stateObj.attributes.current_position !== undefined) {
|
||||||
return stateObj.attributes.current_position === 100;
|
return stateObj.attributes.current_position === 100;
|
||||||
|
}
|
||||||
|
return stateObj.state === 'open';
|
||||||
},
|
},
|
||||||
|
|
||||||
computeIsFullyClosed: function (stateObj) {
|
computeIsFullyClosed: function (stateObj) {
|
||||||
|
if (stateObj.attributes.current_position !== undefined) {
|
||||||
return stateObj.attributes.current_position === 0;
|
return stateObj.attributes.current_position === 0;
|
||||||
|
}
|
||||||
|
return stateObj.state === 'closed';
|
||||||
},
|
},
|
||||||
|
|
||||||
onOpenTap: function () {
|
onOpenTap: function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user