1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Add group support to new more info light (#15543)

This commit is contained in:
Paul Bottein
2023-02-22 12:20:45 +01:00
committed by GitHub
parent dfb74fd576
commit 2bd6d9d202
7 changed files with 65 additions and 24 deletions

View File

@@ -1,5 +1,7 @@
import { HassEntity } from "home-assistant-js-websocket";
import { isComponentLoaded } from "../../common/config/is_component_loaded";
import { computeDomain } from "../../common/entity/compute_domain";
import { computeGroupDomain, GroupEntity } from "../../data/group";
import { CONTINUOUS_DOMAINS } from "../../data/logbook";
import { HomeAssistant } from "../../types";
@@ -89,3 +91,16 @@ export const computeShowLogBookComponent = (
return true;
};
export const computeShowNewMoreInfo = (stateObj: HassEntity) => {
const domain = computeDomain(stateObj.entity_id);
if (domain === "group") {
const groupDomain = computeGroupDomain(stateObj as GroupEntity);
return (
groupDomain &&
groupDomain !== "group" &&
DOMAINS_WITH_NEW_MORE_INFO.includes(groupDomain)
);
}
return DOMAINS_WITH_NEW_MORE_INFO.includes(domain);
};