From 694fc7d4bac5d71267adad8298e43cb11ba64952 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 3 May 2023 19:02:20 +0200 Subject: [PATCH 001/211] Fix entity areas in expose (#16402) --- .../ha-config-voice-assistants-expose.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts b/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts index c81fd18116..ee822e2dd4 100644 --- a/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts +++ b/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts @@ -344,9 +344,8 @@ export class VoiceAssistantsExpose extends LitElement { const entry: ExtEntityRegistryEntry | undefined = entities[entityState.entity_id]; const areaId = - entry?.area_id ?? entry?.device_id - ? devices[entry.device_id!]?.area_id - : undefined; + entry?.area_id ?? + (entry?.device_id ? devices[entry.device_id!]?.area_id : undefined); const area = areaId ? areas[areaId] : undefined; result[entityState.entity_id] = { @@ -405,9 +404,10 @@ export class VoiceAssistantsExpose extends LitElement { const entry: ExtEntityRegistryEntry | undefined = entities[entityId]; const areaId = - entry?.area_id ?? entry?.device_id + entry?.area_id ?? + (entry?.device_id ? devices[entry.device_id!]?.area_id - : undefined; + : undefined); const area = areaId ? areas[areaId] : undefined; result[entityId] = { entity_id: entityState.entity_id, From 79d6453c7ef8ced318f351d19af49fcb1eb91d28 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Wed, 3 May 2023 19:44:01 +0200 Subject: [PATCH 002/211] Don't hide battery entities in compute card function (#16373) --- src/panels/lovelace/common/generate-lovelace-config.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/panels/lovelace/common/generate-lovelace-config.ts b/src/panels/lovelace/common/generate-lovelace-config.ts index 759e63ae92..99bfbdc634 100644 --- a/src/panels/lovelace/common/generate-lovelace-config.ts +++ b/src/panels/lovelace/common/generate-lovelace-config.ts @@ -13,7 +13,6 @@ import { } from "../../../data/energy"; import { domainToName } from "../../../data/integration"; import { LovelaceCardConfig, LovelaceViewConfig } from "../../../data/lovelace"; -import { SENSOR_DEVICE_CLASS_BATTERY } from "../../../data/sensor"; import { computeUserInitials } from "../../../data/user"; import { HomeAssistant } from "../../../types"; import { HELPER_DOMAINS } from "../../config/helpers/const"; @@ -179,11 +178,6 @@ export const computeCards = ( conf.name = name; } footerEntities.push(conf); - } else if ( - domain === "sensor" && - stateObj?.attributes.device_class === SENSOR_DEVICE_CLASS_BATTERY - ) { - // Do nothing. } else { let name: string | undefined; const entityConf = From ed19cfeaaa74fe2002edf7264ffcabac0d0be20a Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 4 May 2023 15:13:32 +0200 Subject: [PATCH 003/211] Fix codemirror selection color (#16409) --- src/resources/codemirror.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/resources/codemirror.ts b/src/resources/codemirror.ts index f16e1f61f0..c419dd4a0c 100644 --- a/src/resources/codemirror.ts +++ b/src/resources/codemirror.ts @@ -46,7 +46,6 @@ export const haTheme = EditorView.theme({ color: "var(--primary-text-color)", backgroundColor: "var(--code-editor-background-color, var(--mdc-text-field-fill-color, whitesmoke))", - "& ::selection": { backgroundColor: "rgba(var(--rgb-primary-color), 0.3)" }, borderRadius: "var(--mdc-shape-small, 4px) var(--mdc-shape-small, 4px) 0px 0px", caretColor: "var(--secondary-text-color)", @@ -54,14 +53,20 @@ export const haTheme = EditorView.theme({ maxHeight: "var(--code-mirror-max-height, unset)", }, - "&.cm-editor.cm-focused": { outline: "none" }, + "&.cm-editor.cm-focused": { + outline: "none", + }, "&.cm-focused .cm-cursor": { borderLeftColor: "var(--secondary-text-color)", }, - "&.cm-focused .cm-selectionBackground, .cm-selectionBackground": { - backgroundColor: "rgba(var(--rgb-primary-color), 0.3)", + ".cm-selectionBackground, ::selection": { + backgroundColor: "rgba(var(--rgb-primary-color), 0.1)", + }, + + "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": { + backgroundColor: "rgba(var(--rgb-primary-color), 0.2)", }, ".cm-activeLine": { From 060f6ce3d8f799c4b6ded47dd8d2c7c69afec738 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 4 May 2023 15:30:47 +0200 Subject: [PATCH 004/211] fix expose view for yaml config (#16408) --- .../ha-config-voice-assistants-expose.ts | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts b/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts index ee822e2dd4..98363e9bed 100644 --- a/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts +++ b/src/panels/config/voice-assistants/ha-config-voice-assistants-expose.ts @@ -334,6 +334,7 @@ export class VoiceAssistantsExpose extends LitElement { filteredAssistants.some( (assis) => !(assis === "cloud.alexa" && alexaManual) && + !(assis === "cloud.google_assistant" && googleManual) && exposedEntities?.[entity.entity_id]?.[assis] ) ); @@ -377,20 +378,10 @@ export class VoiceAssistantsExpose extends LitElement { ); Object.keys(this.hass.states).forEach((entityId) => { const assistants: string[] = []; - if ( - alexaManual && - (!filteredAssistants || - filteredAssistants.includes("cloud.alexa")) && - manFilterFuncs.amazon(entityId) - ) { + if (alexaManual && manFilterFuncs.amazon(entityId)) { assistants.push("cloud.alexa"); } - if ( - googleManual && - (!filteredAssistants || - filteredAssistants.includes("cloud.google_assistant")) && - manFilterFuncs.google(entityId) - ) { + if (googleManual && manFilterFuncs.google(entityId)) { assistants.push("cloud.google_assistant"); } if (!assistants.length) { @@ -399,7 +390,10 @@ export class VoiceAssistantsExpose extends LitElement { if (entityId in result) { result[entityId].assistants.push(...assistants); result[entityId].manAssistants = assistants; - } else { + } else if ( + !filteredAssistants || + filteredAssistants.some((ass) => assistants.includes(ass)) + ) { const entityState = this.hass.states[entityId]; const entry: ExtEntityRegistryEntry | undefined = entities[entityId]; From 8695bbc490356fff25b56970c4d997c4d1f14c85 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 4 May 2023 15:49:28 +0200 Subject: [PATCH 005/211] Move globalThis polyfill to compatibility, add more compatibility (#16386) --- demo/src/html/index.html.template | 3 --- src/components/ha-icon.ts | 4 ++-- src/data/custom_icons.ts | 1 - src/entrypoints/core.ts | 2 +- src/html/authorize.html.template | 3 --- src/html/index.html.template | 3 --- src/html/onboarding.html.template | 3 --- src/resources/compatibility.ts | 24 ++++++++++++++++++++++++ 8 files changed, 27 insertions(+), 16 deletions(-) diff --git a/demo/src/html/index.html.template b/demo/src/html/index.html.template index 021a9dc55f..368dcc08e3 100644 --- a/demo/src/html/index.html.template +++ b/demo/src/html/index.html.template @@ -84,9 +84,6 @@ <%= renderTemplate("../../../src/html/_js_base.html.template") %> <%= renderTemplate("../../../src/html/_preload_roboto.html.template") %>