Skip to content

Commit

Permalink
fix: secondary classes
Browse files Browse the repository at this point in the history
  • Loading branch information
flixlix committed Feb 3, 2024
1 parent 166ba7b commit b4420ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/individualLeftBottomElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const individualLeftBottomElement = (
${individualSecondarySpan(hass, main, config, templatesObj, individualObj, 1, "left-bottom")}
<ha-icon id="individual-left-bottom-icon" .icon=${individualObj?.icon}></ha-icon>
${individualObj?.field?.display_zero_state !== false || (individualObj?.state || 0) > (individualObj.displayZeroTolerance ?? 0)
? html` <span class="individual-bottom individual-left-top"
? html` <span class="individual-bottom individual-left-bottom"
>${individualObj?.showDirection
? html`<ha-icon class="small" .icon=${individualObj?.invertAnimation ? "mdi:arrow-up" : "mdi:arrow-down"}></ha-icon>`
: ""}${displayState}
Expand Down
2 changes: 2 additions & 0 deletions src/components/spans/baseSecondarySpan.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { html } from "lit";
import { PowerFlowCardPlusConfig } from "../../power-flow-card-plus-config";
import { PowerFlowCardPlus } from "../../power-flow-card-plus";
import { offlineStr } from "../../type";

type BaseSecondarySpan = {
main: PowerFlowCardPlus;
Expand All @@ -12,6 +13,7 @@ type BaseSecondarySpan = {
};

export const baseSecondarySpan = ({ main, className, template, value, entityId, icon }: BaseSecondarySpan) => {
if (value && offlineStr.includes(value)) return html``;
if (value || template) {
return html`<span
class="secondary-info ${className}"
Expand Down
5 changes: 4 additions & 1 deletion src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,4 +134,7 @@ export type GridObject = {
type?: boolean | "production" | "consumption";
};
};
};
};

export type OfflineStr = "unavailable" | "unknown";
export const offlineStr = ["unavailable", "unknown"];

0 comments on commit b4420ca

Please sign in to comment.