1
mirror of https://github.com/home-assistant/frontend synced 2024-09-22 18:30:59 +02:00

Add haptic support to light toggle button (#15569)

This commit is contained in:
Paul Bottein 2023-02-23 16:20:22 +01:00 committed by GitHub
parent 2e86d739fc
commit f92deb3225
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ import "../../../components/ha-attributes";
import "../../../components/ha-button-menu";
import "../../../components/ha-select";
import { UNAVAILABLE } from "../../../data/entity";
import { forwardHaptic } from "../../../data/haptics";
import {
LightColorMode,
LightEntity,
@ -197,6 +198,7 @@ class MoreInfoLight extends LitElement {
private _toggle = () => {
const service = this.stateObj?.state === "on" ? "turn_off" : "turn_on";
forwardHaptic("light");
this.hass.callService("light", service, {
entity_id: this.stateObj!.entity_id,
});