@@ -14449,7 +14494,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
@@ -14459,18 +14505,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-
+
diff --git a/homeassistant/components/http/www_static/polymer/home-assistant-api.html b/homeassistant/components/http/www_static/polymer/home-assistant-api.html
index 04d2fa6a8ee..4c48f9ca33f 100644
--- a/homeassistant/components/http/www_static/polymer/home-assistant-api.html
+++ b/homeassistant/components/http/www_static/polymer/home-assistant-api.html
@@ -20,7 +20,6 @@
199 && req.status < 300) {
-
- if(callback) {
- callback(JSON.parse(req.responseText))
- }
- // if we targetted an entity id, update state after 2 seconds
- if(parameters && parameters.entity_id) {
- var updateCallback;
-
- // if a string, update just that entity, otherwise update all
- if(typeof(parameters.entity_id) == "string") {
- updateCallback = function() {
- this.fetchState(parameters.entity_id);
- }
-
- } else {
- updateCallback = this.fetchStates();
+ if(req.readyState == 4) {
+ if(req.status > 199 && req.status < 300) {
+ if(onSuccess) {
+ onSuccess(JSON.parse(req.responseText));
+ }
+ } else {
+ if(onError) {
+ var data = req.responseText ? JSON.parse(req.responseText) : {};
+ onError(data);
}
-
- setTimeout(updateCallback.bind(this), 2000);
}
+
+
}
}.bind(this)
@@ -241,6 +261,7 @@
}
},
+ // show dialogs
showEditStateDialog: function(entityId) {
var state = this.getState(entityId);
diff --git a/homeassistant/components/http/www_static/polymer/home-assistant-main.html b/homeassistant/components/http/www_static/polymer/home-assistant-main.html
index 47315f7f60e..ff361341893 100644
--- a/homeassistant/components/http/www_static/polymer/home-assistant-main.html
+++ b/homeassistant/components/http/www_static/polymer/home-assistant-main.html
@@ -5,10 +5,9 @@
-
-
+
-
@@ -82,10 +80,6 @@
Polymer({
selectedTab: null,
- ready: function() {
- this.api = this.$.api;
- },
-
isCustomGroup: function(state) {
return (state.entity_id.lastIndexOf('group.') == 0 &&
!state.attributes.auto);
diff --git a/homeassistant/components/http/www_static/polymer/splash-login.html b/homeassistant/components/http/www_static/polymer/splash-login.html
index beba5b693ce..16b9adac2ed 100644
--- a/homeassistant/components/http/www_static/polymer/splash-login.html
+++ b/homeassistant/components/http/www_static/polymer/splash-login.html
@@ -1,8 +1,10 @@
-
+
+
+
+
+
@@ -31,7 +35,10 @@
-
+
diff --git a/homeassistant/components/http/www_static/polymer/state-card.html b/homeassistant/components/http/www_static/polymer/state-card.html
index 3ccd230a45d..b9d871aad95 100755
--- a/homeassistant/components/http/www_static/polymer/state-card.html
+++ b/homeassistant/components/http/www_static/polymer/state-card.html
@@ -26,6 +26,12 @@
state-badge {
float: left;
+ cursor: pointer;
+ transition: background-color .2s;
+ }
+
+ state-badge:hover {
+ background-color: #039be5;
}
.name, .state.text {
@@ -54,12 +60,14 @@
/* filling of circle when checked */
paper-toggle-button::shadow paper-radio-button::shadow #onRadio {
- background-color: #0091ea;
+ background-color: #039be5;
+ transition: background-color .2s;
}
/* line when checked */
paper-toggle-button::shadow #toggleBar[checked] {
- background-color: #0091ea;
+ background-color: #039be5;
+ transition: background-color .2s;
}
@@ -87,20 +95,26 @@
-
-
+
+
+
+
+
+
+ {{state | makeReadable}}
+
+
-
-
- {{state | makeReadable}}
-
+
+
+ Updating..
-
+
@@ -114,12 +128,15 @@
cb_turn_on: null,
cb_turn_off: null,
cb_edit: null,
+ state_unknown: false,
// computed
domain: "",
entity_id: "",
- stateChanged: function() {
+ stateChanged: function(oldVal, newVal) {
+ this.state_unknown = newVal == "";
+
if(this.$.toggleButton) {
this.$.toggleButton.checked = this.state == 'on';
}
@@ -147,6 +164,11 @@
} else {
this.turn_off();
}
+
+ var delayUnsetSate = function() {
+ this.state = "";
+ }
+ setTimeout(delayUnsetSate.bind(this), 500);
},
turn_on: function() {
diff --git a/homeassistant/components/http/www_static/polymer/states-cards.html b/homeassistant/components/http/www_static/polymer/states-cards.html
index a74ffe99379..64c4ad26582 100755
--- a/homeassistant/components/http/www_static/polymer/states-cards.html
+++ b/homeassistant/components/http/www_static/polymer/states-cards.html
@@ -65,9 +65,11 @@
},
domReady: function() {
- this.states = this.api.states
+ this.raw_states = this.api.states
this.api.addEventListener('states-updated', this.statesUpdated.bind(this))
+
+ this.refilterStates();
},
statesUpdated: function() {