mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +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 { toggleEntity } from "../../../../src/panels/lovelace/common/entity/toggle-entity";
|
||||
import { ActionConfig } from "../../../data/lovelace";
|
||||
import { forwardHaptic } from "../../../data/haptics";
|
||||
|
||||
export const handleClick = (
|
||||
node: HTMLElement,
|
||||
@ -49,10 +50,12 @@ export const handleClick = (
|
||||
break;
|
||||
case "call-service": {
|
||||
if (!actionConfig.service) {
|
||||
forwardHaptic("failure");
|
||||
return;
|
||||
}
|
||||
const [domain, service] = actionConfig.service.split(".", 2);
|
||||
hass.callService(domain, service, actionConfig.service_data);
|
||||
}
|
||||
}
|
||||
forwardHaptic("light");
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user