Remove HA instance singleton

This commit is contained in:
Paulus Schoutsen
2016-05-28 01:32:39 -07:00
parent fcb0aa5fb9
commit 4f8e2d5687
67 changed files with 444 additions and 476 deletions

View File

@@ -1,14 +1,15 @@
import Polymer from '../../polymer';
import hass from '../../util/home-assistant-js-instance';
import OFF_STATES from '../../util/off-states';
const { serviceActions } = hass;
export default new Polymer({
is: 'ha-entity-toggle',
properties: {
hass: {
type: Object,
},
stateObj: {
type: Object,
},
@@ -89,7 +90,7 @@ export default new Polymer({
service = turnOn ? 'turn_on' : 'turn_off';
}
const call = serviceActions.callService(
const call = this.hass.serviceActions.callService(
domain, service, { entity_id: this.stateObj.entityId });
if (!this.stateObj.attributes.assumed_state) {