mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 20:36:35 +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) {
|
||||
return stateObj.attributes.current_position === 100;
|
||||
if (stateObj.attributes.current_position !== undefined) {
|
||||
return stateObj.attributes.current_position === 100;
|
||||
}
|
||||
return stateObj.state === 'open';
|
||||
},
|
||||
|
||||
computeIsFullyClosed: function (stateObj) {
|
||||
return stateObj.attributes.current_position === 0;
|
||||
if (stateObj.attributes.current_position !== undefined) {
|
||||
return stateObj.attributes.current_position === 0;
|
||||
}
|
||||
return stateObj.state === 'closed';
|
||||
},
|
||||
|
||||
onOpenTap: function () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user