Add actions section and add domains to other section in area dashboard (#25558)
* Add actions section and add domains to other section in area dashboard * Add timer and input button * Better groupingpull/25596/head
parent
28fe60f02b
commit
7fa697a768
|
@ -76,8 +76,15 @@ export class AreaViewStrategy extends ReactiveElement {
|
||||||
|
|
||||||
const computeTileCard = computeAreaTileCardConfig(hass, area.name, true);
|
const computeTileCard = computeAreaTileCardConfig(hass, area.name, true);
|
||||||
|
|
||||||
const { lights, climate, covers, media_players, security, others } =
|
const {
|
||||||
groupedEntities;
|
lights,
|
||||||
|
climate,
|
||||||
|
covers,
|
||||||
|
media_players,
|
||||||
|
security,
|
||||||
|
actions,
|
||||||
|
others,
|
||||||
|
} = groupedEntities;
|
||||||
|
|
||||||
if (lights.length > 0) {
|
if (lights.length > 0) {
|
||||||
sections.push({
|
sections.push({
|
||||||
|
@ -146,6 +153,19 @@ export class AreaViewStrategy extends ReactiveElement {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (actions.length > 0) {
|
||||||
|
sections.push({
|
||||||
|
type: "grid",
|
||||||
|
cards: [
|
||||||
|
computeHeadingCard(
|
||||||
|
hass.localize("ui.panel.lovelace.strategy.areas.groups.actions"),
|
||||||
|
AREA_STRATEGY_GROUP_ICONS.actions
|
||||||
|
),
|
||||||
|
...actions.map(computeTileCard),
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if (others.length > 0) {
|
if (others.length > 0) {
|
||||||
sections.push({
|
sections.push({
|
||||||
type: "grid",
|
type: "grid",
|
||||||
|
|
|
@ -54,6 +54,7 @@ export class AreasOverviewViewStrategy extends ReactiveElement {
|
||||||
...groups.climate,
|
...groups.climate,
|
||||||
...groups.media_players,
|
...groups.media_players,
|
||||||
...groups.security,
|
...groups.security,
|
||||||
|
...groups.actions,
|
||||||
...groups.others,
|
...groups.others,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ export const AREA_STRATEGY_GROUPS = [
|
||||||
"covers",
|
"covers",
|
||||||
"media_players",
|
"media_players",
|
||||||
"security",
|
"security",
|
||||||
|
"actions",
|
||||||
"others",
|
"others",
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
|
@ -31,6 +32,7 @@ export const AREA_STRATEGY_GROUP_ICONS = {
|
||||||
covers: "mdi:blinds-horizontal",
|
covers: "mdi:blinds-horizontal",
|
||||||
media_players: "mdi:multimedia",
|
media_players: "mdi:multimedia",
|
||||||
security: "mdi:security",
|
security: "mdi:security",
|
||||||
|
actions: "mdi:robot",
|
||||||
others: "mdi:shape",
|
others: "mdi:shape",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,6 +123,18 @@ export const getAreaGroupedEntities = (
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
actions: [
|
||||||
|
generateEntityFilter(hass, {
|
||||||
|
domain: ["script", "scene"],
|
||||||
|
area: area,
|
||||||
|
entity_category: "none",
|
||||||
|
}),
|
||||||
|
generateEntityFilter(hass, {
|
||||||
|
domain: ["automation"],
|
||||||
|
area: area,
|
||||||
|
entity_category: "none",
|
||||||
|
}),
|
||||||
|
],
|
||||||
others: [
|
others: [
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
domain: "vacuum",
|
domain: "vacuum",
|
||||||
|
@ -138,7 +152,19 @@ export const getAreaGroupedEntities = (
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
generateEntityFilter(hass, {
|
generateEntityFilter(hass, {
|
||||||
domain: ["switch", "select", "input_boolean", "input_select"],
|
domain: ["switch", "button", "input_boolean", "input_button"],
|
||||||
|
area: area,
|
||||||
|
entity_category: "none",
|
||||||
|
}),
|
||||||
|
generateEntityFilter(hass, {
|
||||||
|
domain: [
|
||||||
|
"select",
|
||||||
|
"number",
|
||||||
|
"input_select",
|
||||||
|
"input_number",
|
||||||
|
"counter",
|
||||||
|
"timer",
|
||||||
|
],
|
||||||
area: area,
|
area: area,
|
||||||
entity_category: "none",
|
entity_category: "none",
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -6571,8 +6571,9 @@
|
||||||
"lights": "Lights",
|
"lights": "Lights",
|
||||||
"covers": "Covers",
|
"covers": "Covers",
|
||||||
"climate": "Climate",
|
"climate": "Climate",
|
||||||
"media_players": "Entertainment",
|
"media_players": "Media players",
|
||||||
"security": "Security",
|
"security": "Security",
|
||||||
|
"actions": "Actions",
|
||||||
"others": "Others"
|
"others": "Others"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue