Isolate hass state from base el (#3157)

This commit is contained in:
Paulus Schoutsen
2019-05-03 20:26:01 -07:00
committed by GitHub
parent 8729410dce
commit fcdb1b48a2
24 changed files with 274 additions and 268 deletions

View File

@@ -14,7 +14,7 @@ import {
} from "lit-element";
import { HomeAssistant } from "../../types";
import { HassEntity } from "home-assistant-js-websocket";
import { forwardHaptic } from "../../util/haptics";
import { forwardHaptic } from "../../data/haptics";
const isOn = (stateObj?: HassEntity) =>
stateObj !== undefined && !STATES_OFF.includes(stateObj.state);
@@ -90,7 +90,7 @@ class HaEntityToggle extends LitElement {
if (!this.hass || !this.stateObj) {
return;
}
forwardHaptic(this, "light");
forwardHaptic("light");
const stateDomain = computeStateDomain(this.stateObj);
let serviceDomain;
let service;