From d9b5ab970a6d65bb83661c82383c296c5050cec2 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Tue, 17 Oct 2023 10:57:54 +0200 Subject: [PATCH] rename clean function --- .../dialog-dashboard-strategy-editor.ts | 4 ++-- src/panels/lovelace/strategies/get-strategy.ts | 4 ++-- src/panels/lovelace/strategies/legacy-strategy.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/panels/lovelace/strategies/device-registry-detail/dialog-dashboard-strategy-editor.ts b/src/panels/lovelace/strategies/device-registry-detail/dialog-dashboard-strategy-editor.ts index ce321a09e815..450efbb88a71 100644 --- a/src/panels/lovelace/strategies/device-registry-detail/dialog-dashboard-strategy-editor.ts +++ b/src/panels/lovelace/strategies/device-registry-detail/dialog-dashboard-strategy-editor.ts @@ -11,7 +11,7 @@ import type { HuiDashboardStrategyElementEditor } from "../../editor/dashboard-s import { ConfigChangedEvent } from "../../editor/hui-element-editor"; import { GUIModeChangedEvent } from "../../editor/types"; import type { DashboardStrategyEditorDialogParams } from "./show-dialog-dashboard-strategy-editor"; -import { cleanStrategyConfig } from "../legacy-strategy"; +import { cleanLegacyStrategyConfig } from "../legacy-strategy"; @customElement("dialog-dashboard-strategy-editor") class DialogDashboardStrategyEditor extends LitElement { @@ -76,7 +76,7 @@ class DialogDashboardStrategyEditor extends LitElement { return nothing; } - const config = cleanStrategyConfig(this._strategyConfig); + const config = cleanLegacyStrategyConfig(this._strategyConfig); return html` ( } } - const config = cleanStrategyConfig(strategyConfig); + const config = cleanLegacyStrategyConfig(strategyConfig); return await strategy.generate(config, hass); } catch (err: any) { diff --git a/src/panels/lovelace/strategies/legacy-strategy.ts b/src/panels/lovelace/strategies/legacy-strategy.ts index 2d3170c53dcc..98c786ad053f 100644 --- a/src/panels/lovelace/strategies/legacy-strategy.ts +++ b/src/panels/lovelace/strategies/legacy-strategy.ts @@ -29,7 +29,7 @@ export interface LovelaceViewStrategy { }): Promise; } -export const cleanStrategyConfig = (config: LovelaceStrategyConfig) => { +export const cleanLegacyStrategyConfig = (config: LovelaceStrategyConfig) => { if (!(Object.keys(config).length === 2 && "options" in config)) { return config; }