Skip to content

Commit 7573393

Browse files
committed
refactor: clean up imports and improve individual check logic
1 parent 167af7e commit 7573393

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

src/power-flow-card-plus.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/* eslint-disable wc/guard-super-call */
2-
/* eslint-disable import/extensions */
3-
import { UnsubscribeFunc } from "home-assistant-js-websocket";
42
import { ActionConfig, HomeAssistant, LovelaceCardEditor } from "custom-card-helpers";
53
import { UnsubscribeFunc } from "home-assistant-js-websocket";
64
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
@@ -624,7 +622,7 @@ export class PowerFlowCardPlus extends LitElement {
624622
individual: individualObjs,
625623
})
626624
: html`<div class="spacer"></div>`}
627-
${checkHasRightIndividual(this._config, individualObjs) ? html` <div class="spacer"></div>` : html``}
625+
${checkHasRightIndividual(individualObjs) ? html` <div class="spacer"></div>` : html``}
628626
</div>
629627
${battery.has || checkHasBottomIndividual(individualObjs)
630628
? html`<div class="row">

src/ui-editor/components/individual-row-editor.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import { css, CSSResultGroup, html, LitElement } from "lit";
44
import { customElement, property, state } from "lit/decorators.js";
55
import { repeat } from "lit/directives/repeat.js";
66
import type { SortableEvent } from "sortablejs";
7-
import localize from "../../localize/localize";
8-
import { PowerFlowCardPlusConfig } from "../../power-flow-card-plus-config";
9-
import { individualSchema } from "../schema/individual";
107
import { EditSubElementEvent, EntityConfig, LovelaceRowConfig } from "../types/entity-rows";
118
import { fireEvent } from "../utils/fire_event";
129
import { sortableStyles } from "../utils/sortable_styles";
13-
import { MAX_INDIVIDUAL_ENTITIES, PowerFlowCardPlusConfig } from "@/power-flow-card-plus-config";
10+
import { loadSortable, SortableInstance } from "../utils/sortable.ondemand";
11+
import { PowerFlowCardPlusConfig } from "@/power-flow-card-plus-config";
1412
import { loadHaForm } from "@/ui-editor/utils/loadHAForm";
1513
import { individualSchema } from "@/ui-editor/schema/individual";
1614
import localize from "@/localize/localize";

src/ui-editor/schema/_schema-all.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
/* eslint-disable import/no-extraneous-dependencies */
2-
/* eslint-disable import/extensions */
31
import { mdiBatteryHigh, mdiHome, mdiLeaf, mdiTransmissionTower, mdiWeatherSunny } from "@mdi/js";
42
import { any, assign, boolean, integer, number, object, optional, string } from "superstruct";
53
import memoizeOne from "memoize-one";
6-
import { any, assign, boolean, integer, number, object, optional, string } from "superstruct";
74
import { batterySchema } from "./battery";
85
import { displayZeroLinesSchema } from "./display_zero_lines";
96
import { nonFossilSchema } from "./fossil_fuel_percentage";

0 commit comments

Comments
 (0)