mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Add haptic feedback to handle click (#3569)
This commit is contained in:
parent
fcd206e94b
commit
af0304bf78
@ -3,6 +3,7 @@ import { fireEvent } from "../../../common/dom/fire_event";
|
|||||||
import { navigate } from "../../../common/navigate";
|
import { navigate } from "../../../common/navigate";
|
||||||
import { toggleEntity } from "../../../../src/panels/lovelace/common/entity/toggle-entity";
|
import { toggleEntity } from "../../../../src/panels/lovelace/common/entity/toggle-entity";
|
||||||
import { ActionConfig } from "../../../data/lovelace";
|
import { ActionConfig } from "../../../data/lovelace";
|
||||||
|
import { forwardHaptic } from "../../../data/haptics";
|
||||||
|
|
||||||
export const handleClick = (
|
export const handleClick = (
|
||||||
node: HTMLElement,
|
node: HTMLElement,
|
||||||
@ -49,10 +50,12 @@ export const handleClick = (
|
|||||||
break;
|
break;
|
||||||
case "call-service": {
|
case "call-service": {
|
||||||
if (!actionConfig.service) {
|
if (!actionConfig.service) {
|
||||||
|
forwardHaptic("failure");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const [domain, service] = actionConfig.service.split(".", 2);
|
const [domain, service] = actionConfig.service.split(".", 2);
|
||||||
hass.callService(domain, service, actionConfig.service_data);
|
hass.callService(domain, service, actionConfig.service_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
forwardHaptic("light");
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user