Minor cleanup

pull/12/head
Paulus Schoutsen 2014-11-19 23:42:57 -08:00
parent cc4c557e89
commit 66f8daded1
6 changed files with 18 additions and 25 deletions

View File

@ -111,7 +111,9 @@ def setup(hass, config):
# Setup chromecast
hass.states.set("chromecast.Living_Rm", "Netflix",
{'friendly_name': 'Living Room'})
{'friendly_name': 'Living Room',
ATTR_ENTITY_PICTURE:
'http://graph.facebook.com/KillBillMovie/picture'})
# Setup tellstick sensors
hass.states.set("tellstick_sensor.Outside_temperature", "15.6",

View File

@ -1,2 +1,2 @@
""" DO NOT MODIFY. Auto-generated by build_frontend script """
VERSION = "3bb3a304afd8d825c83570bd91b634f0"
VERSION = "12ba7bca8ad0c196cb04ada4fe85a76b"

File diff suppressed because one or more lines are too long

View File

@ -43,7 +43,7 @@
}
paper-menu-button {
margin-top: 5px;
margin-top: 5px !important;
}
paper-dropdown {

View File

@ -81,7 +81,7 @@
<div class="time-ago">
<core-tooltip label="{{stateObj.last_changed}}" position="bottom">
{{lastChangedFromNow}}
{{lastChangedFromNow(stateObj.last_changed)}}
</core-tooltip>
</div>
@ -109,7 +109,6 @@
</template>
<script>
Polymer({
// attributes
stateObj: {},
cb_turn_on: null,
@ -118,16 +117,12 @@
stateUnknown: false,
toggleChecked: -1,
computed: {
lastChangedFromNow: "stateObj.last_changed | parseLastChangedFromNow",
},
observe: {
'stateObj.state': 'stateChanged'
},
parseLastChangedFromNow: function(lastChanged) {
return moment(lastChanged, "HH:mm:ss DD-MM-YYYY").fromNow()
lastChangedFromNow: function(lastChanged) {
return moment(lastChanged, "HH:mm:ss DD-MM-YYYY").fromNow();
},
toggleCheckedChanged: function(oldVal, newVal) {
@ -144,8 +139,8 @@
},
stateChanged: function(oldVal, newVal) {
this.stateUnknown = newVal == null;
this.toggleChecked = newVal == "on"
this.stateUnknown = newVal === null;
this.toggleChecked = newVal === "on";
},
turn_on: function() {
@ -155,7 +150,7 @@
// unset state while we wait for an update
var delayUnsetSate = function() {
this.stateObj.state = null;
}
};
setTimeout(delayUnsetSate.bind(this), 500);
}
},
@ -167,7 +162,7 @@
// unset state while we wait for an update
var delayUnsetSate = function() {
this.stateObj.state = null;
}
};
setTimeout(delayUnsetSate.bind(this), 500);
}
},

View File

@ -41,7 +41,7 @@
</style>
<div horizontal layout wrap>
<template repeat="{{state in states}}">
<template repeat="{{state in getStates(api.states, filter)}}">
<state-card
stateObj="{{state}}"
cb_turn_on="{{api.turn_on}}"
@ -56,10 +56,6 @@
Polymer({
filter: null,
computed: {
states: "getStates(api.states, filter)"
},
getStates: function(states, filter) {
if(!states) {
return [];