Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
exetico committed Jan 2, 2024
2 parents 7a0b1f1 + 28fd7dd commit f3ce711
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 7 deletions.
4 changes: 2 additions & 2 deletions dist/floorplan-examples.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/floorplan.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_docs/floorplan/floorplan-examples.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ha-floorplan",
"version": "1.0.40",
"version": "1.0.41",
"description": "Floorplan for Home Assistant",
"homepage": "https://experiencelovelace.github.io/ha-floorplan",
"keywords": [
Expand Down
8 changes: 7 additions & 1 deletion src/components/floorplan/floorplan-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,13 @@ export class FloorplanElement extends LitElement {
`Performing action: ${actionConfig.action} ${actionConfig.navigation_path}`
);
} else {
navigate(this, actionConfig.navigation_path);
// Evaluate the navigation path
const navigationPath = this.evaluate(
actionConfig.navigation_path,
entityId,
svgElementInfo?.svgElement
) as string;
navigate(this, navigationPath, actionConfig.navigation_replace ?? false);
}
break;

Expand Down
1 change: 1 addition & 0 deletions src/lib/homeassistant/data/lovelace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export interface CallServiceActionConfig extends BaseActionConfig {
export interface NavigateActionConfig extends BaseActionConfig {
action: 'navigate';
navigation_path: string;
navigation_replace?: boolean;
}

export interface UrlActionConfig extends BaseActionConfig {
Expand Down
1 change: 1 addition & 0 deletions src/lib/homeassistant/lovelace/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export interface CallServiceActionConfig extends BaseActionConfig {
export interface NavigateActionConfig extends BaseActionConfig {
action: 'navigate';
navigation_path: string;
navigation_replace?: boolean;
}

export interface UrlActionConfig extends BaseActionConfig {
Expand Down
1 change: 1 addition & 0 deletions src/lib/homeassistant/panels/lovelace/editor/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export interface EditSubElementEvent {
export const actionConfigStruct = object({
action: string(),
navigation_path: optional(string()),
navigation_replace: optional(boolean()),
url_path: optional(string()),
service: optional(string()),
service_data: optional(object()),
Expand Down

0 comments on commit f3ce711

Please sign in to comment.