Skip to content

Commit

Permalink
Add haptic feedback to handle click (#3569)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored and balloob committed Sep 3, 2019
1 parent fcd206e commit af0304b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/panels/lovelace/common/handle-click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
};

0 comments on commit af0304b

Please sign in to comment.