From 9f195534b52fc1385bc17e59167707932720bcbb Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 3 May 2023 19:02:20 +0200 Subject: [PATCH 1/7] 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 31da0d8678f1eebe3d478c4e6c5d677fd0972c22 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 4 May 2023 15:13:32 +0200 Subject: [PATCH 2/7] 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 ba7d7556a8823b87878301d261d2fc22593806ca Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 4 May 2023 15:30:47 +0200 Subject: [PATCH 3/7] 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 11f77b09e626cb0129c18d03291f873d88794be5 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 4 May 2023 15:46:34 +0200 Subject: [PATCH 4/7] Bumped version to 20230503.2 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 325102ba12..63f2f28ec8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20230503.1" +version = "20230503.2" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md" From 8ce8b63cfc06cc7fea4e697dafada98fc25e019e Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Fri, 5 May 2023 00:18:18 +0200 Subject: [PATCH 5/7] Adapt unsupported microphone message (#16419) --- src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts | 2 +- src/translations/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts index aabdb1e7c4..dff378453a 100644 --- a/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts +++ b/src/dialogs/voice-command-dialog/ha-voice-command-dialog.ts @@ -418,7 +418,7 @@ export class HaVoiceCommandDialog extends LitElement { text: html`

${this.hass.localize( - "ui.dialogs.voice_command.not_supported_microphone" + "ui.dialogs.voice_command.not_supported_microphone_browser" )}

diff --git a/src/translations/en.json b/src/translations/en.json index 1b0de3e707..8b2cf3530d 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -839,7 +839,7 @@ "send_text": "Send text", "start_listening": "Start listening", "manage_assistants": "Manage assistants", - "not_supported_microphone": "Microphone is not supported. You need to access Home Assistant from a secure URL (HTTPS) to use it.", + "not_supported_microphone_browser": "Your connection to Home Assistant is not secured using HTTPS. This causes browsers to block Home Assistant from accessing the microphone.", "not_supported_microphone_documentation": "Visit {documentation_link} to learn how to use a secure URL", "not_supported_microphone_documentation_link": "the documentation" }, From c31378ad754cc85c35409b128276dbcb7022b3bb Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Fri, 5 May 2023 16:24:32 +0200 Subject: [PATCH 6/7] Fetch entries integration onboarding (#16424) * Fetch loaded entries in integration onboarding * Proper fix --- src/onboarding/onboarding-integrations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onboarding/onboarding-integrations.ts b/src/onboarding/onboarding-integrations.ts index f972609dfb..56622a750f 100644 --- a/src/onboarding/onboarding-integrations.ts +++ b/src/onboarding/onboarding-integrations.ts @@ -48,7 +48,7 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) { @property() public onboardingLocalize!: LocalizeFunc; - @state() private _entries?: ConfigEntry[]; + @state() private _entries: ConfigEntry[] = []; @state() private _discovered?: DataEntryFlowProgress[]; @@ -105,7 +105,7 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) { } protected render() { - if (!this._entries || !this._discovered) { + if (!this._discovered) { return nothing; } // Render discovered and existing entries together sorted by localized title. From bc81499e7c6855ddcec63cd23336424a433f9807 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 5 May 2023 16:26:53 +0200 Subject: [PATCH 7/7] Bumped version to 20230503.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 63f2f28ec8..ebd3566691 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20230503.2" +version = "20230503.3" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md"