diff --git a/package.json b/package.json index 920479bacce8..7a3360c785ed 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "lit": "2.8.0", "lit-html": "2.8.0", "luxon": "3.5.0", - "marked": "15.0.2", + "marked": "15.0.3", "memoize-one": "6.0.0", "node-vibrant": "3.2.1-alpha.1", "proxy-polyfill": "0.3.2", diff --git a/pyproject.toml b/pyproject.toml index 74cb9fd55e3f..e0d234d74934 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "home-assistant-frontend" -version = "20241127.3" +version = "20241127.4" license = {text = "Apache-2.0"} description = "The Home Assistant frontend" readme = "README.md" diff --git a/src/common/datetime/format_duration.ts b/src/common/datetime/format_duration.ts index e20f7e18af25..c2c0c11d556f 100644 --- a/src/common/datetime/format_duration.ts +++ b/src/common/datetime/format_duration.ts @@ -71,7 +71,7 @@ export const formatDurationDigital = ( duration: HaDurationData ) => formatDigitalDurationMem(locale).format(duration); -export const DURATION_UNITS = ["s", "min", "h", "d"] as const; +export const DURATION_UNITS = ["min", "h", "d"] as const; type DurationUnit = (typeof DURATION_UNITS)[number]; @@ -99,14 +99,6 @@ const formatDurationMinuteMem = memoizeOne( }) ); -const formatDurationSecondMem = memoizeOne( - (locale: FrontendLocaleData) => - new Intl.DurationFormat(locale.language, { - style: "narrow", - secondsDisplay: "always", - }) -); - export const formatDuration = ( locale: FrontendLocaleData, duration: string, @@ -146,15 +138,6 @@ export const formatDuration = ( }; return formatDurationMinuteMem(locale).format(input); } - case "s": { - const seconds = Math.floor(value); - const milliseconds = Math.floor((value - seconds) * 1000); - const input: DurationInput = { - seconds, - milliseconds, - }; - return formatDurationSecondMem(locale).format(input); - } default: throw new Error("Invalid duration unit"); } diff --git a/src/components/ha-badge.ts b/src/components/ha-badge.ts index 8b2160f24ef0..46ab2a0dd140 100644 --- a/src/components/ha-badge.ts +++ b/src/components/ha-badge.ts @@ -98,7 +98,6 @@ export class HaBadge extends LitElement { align-items: flex-start; padding-inline-start: initial; text-align: center; - font-family: Roboto; } .label { font-size: 10px; diff --git a/src/data/assist_pipeline.ts b/src/data/assist_pipeline.ts index c0c8b4b788c3..0623049a0fc9 100644 --- a/src/data/assist_pipeline.ts +++ b/src/data/assist_pipeline.ts @@ -104,12 +104,14 @@ interface PipelineIntentStartEvent extends PipelineEventBase { data: { engine: string; language: string; + prefer_local_intents: boolean; intent_input: string; }; } interface PipelineIntentEndEvent extends PipelineEventBase { type: "intent-end"; data: { + processed_locally: boolean; intent_output: ConversationResult; }; } diff --git a/src/dialogs/more-info/controls/more-info-camera.ts b/src/dialogs/more-info/controls/more-info-camera.ts index 7b339db519c8..0a9a6e6339b0 100644 --- a/src/dialogs/more-info/controls/more-info-camera.ts +++ b/src/dialogs/more-info/controls/more-info-camera.ts @@ -8,6 +8,7 @@ import "../../../components/buttons/ha-progress-button"; import { UNAVAILABLE } from "../../../data/entity"; import { fileDownload } from "../../../util/file_download"; import { showToast } from "../../../util/toast"; +import { slugify } from "../../../common/string/slugify"; class MoreInfoCamera extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; @@ -69,9 +70,14 @@ class MoreInfoCamera extends LitElement { throw new Error("No response from API"); } + const contentType = result.headers.get("content-type"); + const ext = contentType === "image/png" ? "png" : "jpg"; + const date = new Date().toLocaleString(); + const filename = `snapshot_${slugify(this.stateObj!.entity_id)}_${date}.${ext}`; + const blob = await result.blob(); const url = window.URL.createObjectURL(blob); - fileDownload(url); + fileDownload(url, filename); } catch (err) { this._waiting = false; button.actionError(); diff --git a/src/dialogs/more-info/controls/more-info-media_player.ts b/src/dialogs/more-info/controls/more-info-media_player.ts index 694b190d0488..93828334d4e7 100644 --- a/src/dialogs/more-info/controls/more-info-media_player.ts +++ b/src/dialogs/more-info/controls/more-info-media_player.ts @@ -207,12 +207,17 @@ class MoreInfoMediaPlayer extends LitElement { static get styles(): CSSResultGroup { return css` - ha-icon-button[action="turn_off"], - ha-icon-button[action="turn_on"], ha-slider { flex-grow: 1; } + ha-icon-button[action="turn_off"], + ha-icon-button[action="turn_on"] { + margin-inline-end: auto; + margin-right: auto; + margin-left: inherit; + } + .controls { display: flex; flex-wrap: wrap; diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-local.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-local.ts index cd00187d5a0e..1926f83e1e08 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-local.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-local.ts @@ -24,7 +24,6 @@ import type { HomeAssistant } from "../../types"; import { documentationUrl } from "../../util/documentation-url"; import { AssistantSetupStyles } from "./styles"; import { STEP } from "./voice-assistant-setup-dialog"; -import { nextRender } from "../../common/util/render-status"; @customElement("ha-voice-assistant-setup-step-local") export class HaVoiceAssistantSetupStepLocal extends LitElement { @@ -253,9 +252,6 @@ export class HaVoiceAssistantSetupStepLocal extends LitElement { this._localTts[0].entity_id, this._localStt[0].entity_id ); - - // wait a render so the `hui-select-entity-row` is also updated and doesn't undo the select action - await nextRender(); } await this.hass.callService( @@ -337,9 +333,6 @@ export class HaVoiceAssistantSetupStepLocal extends LitElement { this._localStt[0].entity_id ); - // wait a render so the `hui-select-entity-row` is also updated and doesn't undo the select action - await nextRender(); - await this.hass.callService( "select", "select_option", diff --git a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-pipeline.ts b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-pipeline.ts index 781802d3481e..d008d312f045 100644 --- a/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-pipeline.ts +++ b/src/dialogs/voice-assistant-setup/voice-assistant-setup-step-pipeline.ts @@ -17,7 +17,6 @@ import type { HomeAssistant } from "../../types"; import { AssistantSetupStyles } from "./styles"; import { STEP } from "./voice-assistant-setup-dialog"; import { documentationUrl } from "../../util/documentation-url"; -import { nextRender } from "../../common/util/render-status"; @customElement("ha-voice-assistant-setup-step-pipeline") export class HaVoiceAssistantSetupStepPipeline extends LitElement { @@ -241,9 +240,6 @@ export class HaVoiceAssistantSetupStepPipeline extends LitElement { wake_word_entity: null, wake_word_id: null, }); - - // wait a render so the `hui-select-entity-row` is also updated and doesn't undo the select action - await nextRender(); } await this.hass.callService( diff --git a/src/panels/config/voice-assistants/debug/assist-render-pipeline-run.ts b/src/panels/config/voice-assistants/debug/assist-render-pipeline-run.ts index b3c2a8629678..9d3bbf81eac5 100644 --- a/src/panels/config/voice-assistants/debug/assist-render-pipeline-run.ts +++ b/src/panels/config/voice-assistants/debug/assist-render-pipeline-run.ts @@ -307,6 +307,18 @@ export class AssistPipelineDebug extends LitElement { ` : ""}` : ""} +