Skip to content

Commit

Permalink
20240926.0 (#22107)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Sep 26, 2024
2 parents 8890c7d + 5d71d4c commit d4a5115
Show file tree
Hide file tree
Showing 19 changed files with 261 additions and 210 deletions.
2 changes: 1 addition & 1 deletion cast/src/html/faq.html.template
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
</p>
</div>

<div class="section-header">Wat does Home Assistant Cast do?</div>
<div class="section-header">What does Home Assistant Cast do?</div>
<div class="card-content">
<p>
Home Assistant Cast is a receiver application for the Chromecast. When
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
"@rollup/plugin-babel": "6.0.4",
"@rollup/plugin-commonjs": "26.0.1",
"@rollup/plugin-json": "6.1.0",
"@rollup/plugin-node-resolve": "15.2.3",
"@rollup/plugin-node-resolve": "15.2.4",
"@rollup/plugin-replace": "5.0.7",
"@types/babel__plugin-transform-runtime": "7.9.5",
"@types/chromecast-caf-receiver": "6.0.17",
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "home-assistant-frontend"
version = "20240925.0"
version = "20240926.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions src/components/entity/ha-entity-state-content-picker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ class HaEntityStatePicker extends LitElement {
no-style
@item-moved=${this._moveItem}
.disabled=${this.disabled}
filter="button.trailing.action"
>
<ha-chip-set>
${repeat(
Expand Down
10 changes: 10 additions & 0 deletions src/components/ha-sortable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ export class HaSortable extends LitElement {
@property({ type: String, attribute: "handle-selector" })
public handleSelector?: string;

/**
* Selectors that do not lead to dragging (String or Function)
* https://github.com/SortableJS/Sortable?tab=readme-ov-file#filter-option
* */
@property({ type: String, attribute: "filter" })
public filter?: string;

@property({ type: String })
public group?: string | SortableInstance.GroupOptions;

Expand Down Expand Up @@ -145,6 +152,9 @@ export class HaSortable extends LitElement {
if (this.group) {
options.group = this.group;
}
if (this.filter) {
options.filter = this.filter;
}

this._sortable = new Sortable(container, options);
}
Expand Down
1 change: 1 addition & 0 deletions src/data/matter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const startExternalCommissioning = async (hass: HomeAssistant) => {
).tlv,
border_agent_id: preferredDataset.preferred_border_agent_id,
mac_extended_address: preferredDataset.preferred_extended_address,
extended_pan_id: preferredDataset.extended_pan_id,
},
});
}
Expand Down
13 changes: 6 additions & 7 deletions src/dialogs/generic/dialog-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,32 +129,31 @@ class DialogBox extends LitElement {
}

private _dismiss(): void {
this._cancel();
this._closeState = "canceled";
this._closeDialog();
this._cancel();
}

private _confirm(): void {
this._closeState = "confirmed";
this._closeDialog();
if (this._params!.confirm) {
this._params!.confirm(this._textField?.value);
}
this._closeState = "confirmed";
this._closeDialog();
}

private _closeDialog() {
fireEvent(this, "dialog-closed", { dialog: this.localName });
this._dialog?.close();
}

private _dialogClosed() {
if (!this._closeState) {
fireEvent(this, "dialog-closed", { dialog: this.localName });
this._cancel();
}
if (!this._params) {
return;
}
this._closeState = undefined;
this._params = undefined;
fireEvent(this, "dialog-closed", { dialog: this.localName });
}

