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:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user