Add haptic feedback to handle click (#3569)

This commit is contained in:
Bram Kragten 2019-09-03 06:18:47 +02:00 committed by Paulus Schoutsen
parent fcd206e94b
commit af0304bf78

View File

@ -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");
};