20230705.1 (#17169)

This commit is contained in:
Bram Kragten 2023-07-05 15:47:43 +02:00 committed by GitHub
commit d7e0dac4e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 97 additions and 34 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,7 @@
import fs from "fs/promises";
import gulp from "gulp";
import mapStream from "map-stream";
import transform from "gulp-json-transform";
const inDirFrontend = "translations/frontend";
const inDirBackend = "translations/backend";
@ -41,9 +42,35 @@ function checkHtml() {
});
}
// Backend translations do not currently pass HTML check so are excluded here for now
function convertBackendTranslations(data, _file) {
const output = { component: {} };
if (!data.component) {
return output;
}
Object.keys(data.component).forEach((domain) => {
if (!("entity_component" in data.component[domain])) {
return;
}
output.component[domain] = { entity_component: {} };
Object.keys(data.component[domain].entity_component).forEach((key) => {
output.component[domain].entity_component[key] =
data.component[domain].entity_component[key];
});
});
return output;
}
gulp.task("convert-backend-translations", function () {
return gulp
.src([`${inDirBackend}/*.json`])
.pipe(transform((data, file) => convertBackendTranslations(data, file)))
.pipe(gulp.dest(inDirBackend));
});
gulp.task("check-translations-html", function () {
return gulp.src([`${inDirFrontend}/*.json`]).pipe(checkHtml());
return gulp
.src([`${inDirFrontend}/*.json`, `${inDirBackend}/*.json`])
.pipe(checkHtml());
});
gulp.task("check-all-files-exist", async function () {
@ -65,5 +92,9 @@ gulp.task("check-all-files-exist", async function () {
gulp.task(
"check-downloaded-translations",
gulp.series("check-translations-html", "check-all-files-exist")
gulp.series(
"convert-backend-translations",
"check-translations-html",
"check-all-files-exist"
)
);

View File

@ -162,6 +162,7 @@ export class DemoAutomationDescribeAction extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("config", "en");
hass.addEntities(ENTITIES);
}

View File

@ -89,6 +89,7 @@ export class DemoAutomationDescribeCondition extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("config", "en");
hass.addEntities(ENTITIES);
}

View File

@ -40,6 +40,7 @@ const triggers = [
},
{ platform: "sun", event: "sunset" },
{ platform: "time_pattern" },
{ platform: "time_pattern", hours: "*", minutes: "/5", seconds: "10" },
{ platform: "webhook" },
{ platform: "persistent_notification" },
{
@ -105,6 +106,7 @@ export class DemoAutomationDescribeTrigger extends LitElement {
super.firstUpdated(changedProps);
const hass = provideHass(this);
hass.updateTranslations(null, "en");
hass.updateTranslations("config", "en");
hass.addEntities(ENTITIES);
}

View File

@ -265,6 +265,8 @@ export class DemoIntegrationCard extends LitElement {
></ha-config-flow-card>
`
)}
</div>
<div class="container">
${configEntries.map(
(info) => html`
<ha-integration-card
@ -338,10 +340,10 @@ export class DemoIntegrationCard extends LitElement {
return css`
.container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
grid-gap: 16px 16px;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-gap: 8px 8px;
padding: 8px 16px 16px;
margin-bottom: 64px;
margin-bottom: 16px;
}
.container > * {

View File

@ -176,7 +176,7 @@
"@types/js-yaml": "4.0.5",
"@types/leaflet": "1.9.3",
"@types/leaflet-draw": "1.0.7",
"@types/luxon": "^3",
"@types/luxon": "3.3.0",
"@types/marked": "4.3.1",
"@types/mocha": "10.0.1",
"@types/qrcode": "1.5.1",
@ -253,7 +253,8 @@
"resolutions": {
"@polymer/polymer": "patch:@polymer/polymer@3.5.1#./.yarn/patches/@polymer/polymer/pr-5569.patch",
"@material/mwc-button@^0.25.3": "^0.27.0",
"sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch"
"sortablejs@1.15.0": "patch:sortablejs@npm%3A1.15.0#./.yarn/patches/sortablejs-npm-1.15.0-f3a393abcc.patch",
"leaflet-draw@1.0.4": "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
},
"prettier": {
"trailingComma": "es5",

View File

@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "home-assistant-frontend"
version = "20230705.0"
version = "20230705.1"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"

View File

@ -397,12 +397,10 @@ const tryDescribeTrigger = (
}
// Time Pattern Trigger
if (
trigger.platform === "time_pattern" &&
(trigger.seconds !== undefined ||
trigger.minutes !== undefined ||
trigger.hours !== undefined)
) {
if (trigger.platform === "time_pattern") {
if (!trigger.seconds && !trigger.minutes && !trigger.hours) {
return "When a time pattern matches";
}
let result = "Trigger ";
if (trigger.seconds !== undefined) {
const seconds_all = trigger.seconds === "*";

View File

@ -189,7 +189,7 @@ const tryDescribeAction = <T extends ActionType>(
duration = hass.localize(
`${actionTranslationBaseKey}.delay.description.duration_string`,
{
duration: secondsToDuration(config.delay)!,
string: secondsToDuration(config.delay)!,
}
);
} else if (typeof config.delay === "string") {
@ -200,7 +200,7 @@ const tryDescribeAction = <T extends ActionType>(
: hass.localize(
`${actionTranslationBaseKey}.delay.description.duration_string`,
{
duration:
string:
config.delay ||
hass.localize(
`${actionTranslationBaseKey}.delay.description.duration_unknown`
@ -211,14 +211,14 @@ const tryDescribeAction = <T extends ActionType>(
duration = hass.localize(
`${actionTranslationBaseKey}.delay.description.duration_string`,
{
duration: formatDuration(config.delay),
string: formatDuration(config.delay),
}
);
} else {
duration = hass.localize(
`${actionTranslationBaseKey}.delay.description.duration_string`,
{
duration: hass.localize(
string: hass.localize(
`${actionTranslationBaseKey}.delay.description.duration_unknown`
),
}

View File

@ -16,6 +16,9 @@ import type { HomeAssistant } from "../../../types";
import { documentationUrl } from "../../../util/documentation-url";
import type { DataEntryFlowProgressExtended } from "./ha-config-integrations";
import "./ha-integration-action-card";
import "../../../components/ha-button-menu";
import "../../../components/ha-button";
import "../../../components/ha-list-item";
@customElement("ha-config-flow-card")
export class HaConfigFlowCard extends LitElement {
@ -37,7 +40,7 @@ export class HaConfigFlowCard extends LitElement {
.domain=${this.flow.handler}
.label=${this.flow.localized_title}
>
<mwc-button
<ha-button
unelevated
@click=${this._continueFlow}
.label=${this.hass.localize(
@ -45,15 +48,15 @@ export class HaConfigFlowCard extends LitElement {
attention ? "reconfigure" : "configure"
}`
)}
></mwc-button>
></ha-button>
${DISCOVERY_SOURCES.includes(this.flow.context.source) &&
this.flow.context.unique_id
? html`<mwc-button
? html`<ha-button
@click=${this._ignoreFlow}
.label=${this.hass.localize(
"ui.panel.config.integrations.ignore.ignore"
)}
></mwc-button>`
></ha-button>`
: ""}
${this.flow.context.configuration_url || this.manifest
? html`<ha-button-menu slot="header-button">
@ -75,7 +78,7 @@ export class HaConfigFlowCard extends LitElement {
? "_self"
: "_blank"}
>
<mwc-list-item graphic="icon" hasMeta>
<ha-list-item graphic="icon" hasMeta>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.open_configuration_url"
)}
@ -84,7 +87,7 @@ export class HaConfigFlowCard extends LitElement {
slot="meta"
.path=${mdiOpenInNew}
></ha-svg-icon>
</mwc-list-item>
</ha-list-item>
</a>`
: ""}
${this.manifest
@ -98,7 +101,7 @@ export class HaConfigFlowCard extends LitElement {
rel="noreferrer"
target="_blank"
>
<mwc-list-item graphic="icon" hasMeta>
<ha-list-item graphic="icon" hasMeta>
${this.hass.localize(
"ui.panel.config.integrations.config_entry.documentation"
)}
@ -110,7 +113,7 @@ export class HaConfigFlowCard extends LitElement {
slot="meta"
.path=${mdiOpenInNew}
></ha-svg-icon>
</mwc-list-item>
</ha-list-item>
</a>`
: ""}
</ha-button-menu>`
@ -171,6 +174,10 @@ export class HaConfigFlowCard extends LitElement {
width: 18px;
height: 18px;
}
.attention {
--mdc-theme-primary: var(--error-color);
--ha-card-border-color: var(--error-color);
}
`;
}

View File

@ -7,6 +7,7 @@ import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box
import type { HomeAssistant } from "../../../types";
import type { ConfigEntryExtended } from "./ha-config-integrations";
import "./ha-integration-action-card";
import "../../../components/ha-button";
@customElement("ha-ignored-config-entry-card")
export class HaIgnoredConfigEntryCard extends LitElement {
@ -32,12 +33,12 @@ export class HaIgnoredConfigEntryCard extends LitElement {
this.entry.localized_domain_name
: this.entry.title}
>
<mwc-button
<ha-button
@click=${this._removeIgnoredIntegration}
.label=${this.hass.localize(
"ui.panel.config.integrations.ignore.stop_ignore"
)}
></mwc-button>
></ha-button>
</ha-integration-action-card>
`;
}
@ -76,7 +77,7 @@ export class HaIgnoredConfigEntryCard extends LitElement {
--state-color: var(--divider-color, #e0e0e0);
}
mwc-button {
ha-button {
--mdc-theme-primary: var(--primary-color);
}
`;

View File

@ -1,6 +1,4 @@
import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
import "@material/mwc-button";
import "@material/mwc-list";
import "@material/mwc-ripple";
import type { Ripple } from "@material/mwc-ripple";
import { RippleHandlers } from "@material/mwc-ripple/ripple-handlers";
@ -24,6 +22,7 @@ import { classMap } from "lit/directives/class-map";
import memoizeOne from "memoize-one";
import { computeRTL } from "../../../common/util/compute_rtl";
import "../../../components/ha-card";
import "../../../components/ha-button";
import "../../../components/ha-svg-icon";
import { ConfigEntry, ERROR_STATES } from "../../../data/config_entries";
import type { DeviceRegistryEntry } from "../../../data/device_registry";

View File

@ -4453,7 +4453,7 @@ __metadata:
languageName: node
linkType: hard
"@types/luxon@npm:^3":
"@types/luxon@npm:3.3.0":
version: 3.3.0
resolution: "@types/luxon@npm:3.3.0"
checksum: f7e3a89fc3ca404fbc3ea538653ed6860bc28f570a8c4d6d24449b89b9b553b7d6ad6cc94a9e129c5b8c9a2b97f0c365b3017f811e59c4a859a9c219a1c918e0
@ -9706,7 +9706,7 @@ __metadata:
"@types/js-yaml": 4.0.5
"@types/leaflet": 1.9.3
"@types/leaflet-draw": 1.0.7
"@types/luxon": ^3
"@types/luxon": 3.3.0
"@types/marked": 4.3.1
"@types/mocha": 10.0.1
"@types/qrcode": 1.5.1
@ -11280,6 +11280,13 @@ __metadata:
languageName: node
linkType: hard
"leaflet-draw@patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch::locator=home-assistant-frontend%40workspace%3A.":
version: 1.0.4
resolution: "leaflet-draw@patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch::version=1.0.4&hash=790842&locator=home-assistant-frontend%40workspace%3A."
checksum: 27507da4eb99090d103a8762eba46333df2e4fcfc6ef17f22a5a8c21c255f01565b0cbdc692bdccadccaab121dff05b49a5a44f47de7352f039a6af66514f6ab
languageName: node
linkType: hard
"leaflet@npm:1.9.4":
version: 1.9.4
resolution: "leaflet@npm:1.9.4"