Move notification services to main list (#19235)

This commit is contained in:
Bram Kragten 2024-01-02 19:58:37 +01:00 committed by GitHub
parent 2933d642ed
commit e721481757
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,8 @@ const ENTITY_DOMAINS_OTHER = new Set([
"image_processing",
]);
const ENTITY_DOMAINS_MAIN = new Set(["notify"]);
@customElement("add-automation-element-dialog")
class DialogAddAutomationElement extends LitElement implements HassDialog {
@property({ attribute: false }) public hass!: HomeAssistant;
@ -302,11 +304,13 @@ class DialogAddAutomationElement extends LitElement implements HassDialog {
const domainUsed = !domains ? true : domains.has(domain);
if (
(type === undefined &&
manifest?.integration_type === "entity" &&
domainUsed &&
!ENTITY_DOMAINS_OTHER.has(domain)) ||
(ENTITY_DOMAINS_MAIN.has(domain) ||
(manifest?.integration_type === "entity" &&
domainUsed &&
!ENTITY_DOMAINS_OTHER.has(domain)))) ||
(type === "helper" && manifest?.integration_type === "helper") ||
(type === "other" &&
!ENTITY_DOMAINS_MAIN.has(domain) &&
(ENTITY_DOMAINS_OTHER.has(domain) ||
(!domainUsed && manifest?.integration_type === "entity") ||
!["helper", "entity"].includes(manifest?.integration_type || "")))