From af0304bf785640712f3b7d0eb47249285849ad40 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Tue, 3 Sep 2019 06:18:47 +0200 Subject: [PATCH] Add haptic feedback to handle click (#3569) --- src/panels/lovelace/common/handle-click.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/panels/lovelace/common/handle-click.ts b/src/panels/lovelace/common/handle-click.ts index 5ee86f965f..001ceb6d50 100644 --- a/src/panels/lovelace/common/handle-click.ts +++ b/src/panels/lovelace/common/handle-click.ts @@ -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"); };