Skip to content

Commit

Permalink
Fix energy selection card in grid layout
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya committed Jul 4, 2024
1 parent f30a146 commit 78296f9
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/panels/lovelace/cards/energy/hui-energy-date-selection-card.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {
html,
LitElement,
nothing,
css,
CSSResultGroup,
LitElement,
PropertyValues,
css,
html,
nothing,
} from "lit";
import { customElement, property, state } from "lit/decorators";
import { HomeAssistant } from "../../../../types";
import { hasConfigChanged } from "../../common/has-changed";
import "../../components/hui-energy-period-selector";
import { LovelaceCard } from "../../types";
import { LovelaceCard, LovelaceLayoutOptions } from "../../types";
import { EnergyCardBaseConfig } from "../types";
import { hasConfigChanged } from "../../common/has-changed";

@customElement("hui-energy-date-selection-card")
export class HuiEnergyDateSelectionCard
Expand All @@ -26,6 +26,13 @@ export class HuiEnergyDateSelectionCard
return 1;
}

public getLayoutOptions(): LovelaceLayoutOptions {
return {
grid_rows: 1,
grid_columns: 4,
};
}

public setConfig(config: EnergyCardBaseConfig): void {
this._config = config;
}
Expand Down Expand Up @@ -57,6 +64,13 @@ export class HuiEnergyDateSelectionCard

static get styles(): CSSResultGroup {
return css`
:host {
ha-card {
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
}
.padded {
padding-left: 16px !important;
padding-inline-start: 16px !important;
Expand Down

0 comments on commit 78296f9

Please sign in to comment.