From 9afdfaf99ea4fe5da923a3415fba69eee35c2a76 Mon Sep 17 00:00:00 2001 From: Dave T <17680170+davet2001@users.noreply.github.com> Date: Sun, 5 Jan 2025 20:29:31 +0000 Subject: [PATCH] Clean up logging, unused code, reassigned some to warning --- src/elec-sankey.ts | 5 ++--- src/power-flow-card-editor.ts | 35 ----------------------------------- 2 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/elec-sankey.ts b/src/elec-sankey.ts index 8dda737..c2fad8f 100644 --- a/src/elec-sankey.ts +++ b/src/elec-sankey.ts @@ -109,7 +109,7 @@ function line_intersect(x1, y1, x2, y2, x3, y3, x4, y4) { const denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1); if (denom === 0) { // eslint-disable-next-line no-console - console.log("Warning: Lines do not intersect."); + console.warn("Warning: Lines do not intersect."); return null; } const ua = ((x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3)) / denom; @@ -203,7 +203,7 @@ function renderFlowByCorners( ); if (ret1 == null || ret2 == null || ret3 == null || ret4 == null) { // eslint-disable-next-line no-console - console.log("Warning: render flow failed."); + console.warn("Warning: render flow failed."); return svg``; } const [bezierStartLX, bezierStartLY, ,] = ret1; @@ -427,7 +427,6 @@ export class ElecSankey extends LitElement { const widest_trunk = Math.max(genTotal, gridInTotal, consumerTotal, 1.0); this._rateToWidthMultplier = TARGET_SCALED_TRUNK_WIDTH / widest_trunk; - console.log("NEW Rate to width multiplier: " + this._rateToWidthMultplier); } private _generationToConsumers(): number { diff --git a/src/power-flow-card-editor.ts b/src/power-flow-card-editor.ts index be56cb4..4727537 100644 --- a/src/power-flow-card-editor.ts +++ b/src/power-flow-card-editor.ts @@ -37,32 +37,6 @@ const schema = [ } }, // { name: "group_small", selector: { boolean: {} } }, - // { - // type: "grid", - // name: "", - // schema: [ - // { - // name: "icon", - // selector: { icon: {} }, - // context: { icon_entity: "entity" }, - // }, - // { name: "icon_color", selector: { mush_color: {} } }, - // ], - // }, - // ...APPEARANCE_FORM_SCHEMA, - // { - // name: "display_mode", - // selector: { - // select: { - // options: ["default", ...DISPLAY_MODES].map((control) => ({ - // value: control, - // label: localize(`editor.card.number.display_mode_list.${control}`), - // })), - // mode: "dropdown", - // }, - // }, - // }, - // ...computeActionsFormSchema(), ]; @customElement(POWER_CARD_EDITOR_NAME) @@ -78,14 +52,6 @@ export class PowerFlowCardEditor extends LitElement implements LovelaceCardEdito public setConfig(config: PowerFlowCardConfig): void { this._config = config; - // config.consumer_entities?.forEach(element => { - // const entityConfig: EntityConfig = { - // entity: element, - // name: "placeholder name1" - // } - // this._configConsumerEntities.push(entityConfig); - // console.log("element: ", element); - // }); this._configConsumerEntities = processEditorEntities(config.consumer_entities); } @@ -101,7 +67,6 @@ export class PowerFlowCardEditor extends LitElement implements LovelaceCardEdito }; protected render() { - console.log("####Render####"); if (!this.hass || !this._config) { return nothing; }