@@ -10,8 +10,7 @@ export const dashboardLinkElement = (config: PowerFlowCardPlusConfig, hass:HomeA
? html`
- ${config.dashboard_link_label ||
- hass.localize("ui.panel.lovelace.cards.energy.energy_distribution.go_to_energy_dashboard")}
+ ${config.dashboard_link_label || hass.localize("ui.panel.lovelace.cards.energy.energy_distribution.go_to_energy_dashboard")}
`
diff --git a/src/logging.ts b/src/logging.ts
index 7c9086a..f9d7fe3 100644
--- a/src/logging.ts
+++ b/src/logging.ts
@@ -3,17 +3,10 @@ import { debounce } from "custom-card-helpers";
import { version } from "../package.json";
// Log Version
-console.groupCollapsed(
- `%c⚡ Power Flow Card Plus v${version} is installed`,
- "color: #488fc2; font-weight: bold"
-);
+console.groupCollapsed(`%c⚡ Power Flow Card Plus v${version} is installed`, "color: #488fc2; font-weight: bold");
console.log("Readme:", "https://github.com/flixlix/power-flow-card-plus");
console.groupEnd();
export const logError = debounce((error: string) => {
- console.log(
- `%c⚡ Power Flow Card Plus v${version} %cError: ${error}`,
- "color: #488fc2; font-weight: bold",
- "color: #b33a3a; font-weight: normal"
- );
+ console.log(`%c⚡ Power Flow Card Plus v${version} %cError: ${error}`, "color: #488fc2; font-weight: bold", "color: #b33a3a; font-weight: normal");
}, 60000);
diff --git a/src/power-flow-card-plus-config.ts b/src/power-flow-card-plus-config.ts
index c2917a7..31a4e96 100644
--- a/src/power-flow-card-plus-config.ts
+++ b/src/power-flow-card-plus-config.ts
@@ -5,7 +5,7 @@ export type DisplayZeroLinesMode = "show" | "grey_out" | "transparency" | "hide"
export type IndividualModeConfig = {
mode: "sort_power";
-}
+};
interface mainConfigOptions {
dashboard_link?: string;
dashboard_link_label?: string;
diff --git a/src/template/ha-websocket.ts b/src/template/ha-websocket.ts
index e08bee3..de06532 100644
--- a/src/template/ha-websocket.ts
+++ b/src/template/ha-websocket.ts
@@ -1,28 +1,28 @@
import { UnsubscribeFunc } from "home-assistant-js-websocket";
interface TemplateListeners {
- all: boolean;
- domains: string[];
- entities: string[];
- time: boolean;
+ all: boolean;
+ domains: string[];
+ entities: string[];
+ time: boolean;
}
export interface RenderTemplateResult {
- result: string;
- listeners: TemplateListeners;
+ result: string;
+ listeners: TemplateListeners;
}
export const subscribeRenderTemplate = (
- conn: any,
- onChange: (result: RenderTemplateResult) => void,
- params: {
- template: string;
- entity_ids?: string | string[];
- variables?: Record
;
- timeout?: number;
- strict?: boolean;
- }
+ conn: any,
+ onChange: (result: RenderTemplateResult) => void,
+ params: {
+ template: string;
+ entity_ids?: string | string[];
+ variables?: Record;
+ timeout?: number;
+ strict?: boolean;
+ }
): Promise =>
- conn.subscribeMessage((msg: RenderTemplateResult) => onChange(msg), {
- type: "render_template",
- ...params,
- });
+ conn.subscribeMessage((msg: RenderTemplateResult) => onChange(msg), {
+ type: "render_template",
+ ...params,
+ });
diff --git a/src/type.ts b/src/type.ts
index 66b82e1..4ffc3aa 100644
--- a/src/type.ts
+++ b/src/type.ts
@@ -134,4 +134,4 @@ export type GridObject = {
type?: boolean | "production" | "consumption";
};
};
-};
\ No newline at end of file
+};
diff --git a/src/ui-editor/types/config-page.ts b/src/ui-editor/types/config-page.ts
index 0bd45ea..cb26cab 100644
--- a/src/ui-editor/types/config-page.ts
+++ b/src/ui-editor/types/config-page.ts
@@ -1,3 +1,3 @@
import { ConfigEntities } from "../../power-flow-card-plus-config";
-export type ConfigPage = keyof ConfigEntities | "advanced" | null;
\ No newline at end of file
+export type ConfigPage = keyof ConfigEntities | "advanced" | null;
diff --git a/src/ui-editor/utils/sortable.ondemand.ts b/src/ui-editor/utils/sortable.ondemand.ts
index a33f39d..be00922 100644
--- a/src/ui-editor/utils/sortable.ondemand.ts
+++ b/src/ui-editor/utils/sortable.ondemand.ts
@@ -1,9 +1,7 @@
let loaded: typeof import("./sortable").default;
export type { SortableInstance } from "./sortable";
-export const loadSortable = async (): Promise<
- typeof import("./sortable").default
-> => {
+export const loadSortable = async (): Promise => {
if (!loaded) {
loaded = (await import("./sortable")).default;
}
diff --git a/src/ui-editor/utils/sortable.ts b/src/ui-editor/utils/sortable.ts
index 32514c4..e679089 100644
--- a/src/ui-editor/utils/sortable.ts
+++ b/src/ui-editor/utils/sortable.ts
@@ -1,8 +1,5 @@
import Sortable from "sortablejs";
-import SortableCore, {
- OnSpill,
- AutoScroll,
-} from "sortablejs/modular/sortable.core.esm";
+import SortableCore, { OnSpill, AutoScroll } from "sortablejs/modular/sortable.core.esm";
SortableCore.mount(OnSpill, new AutoScroll());
diff --git a/src/utils/computeIndividualPosition.ts b/src/utils/computeIndividualPosition.ts
index 650cc72..1106752 100644
--- a/src/utils/computeIndividualPosition.ts
+++ b/src/utils/computeIndividualPosition.ts
@@ -60,4 +60,4 @@ export const checkHasRightIndividual = (config: PowerFlowCardPlusConfig, individ
!!getTopRightIndividual(config, individualObjs) || !!getBottomRightIndividual(config, individualObjs);
export const checkHasBottomIndividual = (config: PowerFlowCardPlusConfig, individualObjs: IndividualObject[]): boolean =>
- !!getBottomLeftIndividual(config, individualObjs) || !!getBottomRightIndividual(config, individualObjs);
\ No newline at end of file
+ !!getBottomLeftIndividual(config, individualObjs) || !!getBottomRightIndividual(config, individualObjs);
diff --git a/src/utils/get-default-config.ts b/src/utils/get-default-config.ts
index e5c8322..17828d4 100644
--- a/src/utils/get-default-config.ts
+++ b/src/utils/get-default-config.ts
@@ -16,7 +16,7 @@ export const defaultValues = {
transparency: 50,
grey_color: [189, 189, 189],
},
-}
+};
export function getDefaultConfig(hass: HomeAssistant): object {
function checkStrings(entiyId: string, testStrings: string[]): boolean {
diff --git a/src/utils/register-custom-card.ts b/src/utils/register-custom-card.ts
index e80507f..b8d4758 100644
--- a/src/utils/register-custom-card.ts
+++ b/src/utils/register-custom-card.ts
@@ -1,17 +1,17 @@
interface RegisterCardParams {
- type: string;
- name: string;
- description: string;
+ type: string;
+ name: string;
+ description: string;
}
export function registerCustomCard(params: RegisterCardParams) {
- const windowWithCards = window as unknown as Window & {
- customCards: unknown[];
- };
- windowWithCards.customCards = windowWithCards.customCards || [];
+ const windowWithCards = window as unknown as Window & {
+ customCards: unknown[];
+ };
+ windowWithCards.customCards = windowWithCards.customCards || [];
- windowWithCards.customCards.push({
- ...params,
- preview: true,
- documentationURL: `https://github.com/flixlix/power-flow-card-plus`,
- });
+ windowWithCards.customCards.push({
+ ...params,
+ preview: true,
+ documentationURL: `https://github.com/flixlix/power-flow-card-plus`,
+ });
}
diff --git a/src/utils/utils.ts b/src/utils/utils.ts
index 5758e6f..9b4cbcf 100644
--- a/src/utils/utils.ts
+++ b/src/utils/utils.ts
@@ -1,8 +1,5 @@
/* eslint-disable no-redeclare */
-export const round = (value: number, decimalPlaces: number): number =>
- Number(
- `${Math.round(Number(`${value}e${decimalPlaces}`))}e-${decimalPlaces}`
- );
+export const round = (value: number, decimalPlaces: number): number => Number(`${Math.round(Number(`${value}e${decimalPlaces}`))}e-${decimalPlaces}`);
/**
* @license
@@ -25,16 +22,11 @@ export function coerceNumber(value: any, fallbackValue = 0) {
return isNumberValue(value) ? Number(value) : fallbackValue;
}
-export function coerceStringArray(
- value: any,
- separator: string | RegExp = /\s+/
-): string[] {
+export function coerceStringArray(value: any, separator: string | RegExp = /\s+/): string[] {
const result: string[] = [];
if (value != null) {
- const sourceValues = Array.isArray(value)
- ? value
- : `${value}`.split(separator);
+ const sourceValues = Array.isArray(value) ? value : `${value}`.split(separator);
for (const sourceValue of sourceValues) {
const trimmedString = `${sourceValue}`.trim();
if (trimmedString) {