Fix energy selection date card in grid layout (#21293)

Fix energy selection card in grid layout
This commit is contained in:
Paul Bottein 2024-07-04 21:18:50 +02:00 committed by GitHub
parent 3e4d06fca3
commit dc93a0ce54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 "../../components/hui-energy-period-selector";
import { LovelaceCard } from "../../types";
import { EnergyCardBaseConfig } from "../types";
import { hasConfigChanged } from "../../common/has-changed";
import "../../components/hui-energy-period-selector";
import { LovelaceCard, LovelaceLayoutOptions } from "../../types";
import { EnergyCardBaseConfig } from "../types";
@customElement("hui-energy-date-selection-card")
export class HuiEnergyDateSelectionCard
@ -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;
}
@ -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;