mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Create covers section in area strategy dashboard (#25073)
* Move cover domain and garage, door, window binary sensor to opening section in area strategy * Rename to cover and add input boolean and select
This commit is contained in:
parent
e23d2392d8
commit
3d130b790c
@ -76,7 +76,7 @@ export class AreaViewStrategy extends ReactiveElement {
|
||||
|
||||
const computeTileCard = computeAreaTileCardConfig(hass, area.name, true);
|
||||
|
||||
const { lights, climate, media_players, security, others } =
|
||||
const { lights, climate, covers, media_players, security, others } =
|
||||
groupedEntities;
|
||||
|
||||
if (lights.length > 0) {
|
||||
@ -92,6 +92,19 @@ export class AreaViewStrategy extends ReactiveElement {
|
||||
});
|
||||
}
|
||||
|
||||
if (covers.length > 0) {
|
||||
sections.push({
|
||||
type: "grid",
|
||||
cards: [
|
||||
computeHeadingCard(
|
||||
hass.localize("ui.panel.lovelace.strategy.areas.groups.covers"),
|
||||
AREA_STRATEGY_GROUP_ICONS.covers
|
||||
),
|
||||
...covers.map(computeTileCard),
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
if (climate.length > 0) {
|
||||
sections.push({
|
||||
type: "grid",
|
||||
|
@ -19,6 +19,7 @@ import type { TileCardConfig } from "../../../cards/types";
|
||||
export const AREA_STRATEGY_GROUPS = [
|
||||
"lights",
|
||||
"climate",
|
||||
"covers",
|
||||
"media_players",
|
||||
"security",
|
||||
"others",
|
||||
@ -27,6 +28,7 @@ export const AREA_STRATEGY_GROUPS = [
|
||||
export const AREA_STRATEGY_GROUP_ICONS = {
|
||||
lights: "mdi:lamps",
|
||||
climate: "mdi:home-thermometer",
|
||||
covers: "mdi:blinds-horizontal",
|
||||
media_players: "mdi:multimedia",
|
||||
security: "mdi:security",
|
||||
others: "mdi:shape",
|
||||
@ -60,22 +62,20 @@ export const getAreaGroupedEntities = (
|
||||
entity_category: "none",
|
||||
}),
|
||||
],
|
||||
climate: [
|
||||
covers: [
|
||||
generateEntityFilter(hass, {
|
||||
domain: "cover",
|
||||
area: area,
|
||||
device_class: [
|
||||
"shutter",
|
||||
"awning",
|
||||
"blind",
|
||||
"curtain",
|
||||
"shade",
|
||||
"shutter",
|
||||
"window",
|
||||
"none",
|
||||
],
|
||||
entity_category: "none",
|
||||
}),
|
||||
generateEntityFilter(hass, {
|
||||
domain: "binary_sensor",
|
||||
area: area,
|
||||
device_class: ["door", "garage_door", "window"],
|
||||
entity_category: "none",
|
||||
}),
|
||||
],
|
||||
climate: [
|
||||
generateEntityFilter(hass, {
|
||||
domain: "climate",
|
||||
area: area,
|
||||
@ -96,12 +96,6 @@ export const getAreaGroupedEntities = (
|
||||
area: area,
|
||||
entity_category: "none",
|
||||
}),
|
||||
generateEntityFilter(hass, {
|
||||
domain: "binary_sensor",
|
||||
area: area,
|
||||
device_class: "window",
|
||||
entity_category: "none",
|
||||
}),
|
||||
],
|
||||
media_players: [
|
||||
generateEntityFilter(hass, {
|
||||
@ -121,23 +115,11 @@ export const getAreaGroupedEntities = (
|
||||
area: area,
|
||||
entity_category: "none",
|
||||
}),
|
||||
generateEntityFilter(hass, {
|
||||
domain: "cover",
|
||||
device_class: ["door", "garage", "gate"],
|
||||
area: area,
|
||||
entity_category: "none",
|
||||
}),
|
||||
generateEntityFilter(hass, {
|
||||
domain: "camera",
|
||||
area: area,
|
||||
entity_category: "none",
|
||||
}),
|
||||
generateEntityFilter(hass, {
|
||||
domain: "binary_sensor",
|
||||
device_class: ["door", "garage_door"],
|
||||
area: area,
|
||||
entity_category: "none",
|
||||
}),
|
||||
],
|
||||
others: [
|
||||
generateEntityFilter(hass, {
|
||||
@ -156,7 +138,7 @@ export const getAreaGroupedEntities = (
|
||||
entity_category: "none",
|
||||
}),
|
||||
generateEntityFilter(hass, {
|
||||
domain: "switch",
|
||||
domain: ["switch", "select", "input_boolean", "input_select"],
|
||||
area: area,
|
||||
entity_category: "none",
|
||||
}),
|
||||
|
@ -6388,6 +6388,7 @@
|
||||
"areas": {
|
||||
"groups": {
|
||||
"lights": "Lights",
|
||||
"covers": "Covers",
|
||||
"climate": "Climate",
|
||||
"media_players": "Entertainment",
|
||||
"security": "Security",
|
||||
|
Loading…
x
Reference in New Issue
Block a user