static get styles(): CSSResultGroup {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { css, html, LitElement, PropertyValues } from "lit";
import { css, html, LitElement, nothing, PropertyValues } from "lit";
import { customElement, property } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event";
import "../../components/ha-circular-progress";
Expand Down Expand Up @@ -45,7 +45,11 @@ export class HaVoiceAssistantSetupStepUpdate extends LitElement {
}

protected override render() {
const stateObj = this.hass.states[this.updateEntityId!];
if (!this.updateEntityId || !(this.updateEntityId in this.hass.states)) {
return nothing;
}

const stateObj = this.hass.states[this.updateEntityId];

const progressIsNumeric =
typeof stateObj?.attributes.in_progress === "number";
Expand Down
1 change: 1 addition & 0 deletions src/external_app/external_messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ interface EMOutgoingMessageMatterCommission extends EMMessage {
type: "matter/commission";
payload?: {
mac_extended_address: string | null;
extended_pan_id: string | null;
border_agent_id: string | null;
active_operational_dataset: string | null;
};
Expand Down
6 changes: 3 additions & 3 deletions src/panels/config/automation/manual-automation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class HaManualAutomationEditor extends LitElement {
role="region"
aria-labelledby="triggers-heading"
.triggers=${this.config.triggers || []}
.path=${["trigger"]}
.path=${["triggers"]}
@value-changed=${this._triggerChanged}
@item-moved=${this._itemMoved}
.hass=${this.hass}
Expand Down Expand Up @@ -132,7 +132,7 @@ export class HaManualAutomationEditor extends LitElement {
role="region"
aria-labelledby="conditions-heading"
.conditions=${this.config.conditions || []}
.path=${["condition"]}
.path=${["conditions"]}
@value-changed=${this._conditionChanged}
@item-moved=${this._itemMoved}
.hass=${this.hass}
Expand Down Expand Up @@ -172,7 +172,7 @@ export class HaManualAutomationEditor extends LitElement {
role="region"
aria-labelledby="actions-heading"
.actions=${this.config.actions || []}
.path=${["action"]}
.path=${["actions"]}
@value-changed=${this._actionChanged}
@item-moved=${this._itemMoved}
.hass=${this.hass}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,19 @@ class DialogMatterOpenCommissioningWindow extends LitElement {
: html`
<p>
${this.hass.localize(
"ui.panel.config.matter.open_commissioning_window.introduction"
"ui.panel.config.matter.open_commissioning_window.description",
{
startCommissioning: html`<b
>${this.hass.localize(
"ui.panel.config.matter.open_commissioning_window.start_commissioning"
)}</b
>`,
}
)}
</p>
<p class="note">
${this.hass.localize(
"ui.panel.config.matter.open_commissioning_window.prevent_misuse_description"
)}
</p>
<mwc-button slot="primaryAction" @click=${this._start}>
Expand Down Expand Up @@ -247,6 +259,11 @@ class DialogMatterOpenCommissioningWindow extends LitElement {
.code {
font-family: monospace;
}
.note {
color: var(--secondary-text-color);
font-size: 0.9em;
}
`,
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { customElement, property, state } from "lit/decorators";
import { fireEvent } from "../../../../../common/dom/fire_event";
import "../../../../../components/ha-circular-progress";
import { createCloseHeading } from "../../../../../components/ha-dialog";
import { pingMatterNode, MatterPingResult } from "../../../../../data/matter";
import { pingMatterNode } from "../../../../../data/matter";
import { haStyle, haStyleDialog } from "../../../../../resources/styles";
import { HomeAssistant } from "../../../../../types";
import { MatterPingNodeDialogParams } from "./show-dialog-matter-ping-node";
Expand All @@ -16,9 +16,12 @@ class DialogMatterPingNode extends LitElement {

@state() private device_id?: string;

@state() private _status?: string;
@state() private _status?: "started" | "failed";

@state() private _pingResult?: MatterPingResult;
@state() private _pingResultEntries?: [
ip_address: string,
success: boolean,
][];

public async showDialog(params: MatterPingNodeDialogParams): Promise<void> {
this.device_id = params.device_id;
Expand All @@ -38,60 +41,62 @@ class DialogMatterPingNode extends LitElement {
this.hass.localize("ui.panel.config.matter.ping_node.title")
)}
>
${this._pingResult
${this._status === "failed"
? html`
<h2>
${this.hass.localize(
"ui.panel.config.matter.ping_node.ping_complete"
)}
</h2>
<mwc-list>
${Object.entries(this._pingResult).map(
([ip, success]) =>
html`<ha-list-item hasMeta noninteractive
>${ip}
<ha-svg-icon
slot="meta"
.path=${success ? mdiCheckCircle : mdiAlertCircle}
class=${success ? "success" : "failed"}
></ha-svg-icon>
</ha-list-item>`
)}
</mwc-list>
<div class="flex-container">
<ha-svg-icon
.path=${mdiCloseCircle}
class="failed"
></ha-svg-icon>
<div class="status">
<p>
${this.hass.localize(
this._pingResultEntries
? "ui.panel.config.matter.ping_node.no_ip_found"
: "ui.panel.config.matter.ping_node.ping_failed"
)}
</p>
</div>
</div>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "started"
: this._pingResultEntries
? html`
<div class="flex-container">
<ha-circular-progress indeterminate></ha-circular-progress>
<div class="status">
<p>
<b>
${this.hass.localize(
"ui.panel.config.matter.ping_node.in_progress"
)}
</b>
</p>
</div>
</div>
<h2>
${this.hass.localize(
"ui.panel.config.matter.ping_node.ping_complete"
)}
</h2>
<mwc-list>
${this._pingResultEntries.map(
([ip, success]) =>
html`<ha-list-item hasMeta noninteractive
>${ip}
<ha-svg-icon
slot="meta"
.path=${success ? mdiCheckCircle : mdiAlertCircle}
class=${success ? "success" : "failed"}
></ha-svg-icon>
</ha-list-item>`
)}
</mwc-list>
<mwc-button slot="primaryAction" @click=${this.closeDialog}>
${this.hass.localize("ui.common.close")}
</mwc-button>
`
: this._status === "failed"
: this._status === "started"
? html`
<div class="flex-container">
<ha-svg-icon
.path=${mdiCloseCircle}
class="failed"
></ha-svg-icon>
<ha-circular-progress indeterminate></ha-circular-progress>
<div class="status">
<p>
${this.hass.localize(
"ui.panel.config.matter.ping_node.ping_failed"
)}
<b>
${this.hass.localize(
"ui.panel.config.matter.ping_node.in_progress"
)}
</b>
</p>
</div>
</div>
Expand Down Expand Up @@ -128,7 +133,13 @@ class DialogMatterPingNode extends LitElement {
}
this._status = "started";
try {
this._pingResult = await pingMatterNode(this.hass, this.device_id!);
const pingResult = await pingMatterNode(this.hass, this.device_id!);
const pingResultEntries = Object.entries(pingResult);
if (pingResultEntries.length === 0) {
this._status = "failed";
}

this._pingResultEntries = pingResultEntries;
} catch (err) {
this._status = "failed";
}
Expand All @@ -137,7 +148,7 @@ class DialogMatterPingNode extends LitElement {
public closeDialog(): void {
this.device_id = undefined;
this._status = undefined;
this._pingResult = undefined;
this._pingResultEntries = undefined;
fireEvent(this, "dialog-closed", { dialog: this.localName });
}

Expand Down
4 changes: 2 additions & 2 deletions src/panels/config/repairs/dialog-repairs-issue-subtitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class DialogRepairsIssueSubtitle extends LitElement {
protected render() {
const domainName = domainToName(this.hass.localize, this.issue.domain);
const reportedBy = domainName
? this.hass.localize("ui.panel.config.repairs.reported_by", {
? ` ⸱ ${this.hass.localize("ui.panel.config.repairs.reported_by", {
integration: domainName,
})
})}`
: "";

const severity = this.hass.localize(
Expand Down
Loading

0 comments on commit d4a5115

Please sign in to comment.