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 computeTileCard = computeAreaTileCardConfig(hass, area.name, true);
|
||||||
|
|
||||||
const { lights, climate, media_players, security, others } =
|
const { lights, climate, covers, media_players, security, others } =
|
||||||
groupedEntities;
|
groupedEntities;
|
||||||
|
|
||||||
if (lights.length > 0) {
|
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) {
|
if (climate.length > 0) {
|
||||||
sections.push({
|
sections.push({
|
||||||
type: "grid",
|
type: "grid",
|
||||||
|
@ -19,6 +19,7 @@ import type { TileCardConfig } from "../../../cards/types";
|
|||||||
export const AREA_STRATEGY_GROUPS = [
|
export const AREA_STRATEGY_GROUPS = [
|
||||||
"lights",
|
"lights",
|
||||||
"climate",
|
"climate",
|
||||||
|
"covers",
|
||||||
"media_players",
|
"media_players",
|
||||||
"security",
|
"security",
|
||||||
"others",
|
"others",
|
||||||
@ -27,6 +28,7 @@ export const AREA_STRATEGY_GROUPS = [
|
|||||||
export const AREA_STRATEGY_GROUP_ICONS = {
|
export const AREA_STRATEGY_GROUP_ICONS = {
|
||||||
lights: "mdi:lamps",
|
lights: "mdi:lamps",
|
||||||
climate: "mdi:home-thermometer",
|
climate: "mdi:home-thermometer",
|
||||||
|
covers: "mdi:blinds-horizontal",
|
||||||
media_players: "mdi:multimedia",
|
media_players: "mdi:multimedia",
|
||||||
security: "mdi:security",
|
security: "mdi:security",
|
||||||
others: "mdi:shape",
|
others: "mdi:shape",
|
||||||
@ -60,22 +62,20 @@ export const getAreaGroupedEntities = (
|
|||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
climate: [
|
covers: [
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
domain: "cover",
|
domain: "cover",
|
||||||
area: area,
|
area: area,
|
||||||
device_class: [
|
|
||||||
"shutter",
|
|
||||||
"awning",
|
|
||||||
"blind",
|
|
||||||
"curtain",
|
|
||||||
"shade",
|
|
||||||
"shutter",
|
|
||||||
"window",
|
|
||||||
"none",
|
|
||||||
],
|
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
|
generateEntityFilter(hass, {
|
||||||
|
domain: "binary_sensor",
|
||||||
|
area: area,
|
||||||
|
device_class: ["door", "garage_door", "window"],
|
||||||
|
entity_category: "none",
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
climate: [
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
domain: "climate",
|
domain: "climate",
|
||||||
area: area,
|
area: area,
|
||||||
@ -96,12 +96,6 @@ export const getAreaGroupedEntities = (
|
|||||||
area: area,
|
area: area,
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
generateEntityFilter(hass, {
|
|
||||||
domain: "binary_sensor",
|
|
||||||
area: area,
|
|
||||||
device_class: "window",
|
|
||||||
entity_category: "none",
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
media_players: [
|
media_players: [
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
@ -121,23 +115,11 @@ export const getAreaGroupedEntities = (
|
|||||||
area: area,
|
area: area,
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
generateEntityFilter(hass, {
|
|
||||||
domain: "cover",
|
|
||||||
device_class: ["door", "garage", "gate"],
|
|
||||||
area: area,
|
|
||||||
entity_category: "none",
|
|
||||||
}),
|
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
domain: "camera",
|
domain: "camera",
|
||||||
area: area,
|
area: area,
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
generateEntityFilter(hass, {
|
|
||||||
domain: "binary_sensor",
|
|
||||||
device_class: ["door", "garage_door"],
|
|
||||||
area: area,
|
|
||||||
entity_category: "none",
|
|
||||||
}),
|
|
||||||
],
|
],
|
||||||
others: [
|
others: [
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
@ -156,7 +138,7 @@ export const getAreaGroupedEntities = (
|
|||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
domain: "switch",
|
domain: ["switch", "select", "input_boolean", "input_select"],
|
||||||
area: area,
|
area: area,
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
|
@ -6388,6 +6388,7 @@
|
|||||||
"areas": {
|
"areas": {
|
||||||
"groups": {
|
"groups": {
|
||||||
"lights": "Lights",
|
"lights": "Lights",
|
||||||
|
"covers": "Covers",
|
||||||
"climate": "Climate",
|
"climate": "Climate",
|
||||||
"media_players": "Entertainment",
|
"media_players": "Entertainment",
|
||||||
"security": "Security",
|
"security": "Security",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user