mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add haptic support to light toggle button (#15569)
This commit is contained in:
parent
2e86d739fc
commit
f92deb3225
@ -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,
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user