From bf0eb798d9b0e4d6477d901329a9cfe9b63b4370 Mon Sep 17 00:00:00 2001 From: Ian Richardson Date: Sat, 27 Oct 2018 16:51:44 -0500 Subject: [PATCH] Implemented navigate function Fix linting error --- src/common/dom/handle-click.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/common/dom/handle-click.ts b/src/common/dom/handle-click.ts index 284644070a..99bd776524 100644 --- a/src/common/dom/handle-click.ts +++ b/src/common/dom/handle-click.ts @@ -1,6 +1,7 @@ import { HomeAssistant } from "../../types"; import { LovelaceElementConfig } from "../../panels/lovelace/elements/types"; import { fireEvent } from "../dom/fire_event.js"; +import { navigate } from "../../common/navigate"; import toggleEntity from "../../../src/panels/lovelace/common/entity/toggle-entity"; export const handleClick = ( @@ -24,7 +25,7 @@ export const handleClick = ( fireEvent(node, "hass-more-info", { entityId: config.entity }); break; case "navigate": - // this.navigate(config.navigation_path); // TODO wait for balloob's navigate function + navigate(node, config.navigation_path ? config.navigation_path : ""); break; case "toggle": toggleEntity(hass, config.entity); @@ -32,11 +33,10 @@ export const handleClick = ( case "call-service": { if (config.service) { const [domain, service] = config.service.split(".", 2); - const serviceData = Object.assign( - {}, - { entity_id: config.entity }, - config.service_data - ); + const serviceData = { + entity_id: config.entity, + ...config.service_data, + }; hass.callService(domain, service, serviceData); } }