Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20231002.0 #18102

Merged
merged 22 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
c848356
Update dependency @types/sortablejs to v1.15.3 (#18049)
renovate[bot] Sep 28, 2023
dbf623a
Update typescript-eslint monorepo to v6.7.3 (#18051)
renovate[bot] Sep 28, 2023
246fe28
Update dependency eslint-plugin-wc to v2.0.4 (#18050)
renovate[bot] Sep 28, 2023
59bd852
Update dependency @octokit/rest to v20.0.2 (#18053)
renovate[bot] Sep 29, 2023
8daff17
Change linear-progress bar background color for dark mode (#18059)
bramkragten Sep 29, 2023
5914a6c
Clear wake word when new engine is picked, select first wake word. by…
bramkragten Sep 29, 2023
0dfa292
Update dependency glob to v10.3.9 (#18060)
renovate[bot] Sep 29, 2023
a116a50
Hide shopping list from discovered onboarding integrations (#18069)
frenck Sep 29, 2023
03c5482
Update dependency @types/mocha to v10.0.2 (#18075)
renovate[bot] Sep 30, 2023
399a979
Update dependency glob to v10.3.10 (#18072)
renovate[bot] Sep 30, 2023
4fe7b18
Update dependency chai to v4.3.9 (#18074)
renovate[bot] Sep 30, 2023
41b24de
Update dependency chai to v4.3.10 (#18082)
renovate[bot] Oct 2, 2023
c5ba74e
Bump home-assistant/wheels from 2023.09.1 to 2023.10.1 (#18088)
dependabot[bot] Oct 2, 2023
292cdc7
Fix clicking on radio buttons (and improve code) (#18078)
KTibow Oct 2, 2023
c345f41
Factor out style data to reduce bundle size (#18077)
KTibow Oct 2, 2023
a3400a2
Prevent ha-form data lost if quick data updates (#18094)
piitaya Oct 2, 2023
2f6297e
Always deduplicate found integrations in onboarding (#18091)
bramkragten Oct 2, 2023
46d1dbc
Dont continue debug assist run when disconnected (#18098)
bramkragten Oct 2, 2023
2030fea
Only set wakeword when not in new wakewords (#18095)
bramkragten Oct 2, 2023
6acbf63
Ignore prettier styling for tooltip of disk life time (#18097)
bramkragten Oct 2, 2023
4aa8518
Change Urdu language to RTL (#18063)
yousaf465 Oct 2, 2023
e288b00
Bumped version to 20231002.0
bramkragten Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
echo "home-assistant-frontend==$version" > ./requirements.txt

- name: Build wheels
uses: home-assistant/wheels@2023.09.1
uses: home-assistant/wheels@2023.10.1
with:
abi: cp311
tag: musllinux_1_2
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
"@lokalise/node-api": "12.0.0",
"@octokit/auth-oauth-device": "6.0.1",
"@octokit/plugin-retry": "6.0.1",
"@octokit/rest": "20.0.1",
"@octokit/rest": "20.0.2",
"@open-wc/dev-server-hmr": "0.1.4",
"@rollup/plugin-babel": "6.0.3",
"@rollup/plugin-commonjs": "25.0.4",
Expand All @@ -180,20 +180,20 @@
"@types/leaflet": "1.9.6",
"@types/leaflet-draw": "1.0.8",
"@types/luxon": "3.3.2",
"@types/mocha": "10.0.1",
"@types/mocha": "10.0.2",
"@types/qrcode": "1.5.2",
"@types/serve-handler": "6.1.2",
"@types/sortablejs": "1.15.2",
"@types/sortablejs": "1.15.3",
"@types/tar": "6.1.6",
"@types/ua-parser-js": "0.7.37",
"@types/webspeechapi": "0.0.29",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"@web/dev-server": "0.1.38",
"@web/dev-server-rollup": "0.4.1",
"babel-loader": "9.1.3",
"babel-plugin-template-html-minifier": "4.1.0",
"chai": "4.3.8",
"chai": "4.3.10",
"del": "7.1.0",
"eslint": "8.50.0",
"eslint-config-airbnb-base": "15.0.0",
Expand All @@ -205,11 +205,11 @@
"eslint-plugin-lit": "1.9.1",
"eslint-plugin-lit-a11y": "4.1.0",
"eslint-plugin-unused-imports": "3.0.0",
"eslint-plugin-wc": "2.0.3",
"eslint-plugin-wc": "2.0.4",
"esprima": "4.0.1",
"fancy-log": "2.0.0",
"fs-extra": "11.1.1",
"glob": "10.3.7",
"glob": "10.3.10",
"gulp": "4.0.2",
"gulp-flatmap": "1.0.2",
"gulp-json-transform": "0.4.8",
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 = "20230928.0"
version = "20231002.0"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion src/common/dom/apply_themes_on_element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ThemeVars } from "../../data/ws-themes";
import { darkStyles, derivedStyles } from "../../resources/styles";
import { darkStyles, derivedStyles } from "../../resources/styles-data";
import type { HomeAssistant } from "../../types";
import {
hex2rgb,
Expand Down
7 changes: 6 additions & 1 deletion src/components/ha-form/ha-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,13 @@ export class HaForm extends LitElement implements HaFormElement {
? ev.detail.value
: { [schema.name]: ev.detail.value };

this.data = {
...this.data,
...newValue,
};

fireEvent(this, "value-changed", {
value: { ...this.data, ...newValue },
value: this.data,
});
});
}
Expand Down
35 changes: 19 additions & 16 deletions src/components/ha-formfield.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,25 @@ import { fireEvent } from "../common/dom/fire_event";
@customElement("ha-formfield")
export class HaFormfield extends FormfieldBase {
protected _labelClick() {
const input = this.input;
if (input) {
input.focus();
switch (input.tagName) {
case "HA-CHECKBOX":
case "HA-RADIO":
if ((input as any).disabled) {
break;
}
(input as any).checked = !(input as any).checked;
fireEvent(input, "change");
break;
default:
input.click();
break;
}
const input = this.input as HTMLInputElement | undefined;
if (!input) return;

input.focus();
if (input.disabled) {
return;
}
switch (input.tagName) {
case "HA-CHECKBOX":
input.checked = !input.checked;
fireEvent(input, "change");
break;
case "HA-RADIO":
input.checked = true;
fireEvent(input, "change");
break;
default:
input.click();
break;
}
}

Expand Down
65 changes: 26 additions & 39 deletions src/onboarding/onboarding-integrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { stringCompare } from "../common/string/compare";
import { LocalizeFunc } from "../common/translations/localize";
import { ConfigEntry, subscribeConfigEntries } from "../data/config_entries";
import { subscribeConfigFlowInProgress } from "../data/config_flow";
import { DataEntryFlowProgress } from "../data/data_entry_flow";
import { domainToName } from "../data/integration";
import { scanUSBDevices } from "../data/usb";
import { SubscribeMixin } from "../mixins/subscribe-mixin";
Expand All @@ -24,12 +23,13 @@ import "./integration-badge";
import { onBoardingStyles } from "./styles";

const HIDDEN_DOMAINS = new Set([
"google_translate",
"hassio",
"met",
"radio_browser",
"rpi_power",
"shopping_list",
"sun",
"google_translate",
]);

@customElement("onboarding-integrations")
Expand All @@ -40,19 +40,20 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {

@state() private _entries: ConfigEntry[] = [];

@state() private _discovered?: DataEntryFlowProgress[];
@state() private _discoveredDomains?: Set<string>;

public hassSubscribe(): Array<UnsubscribeFunc | Promise<UnsubscribeFunc>> {
return [
subscribeConfigFlowInProgress(this.hass, (flows) => {
this._discovered = flows.filter(
(flow) => !HIDDEN_DOMAINS.has(flow.handler)
this._discoveredDomains = new Set(
flows
.filter((flow) => !HIDDEN_DOMAINS.has(flow.handler))
.map((flow) => flow.handler)
);
this.hass.loadBackendTranslation(
"title",
Array.from(this._discoveredDomains)
);
const integrations: Set<string> = new Set();
for (const flow of this._discovered) {
integrations.add(flow.handler);
}
this.hass.loadBackendTranslation("title", Array.from(integrations));
}),
subscribeConfigEntries(
this.hass,
Expand Down Expand Up @@ -97,41 +98,27 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
}

protected render() {
if (!this._discovered) {
if (!this._discoveredDomains) {
return nothing;
}
// Render discovered and existing entries together sorted by localized title.
const entries: Array<[string, string]> = this._entries.map((entry) => [
entry.domain,
domainToName(this.hass.localize, entry.domain),
]);
const discovered: Array<[string, string]> = this._discovered.map((flow) => [
flow.handler,
domainToName(this.hass.localize, flow.handler),
]);
let domains = [...entries, ...discovered].sort((a, b) =>
let uniqueDomains: Set<string> = new Set();
this._entries.forEach((entry) => {
uniqueDomains.add(entry.domain);
});
uniqueDomains = new Set([...uniqueDomains, ...this._discoveredDomains]);
let domains: Array<[string, string]> = [];
for (const domain of uniqueDomains.values()) {
domains.push([domain, domainToName(this.hass.localize, domain)]);
}
domains = domains.sort((a, b) =>
stringCompare(a[0], b[0], this.hass.locale.language)
);

const foundDevices = domains.length;
const foundIntegrations = domains.length;

if (domains.length > 12) {
const uniqueDomains: Set<string> = new Set();
domains.forEach(([domain]) => {
uniqueDomains.add(domain);
});
if (uniqueDomains.size < domains.length) {
domains = domains.filter(([domain]) => {
if (uniqueDomains.has(domain)) {
uniqueDomains.delete(domain);
return true;
}
return false;
});
}
if (domains.length > 12) {
domains = domains.slice(0, 11);
}
domains = domains.slice(0, 11);
}

return html`
Expand All @@ -152,11 +139,11 @@ class OnboardingIntegrations extends SubscribeMixin(LitElement) {
.darkOptimizedIcon=${this.hass.themes?.darkMode}
></integration-badge>`
)}
${foundDevices > domains.length
${foundIntegrations > domains.length
? html`<div class="more">
${this.onboardingLocalize(
"ui.panel.page-onboarding.integration.more_integrations",
{ count: foundDevices - domains.length }
{ count: foundIntegrations - domains.length }
)}
</div>`
: nothing}
Expand Down
8 changes: 3 additions & 5 deletions src/panels/config/storage/ha-config-section-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,14 @@ class HaConfigSectionStorage extends LitElement {
></ha-metric>
${this._hostInfo.disk_life_time !== "" &&
this._hostInfo.disk_life_time >= 10
? html`
? // prettier-ignore
html`
<ha-metric
.heading=${this.hass.localize(
"ui.panel.config.storage.emmc_lifetime_used"
)}
.value=${this._hostInfo.disk_life_time}
.tooltip=${`${
this._hostInfo.disk_life_time - 10
} % -
${this._hostInfo.disk_life_time} %`}
.tooltip=${`${this._hostInfo.disk_life_time - 10}% - ${this._hostInfo.disk_life_time}%`}
class="emmc"
></ha-metric>
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { AssistPipeline } from "../../../../data/assist_pipeline";
import { HomeAssistant } from "../../../../types";
import { fetchWakeWordInfo, WakeWord } from "../../../../data/wake_word";
import { documentationUrl } from "../../../../util/documentation-url";
import { fireEvent } from "../../../../common/dom/fire_event";

@customElement("assist-pipeline-detail-wakeword")
export class AssistPipelineDetailWakeWord extends LitElement {
Expand Down Expand Up @@ -71,6 +72,11 @@ export class AssistPipelineDetailWakeWord extends LitElement {
changedProps.has("data") &&
changedProps.get("data")?.wake_word_entity !== this.data?.wake_word_entity
) {
if (this.data?.wake_word_id) {
fireEvent(this, "value-changed", {
value: { ...this.data, wake_word_id: undefined },
});
}
this._fetchWakeWords();
}
}
Expand Down Expand Up @@ -122,13 +128,25 @@ export class AssistPipelineDetailWakeWord extends LitElement {
}

private async _fetchWakeWords() {
this._wakeWords = undefined;
if (!this.data?.wake_word_entity) {
this._wakeWords = undefined;
return;
}
this._wakeWords = (
await fetchWakeWordInfo(this.hass, this.data.wake_word_entity)
).wake_words;
const wakeWordEntity = this.data.wake_word_entity;
const wakewordInfo = await fetchWakeWordInfo(this.hass, wakeWordEntity);
if (this.data.wake_word_entity !== wakeWordEntity) {
// wake word entity changed while we were fetching
return;
}
this._wakeWords = wakewordInfo.wake_words;
if (
!this.data?.wake_word_id ||
!this._wakeWords.some((ww) => ww.id === this.data!.wake_word_id)
) {
fireEvent(this, "value-changed", {
value: { ...this.data, wake_word_id: this._wakeWords[0]?.id },
});
}
}

static get styles(): CSSResultGroup {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ export class AssistPipelineRunDebug extends LitElement {
const url = updatedRun.tts!.tts_output!.url;
const audio = new Audio(url);
audio.addEventListener("ended", () => {
if (this._continueConversationCheckbox.checked) {
if (
this.isConnected &&
this._continueConversationCheckbox.checked
) {
this._runAudioWakeWordPipeline();
} else {
this._finished = true;
Expand Down Expand Up @@ -320,7 +323,10 @@ export class AssistPipelineRunDebug extends LitElement {
const url = updatedRun.tts!.tts_output!.url;
const audio = new Audio(url);
audio.addEventListener("ended", () => {
if (this._continueConversationCheckbox.checked) {
if (
this.isConnected &&
this._continueConversationCheckbox.checked
) {
this._runAudioPipeline();
} else {
this._finished = true;
Expand Down
2 changes: 1 addition & 1 deletion src/resources/ha-style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "@polymer/polymer/lib/elements/custom-style";
import { derivedStyles } from "./styles";
import { derivedStyles } from "./styles-data";

export const DEFAULT_PRIMARY_COLOR = "#03a9f4";
export const DEFAULT_ACCENT_COLOR = "#ff9800";
Expand Down
Loading