mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Clean up frontend
This commit is contained in:
parent
8b590a43be
commit
ff4c3f791c
@ -1,2 +1,2 @@
|
|||||||
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
||||||
VERSION = "516c0ee306fbd56fb3867e23dafdd7a6"
|
VERSION = "9d3e518a6c0516a3543fe6b364e4307b"
|
||||||
|
File diff suppressed because one or more lines are too long
@ -31,22 +31,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
Polymer({
|
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||||
|
|
||||||
|
Polymer(Polymer.mixin({
|
||||||
cbEventClicked: null,
|
cbEventClicked: null,
|
||||||
states: [],
|
states: [],
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.statesUpdated = this.statesUpdated.bind(this);
|
this.listenToStores(true);
|
||||||
window.hass.stateStore.addChangeListener(this.statesUpdated);
|
|
||||||
this.statesUpdated();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
detached: function() {
|
detached: function() {
|
||||||
window.hass.stateStore.removeChangeListener(this.statesUpdated);
|
this.stopListeningToStores();
|
||||||
},
|
},
|
||||||
|
|
||||||
statesUpdated: function() {
|
stateStoreChanged: function(stateStore) {
|
||||||
this.states = window.hass.stateStore.all();
|
this.states = stateStore.all();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleClick: function(ev) {
|
handleClick: function(ev) {
|
||||||
@ -55,6 +55,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
@ -33,22 +33,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
Polymer({
|
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||||
|
|
||||||
|
Polymer(Polymer.mixin({
|
||||||
cbEventClicked: null,
|
cbEventClicked: null,
|
||||||
events: [],
|
events: [],
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.eventsUpdated = this.eventsUpdated.bind(this);
|
this.listenToStores(true);
|
||||||
window.hass.eventStore.addChangeListener(this.eventsUpdated);
|
|
||||||
this.eventsUpdated();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
detached: function() {
|
detached: function() {
|
||||||
window.hass.eventStore.removeChangeListener(this.eventsUpdated);
|
this.stopListeningToStores();
|
||||||
},
|
},
|
||||||
|
|
||||||
eventsUpdated: function() {
|
eventStoreChanged: function(eventStore) {
|
||||||
this.events = window.hass.eventStore.all();
|
this.events = eventStore.all();
|
||||||
},
|
},
|
||||||
|
|
||||||
handleClick: function(ev) {
|
handleClick: function(ev) {
|
||||||
@ -57,6 +57,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
@ -47,26 +47,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
Polymer({
|
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||||
|
|
||||||
|
Polymer(Polymer.mixin({
|
||||||
services: [],
|
services: [],
|
||||||
cbServiceClicked: null,
|
cbServiceClicked: null,
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.servicesUpdated = this.servicesUpdated.bind(this);
|
this.listenToStores(true);
|
||||||
window.hass.serviceStore.addChangeListener(this.servicesUpdated);
|
|
||||||
this.servicesUpdated();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
detached: function() {
|
detached: function() {
|
||||||
window.hass.serviceStore.removeChangeListener(this.servicesUpdated);
|
this.stopListeningToStores();
|
||||||
},
|
},
|
||||||
|
|
||||||
getIcon: function(domain) {
|
getIcon: function(domain) {
|
||||||
return (new DomainIcon()).icon(domain);
|
return (new DomainIcon()).icon(domain);
|
||||||
},
|
},
|
||||||
|
|
||||||
servicesUpdated: function() {
|
serviceStoreChanged: function(serviceStore) {
|
||||||
this.services = window.hass.serviceStore.all();
|
this.services = serviceStore.all();
|
||||||
},
|
},
|
||||||
|
|
||||||
serviceClicked: function(ev) {
|
serviceClicked: function(ev) {
|
||||||
@ -79,6 +79,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<link rel="import" href="../cards/state-card.html">
|
<link rel="import" href="../cards/state-card.html">
|
||||||
|
|
||||||
<polymer-element name="state-cards" attributes="states">
|
<polymer-element name="state-cards" attributes="states" noscript>
|
||||||
<template>
|
<template>
|
||||||
<style>
|
<style>
|
||||||
:host {
|
:host {
|
||||||
@ -53,8 +53,4 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
|
||||||
Polymer({
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
icon: "swap-vert-circle",
|
icon: "swap-vert-circle",
|
||||||
color: 'red',
|
color: 'red',
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.listenToStores(true);
|
this.listenToStores(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -8,20 +8,13 @@
|
|||||||
<polymer-element name="more-info-dialog">
|
<polymer-element name="more-info-dialog">
|
||||||
<template>
|
<template>
|
||||||
<ha-dialog id="dialog">
|
<ha-dialog id="dialog">
|
||||||
<style>
|
|
||||||
.title-card {
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<state-card-content stateObj="{{stateObj}}" class='title-card'>
|
<state-card-content stateObj="{{stateObj}}" style='margin-bottom: 24px;'>
|
||||||
</state-card-content>
|
</state-card-content>
|
||||||
<state-timeline stateHistory="{{stateHistory}}"></state-timeline>
|
<state-timeline stateHistory="{{stateHistory}}"></state-timeline>
|
||||||
<more-info-content stateObj="{{stateObj}}"></more-info-content>
|
<more-info-content stateObj="{{stateObj}}"></more-info-content>
|
||||||
</div>
|
</div>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||||
@ -39,7 +32,7 @@ Polymer(Polymer.mixin({
|
|||||||
'stateObj.attributes': 'reposition'
|
'stateObj.attributes': 'reposition'
|
||||||
},
|
},
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.listenToStores(true);
|
this.listenToStores(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -104,7 +97,6 @@ Polymer(Polymer.mixin({
|
|||||||
this.$.dialog.toggle();
|
this.$.dialog.toggle();
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
}, storeListenerMixIn));
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 83d86a9328a79bfb73da16787d8b59862a83fa98
|
Subproject commit 6222eedb4e042fa08c2393ab465bb4e8c8afd5fd
|
@ -156,7 +156,7 @@ Polymer(Polymer.mixin({
|
|||||||
isStreaming: false,
|
isStreaming: false,
|
||||||
hasStreamError: false,
|
hasStreamError: false,
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.togglePanel = this.togglePanel.bind(this);
|
this.togglePanel = this.togglePanel.bind(this);
|
||||||
|
|
||||||
this.listenToStores(true);
|
this.listenToStores(true);
|
||||||
|
@ -71,12 +71,9 @@
|
|||||||
|
|
||||||
spinnerMessage: "",
|
spinnerMessage: "",
|
||||||
|
|
||||||
ready: function() {
|
|
||||||
this.listenToStores(true);
|
|
||||||
},
|
|
||||||
|
|
||||||
attached: function() {
|
attached: function() {
|
||||||
this.focusPassword();
|
this.focusPassword();
|
||||||
|
this.listenToStores(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
detached: function() {
|
detached: function() {
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
Polymer(Polymer.mixin({
|
Polymer(Polymer.mixin({
|
||||||
stateHistory: null,
|
stateHistory: null,
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.listenToStores(true);
|
this.listenToStores(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
isFetching: false,
|
isFetching: false,
|
||||||
isStreaming: false,
|
isStreaming: false,
|
||||||
|
|
||||||
ready: function() {
|
attached: function() {
|
||||||
this.listenToStores(true);
|
this.listenToStores(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div id='moreInfoContainer' class='{{classNames}}'></div>
|
<div id='moreInfoContainer' class='{{classNames}}'></div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@ -56,7 +55,6 @@ Polymer({
|
|||||||
this.classNames = Object.keys(newVal).map(
|
this.classNames = Object.keys(newVal).map(
|
||||||
function(key) { return "has-" + key; }).join(' ');
|
function(key) { return "has-" + key; }).join(' ');
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
@ -20,14 +20,33 @@
|
|||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
Polymer({
|
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||||
observe: {
|
var stateStore = window.hass.stateStore;
|
||||||
'stateObj.attributes.entity_id': 'updateStates'
|
|
||||||
|
Polymer(Polymer.mixin({
|
||||||
|
attached: function() {
|
||||||
|
this.listenToStores(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
detached: function() {
|
||||||
|
this.stopListeningToStores();
|
||||||
|
},
|
||||||
|
|
||||||
|
stateStoreChanged: function() {
|
||||||
|
this.updateStates();
|
||||||
|
},
|
||||||
|
|
||||||
|
stateObjChanged: function() {
|
||||||
|
this.updateStates();
|
||||||
},
|
},
|
||||||
|
|
||||||
updateStates: function() {
|
updateStates: function() {
|
||||||
this.states = window.hass.stateStore.gets(this.stateObj.attributes.entity_id);
|
if (this.stateObj && this.stateObj.attributes.entity_id) {
|
||||||
}
|
this.states = stateStore.gets(this.stateObj.attributes.entity_id);
|
||||||
});
|
} else {
|
||||||
|
this.states = [];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user