Skip to content

Commit

Permalink
Merge pull request #25 from davet2001/clean-up-logging
Browse files Browse the repository at this point in the history
Clean up logging, unused code, reassign some logs to warning
  • Loading branch information
davet2001 authored Jan 5, 2025
2 parents dc67e89 + 9afdfaf commit a78fd73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 38 deletions.
5 changes: 2 additions & 3 deletions src/elec-sankey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
35 changes: 0 additions & 35 deletions src/power-flow-card-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

Expand All @@ -101,7 +67,6 @@ export class PowerFlowCardEditor extends LitElement implements LovelaceCardEdito
};

protected render() {
console.log("####Render####");
if (!this.hass || !this._config) {
return nothing;
}
Expand Down

0 comments on commit a78fd73

Please sign in to comment.