mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-02 00:27:49 +01:00
Use view columns visibility condition in strategies (#51323)
This commit is contained in:
@@ -11,7 +11,7 @@ import { shouldShowFloorsAndAreas } from "./show-floors-and-areas";
|
||||
import {
|
||||
LARGE_SCREEN_CONDITION,
|
||||
SMALL_SCREEN_CONDITION,
|
||||
} from "../../lovelace/strategies/helpers/screen-conditions";
|
||||
} from "../../lovelace/strategies/helpers/view-columns-conditions";
|
||||
|
||||
@customElement("energy-view-strategy")
|
||||
export class EnergyViewStrategy extends ReactiveElement {
|
||||
|
||||
@@ -15,7 +15,7 @@ import { computeAreaTileCardConfig } from "../../lovelace/strategies/areas/helpe
|
||||
import {
|
||||
LARGE_SCREEN_CONDITION,
|
||||
SMALL_SCREEN_CONDITION,
|
||||
} from "../../lovelace/strategies/helpers/screen-conditions";
|
||||
} from "../../lovelace/strategies/helpers/view-columns-conditions";
|
||||
import type { ToggleGroupCardConfig } from "../../lovelace/cards/types";
|
||||
import type { ButtonHeadingBadgeConfig } from "../../lovelace/heading-badges/types";
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import type {
|
||||
Condition,
|
||||
ScreenCondition,
|
||||
} from "../../common/validate-condition";
|
||||
|
||||
export const LARGE_SCREEN_CONDITION: ScreenCondition = {
|
||||
condition: "screen",
|
||||
media_query: "(min-width: 871px)",
|
||||
};
|
||||
|
||||
export const SMALL_SCREEN_CONDITION: Condition = {
|
||||
condition: "not",
|
||||
conditions: [LARGE_SCREEN_CONDITION],
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { ViewColumnsCondition } from "../../common/validate-condition";
|
||||
|
||||
export const LARGE_SCREEN_CONDITION: ViewColumnsCondition = {
|
||||
condition: "view_columns",
|
||||
min: 2,
|
||||
};
|
||||
|
||||
export const SMALL_SCREEN_CONDITION: ViewColumnsCondition = {
|
||||
condition: "view_columns",
|
||||
max: 1,
|
||||
};
|
||||
@@ -30,7 +30,7 @@ import type {
|
||||
import {
|
||||
LARGE_SCREEN_CONDITION,
|
||||
SMALL_SCREEN_CONDITION,
|
||||
} from "../helpers/screen-conditions";
|
||||
} from "../helpers/view-columns-conditions";
|
||||
import type { CommonControlSectionStrategyConfig } from "../usage_prediction/common-controls-section-strategy";
|
||||
import { HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries";
|
||||
import { OTHER_DEVICES_FILTERS } from "./helpers/other-devices-filters";
|
||||
|
||||
Reference in New Issue
Block a user