From 71278d7d6b0e1a680b6336615fb6f4b5775f6d6c Mon Sep 17 00:00:00 2001 From: Ben Origas Date: Wed, 5 Oct 2016 01:12:40 -0500 Subject: [PATCH] Use state as a fallback if current_position == undefined (#117) * Use state as a fallback if current_position == undefined * Fix lint errors --- src/state-summary/state-card-cover.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/state-summary/state-card-cover.html b/src/state-summary/state-card-cover.html index 9a90c9f156..dc0e4886e3 100644 --- a/src/state-summary/state-card-cover.html +++ b/src/state-summary/state-card-cover.html @@ -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 () {