mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 05:47:20 +00:00
Implemented navigate function
Fix linting error
This commit is contained in:
parent
8afc3812b7
commit
bf0eb798d9
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user