mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-13 20:36:35 +00:00
20241127.4 (#23137)
This commit is contained in:
commit
1016c87c60
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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");
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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",
|
||||
|
@ -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(
|
||||
|
@ -307,6 +307,18 @@ export class AssistPipelineDebug extends LitElement {
|
||||
</div>`
|
||||
: ""}`
|
||||
: ""}
|
||||
<div class="row">
|
||||
<div>Prefer handling locally</div>
|
||||
<div>
|
||||
${this.pipelineRun.intent.prefer_local_intents}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div>Processed locally</div>
|
||||
<div>
|
||||
${this.pipelineRun.intent.processed_locally}
|
||||
</div>
|
||||
</div>
|
||||
${dataMinusKeysRender(
|
||||
this.pipelineRun.intent,
|
||||
INTENT_DATA
|
||||
|
@ -509,6 +509,7 @@ export class HaConfigZone extends SubscribeMixin(LitElement) {
|
||||
title: this.hass!.localize("ui.panel.config.zone.confirm_delete"),
|
||||
dismissText: this.hass!.localize("ui.common.cancel"),
|
||||
confirmText: this.hass!.localize("ui.common.delete"),
|
||||
destructive: true,
|
||||
}))
|
||||
) {
|
||||
return false;
|
||||
|
@ -63,7 +63,7 @@ class HuiSelectEntityRow extends LitElement implements LovelaceRow {
|
||||
.value=${stateObj.state}
|
||||
.disabled=${stateObj.state === UNAVAILABLE}
|
||||
naturalMenuWidth
|
||||
@selected=${this._selectedChanged}
|
||||
@action=${this._handleAction}
|
||||
@click=${stopPropagation}
|
||||
@closed=${stopPropagation}
|
||||
>
|
||||
@ -94,11 +94,13 @@ class HuiSelectEntityRow extends LitElement implements LovelaceRow {
|
||||
`;
|
||||
}
|
||||
|
||||
private _selectedChanged(ev): void {
|
||||
private _handleAction(ev): void {
|
||||
const stateObj = this.hass!.states[
|
||||
this._config!.entity
|
||||
] as InputSelectEntity;
|
||||
|
||||
const option = ev.target.value;
|
||||
|
||||
if (
|
||||
option === stateObj.state ||
|
||||
!stateObj.attributes.options.includes(option)
|
||||
|
@ -246,7 +246,7 @@ export class SectionsView extends LitElement implements LovelaceViewElement {
|
||||
<ha-sortable
|
||||
group="card"
|
||||
@item-added=${this._handleCardAdded}
|
||||
filter="button"
|
||||
draggable-selector=".card"
|
||||
.rollback=${false}
|
||||
>
|
||||
<div class="create-section-container">
|
||||
|
@ -21,11 +21,6 @@ const LOCALE: FrontendLocaleData = {
|
||||
|
||||
describe("formatDuration", () => {
|
||||
it("works", () => {
|
||||
assert.strictEqual(formatDuration(LOCALE, "0.5", "s"), "0s 500ms");
|
||||
assert.strictEqual(formatDuration(LOCALE, "1", "s"), "1s");
|
||||
assert.strictEqual(formatDuration(LOCALE, "1.1", "s"), "1s 100ms");
|
||||
assert.strictEqual(formatDuration(LOCALE, "65", "s"), "65s");
|
||||
|
||||
assert.strictEqual(formatDuration(LOCALE, "0.25", "min"), "0m 15s");
|
||||
assert.strictEqual(formatDuration(LOCALE, "0.5", "min"), "0m 30s");
|
||||
assert.strictEqual(formatDuration(LOCALE, "1", "min"), "1m");
|
||||
|
10
yarn.lock
10
yarn.lock
@ -9646,7 +9646,7 @@ __metadata:
|
||||
luxon: "npm:3.5.0"
|
||||
magic-string: "npm:0.30.13"
|
||||
map-stream: "npm:0.0.7"
|
||||
marked: "npm:15.0.2"
|
||||
marked: "npm:15.0.3"
|
||||
memoize-one: "npm:6.0.0"
|
||||
node-vibrant: "npm:3.2.1-alpha.1"
|
||||
object-hash: "npm:3.0.0"
|
||||
@ -11371,12 +11371,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"marked@npm:15.0.2":
|
||||
version: 15.0.2
|
||||
resolution: "marked@npm:15.0.2"
|
||||
"marked@npm:15.0.3":
|
||||
version: 15.0.3
|
||||
resolution: "marked@npm:15.0.3"
|
||||
bin:
|
||||
marked: bin/marked.js
|
||||
checksum: 10/dde3d918bb3938906d7a874b990cbfb193514a5fef4b41bca102db3b63d50235afb517dd70429525b6e0a5cff43abd827e7bd2b18617f8bd4776db745e75e973
|
||||
checksum: 10/821c1af0e527b3f6f4684a68802a0fa5e91cd2b0887d0600ce9035896f8b0fbad180a3f8c5be91de25bdc20323abbd674351832c40d48820b6f0d888fd77cd59
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user