mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-05 17:09:48 +00:00
Initial haptics support (#3099)
* Initial haptics support * Move window stuff into types.ts * Fire haptic events instead of expecting a messageHandler * Style fixes, linting fixes * Only allow whitelisted haptics * Make requested changes
This commit is contained in:
committed by
Paulus Schoutsen
parent
b3c1bead39
commit
f4cfbc6678
@@ -14,6 +14,7 @@ import {
|
||||
} from "lit-element";
|
||||
import { HomeAssistant } from "../../types";
|
||||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import { forwardHaptic } from "../../util/haptics";
|
||||
|
||||
const isOn = (stateObj?: HassEntity) =>
|
||||
stateObj !== undefined && !STATES_OFF.includes(stateObj.state);
|
||||
@@ -89,6 +90,7 @@ class HaEntityToggle extends LitElement {
|
||||
if (!this.hass || !this.stateObj) {
|
||||
return;
|
||||
}
|
||||
forwardHaptic(this, "light");
|
||||
const stateDomain = computeStateDomain(this.stateObj);
|
||||
let serviceDomain;
|
||||
let service;
|
||||
|
||||
Reference in New Issue
Block a user