Merge pull request #13329 from home-assistant/dev

This commit is contained in:
Zack Barett 2022-08-02 10:20:21 -05:00 committed by GitHub
commit df4b83349e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 59 additions and 30 deletions

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 90 days stale policy
uses: actions/stale@v5.1.0
uses: actions/stale@v5.1.1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 90

View File

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

View File

@ -1,5 +1,4 @@
import "@material/mwc-list/mwc-list-item";
import "./ha-select";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { customElement, property } from "lit/decorators";
import memoizeOne from "memoize-one";
@ -8,6 +7,7 @@ import { stopPropagation } from "../common/dom/stop_propagation";
import { stringCompare } from "../common/string/compare";
import { Blueprint, Blueprints, fetchBlueprints } from "../data/blueprint";
import { HomeAssistant } from "../types";
import "./ha-select";
@customElement("ha-blueprint-picker")
class HaBluePrintPicker extends LitElement {
@ -59,11 +59,6 @@ class HaBluePrintPicker extends LitElement {
@selected=${this._blueprintChanged}
@closed=${stopPropagation}
>
<mwc-list-item value="">
${this.hass.localize(
"ui.components.blueprint-picker.select_blueprint"
)}
</mwc-list-item>
${this._processedBlueprints(this.blueprints).map(
(blueprint) => html`
<mwc-list-item .value=${blueprint.path}>

View File

@ -6,7 +6,10 @@ export const computeInitialHaFormData = (
): Record<string, any> => {
const data = {};
schema.forEach((field) => {
if (field.description?.suggested_value !== undefined) {
if (
field.description?.suggested_value !== undefined &&
field.description?.suggested_value !== null
) {
data[field.name] = field.description.suggested_value;
} else if ("default" in field) {
data[field.name] = field.default;

View File

@ -105,7 +105,8 @@ export class HaFormInteger extends LitElement implements HaFormElement {
}
return (
this.schema.description?.suggested_value !== undefined ||
(this.schema.description?.suggested_value !== undefined &&
this.schema.description?.suggested_value !== null) ||
this.schema.default ||
this.schema.valueMin ||
0

View File

@ -11,24 +11,24 @@ import {
} from "lit";
import { customElement, property, state } from "lit/decorators";
import { computeDomain } from "../../../../common/entity/compute_domain";
import { computeStateName } from "../../../../common/entity/compute_state_name";
import { domainIcon } from "../../../../common/entity/domain_icon";
import { stripPrefixFromEntityName } from "../../../../common/entity/strip_prefix_from_entity_name";
import "../../../../components/entity/state-badge";
import "../../../../components/ha-card";
import "../../../../components/ha-icon";
import type { LovelaceRowConfig } from "../../../lovelace/entity-rows/types";
import type { HomeAssistant } from "../../../../types";
import type { HuiErrorCard } from "../../../lovelace/cards/hui-error-card";
import { createRowElement } from "../../../lovelace/create-element/create-row-element";
import { addEntitiesToLovelaceView } from "../../../lovelace/editor/add-entities-to-view";
import { LovelaceRow } from "../../../lovelace/entity-rows/types";
import { showEntityEditorDialog } from "../../entities/show-dialog-entity-editor";
import { EntityRegistryStateEntry } from "../ha-config-device-page";
import { computeStateName } from "../../../../common/entity/compute_state_name";
import { stripPrefixFromEntityName } from "../../../../common/entity/strip_prefix_from_entity_name";
import {
ExtEntityRegistryEntry,
getExtendedEntityRegistryEntry,
} from "../../../../data/entity_registry";
import type { HomeAssistant } from "../../../../types";
import type { HuiErrorCard } from "../../../lovelace/cards/hui-error-card";
import { createRowElement } from "../../../lovelace/create-element/create-row-element";
import { addEntitiesToLovelaceView } from "../../../lovelace/editor/add-entities-to-view";
import type { LovelaceRowConfig } from "../../../lovelace/entity-rows/types";
import { LovelaceRow } from "../../../lovelace/entity-rows/types";
import { showEntityEditorDialog } from "../../entities/show-dialog-entity-editor";
import { EntityRegistryStateEntry } from "../ha-config-device-page";
@customElement("ha-device-entities-card")
export class HaDeviceEntitiesCard extends LitElement {
@ -165,7 +165,7 @@ export class HaDeviceEntitiesCard extends LitElement {
const stateObj = this.hass.states[entry.entity_id];
let name = entry.name
? entry.name
? stripPrefixFromEntityName(entry.name, this.deviceName.toLowerCase())
: entry.has_entity_name
? entry.original_name || this.deviceName
: stripPrefixFromEntityName(

View File

@ -8,7 +8,6 @@ import {
mdiDevices,
mdiInformation,
mdiInformationOutline,
mdiLifebuoy,
mdiLightningBolt,
mdiMapMarkerRadius,
mdiMathLog,
@ -19,6 +18,7 @@ import {
mdiPaletteSwatch,
mdiPuzzle,
mdiRobot,
mdiScrewdriver,
mdiScriptText,
mdiShape,
mdiSofa,
@ -270,7 +270,7 @@ export const configSections: { [name: string]: PageNavigation[] } = {
{
path: "/config/repairs",
translationKey: "repairs",
iconPath: mdiLifebuoy,
iconPath: mdiScrewdriver,
iconColor: "#5c995c",
},
{

View File

@ -1,4 +1,5 @@
import "@material/mwc-button/mwc-button";
import { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item-base";
import "@polymer/paper-item/paper-icon-item";
import "@polymer/paper-tooltip/paper-tooltip";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
@ -6,6 +7,7 @@ import { customElement, property, query, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { dynamicElement } from "../../../common/dom/dynamic-element-directive";
import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event";
import "../../../components/ha-circular-progress";
import "../../../components/ha-dialog";
import { getConfigFlowHandlers } from "../../../data/config_flow";
@ -81,11 +83,15 @@ export class DialogHelperDetail extends LitElement {
public closeDialog(): void {
this._opened = false;
this._error = "";
this._error = undefined;
this._domain = undefined;
this._params = undefined;
}
protected render(): TemplateResult {
if (!this._opened) {
return html``;
}
let content: TemplateResult;
if (this._domain) {
@ -189,7 +195,7 @@ export class DialogHelperDetail extends LitElement {
return html`
<ha-dialog
.open=${this._opened}
open
@closed=${this.closeDialog}
class=${classMap({ "button-left": !this._domain })}
scrimClickAction
@ -229,7 +235,10 @@ export class DialogHelperDetail extends LitElement {
}
}
private _domainPicked(ev: Event): void {
private _domainPicked(ev: CustomEvent<RequestSelectedDetail>): void {
if (!shouldHandleRequestSelectedEvent(ev)) {
return;
}
const domain = (ev.currentTarget! as any).domain;
if (domain in HELPERS) {

View File

@ -6,6 +6,8 @@ import { customElement, property, state } from "lit/decorators";
import memoizeOne from "memoize-one";
import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event";
import { navigate } from "../../../common/navigate";
import { extractSearchParam } from "../../../common/url/search-params";
import "../../../components/ha-card";
import "../../../components/ha-check-list-item";
import {
@ -37,6 +39,17 @@ class HaConfigRepairsDashboard extends SubscribeMixin(LitElement) {
: repairsIssues.filter((issue) => !issue.ignored)
);
public connectedCallback(): void {
super.connectedCallback();
const searchParam = extractSearchParam("dialog");
if (searchParam === "system-health") {
navigate("/config/repairs", { replace: true });
showSystemInformationDialog(this);
}
}
public hassSubscribe(): UnsubscribeFunc[] {
return [
subscribeRepairsIssueRegistry(this.hass.connection!, (repairs) => {

View File

@ -281,7 +281,7 @@ class HaPanelDevStatistics extends SubscribeMixin(LitElement) {
});
break;
case "unsupported_state_class":
showAlertDialog(this, {
showConfirmationDialog(this, {
title: "Unsupported state class",
text: html`The state class of this entity, ${issue.data.state_class}
is not supported. <br />Statistics can not be generated until this
@ -296,7 +296,15 @@ class HaPanelDevStatistics extends SubscribeMixin(LitElement) {
rel="noreferrer noopener"
>
developer documentation</a
>.`,
>. If the state class has permanently changed, you may want to
remove the long term statistics of it from your database.<br /><br />Do
you want to permanently remove the long term statistics of
${issue.data.statistic_id} from your database?`,
confirmText: this.hass.localize("ui.common.remove"),
confirm: async () => {
await clearStatistics(this.hass, [issue.data.statistic_id]);
this._validateStatistics();
},
});
break;
case "unsupported_unit_metadata":

View File

@ -157,7 +157,7 @@ export const getMyRedirects = (hasSupervisor: boolean): Redirects => ({
redirect: "/config/info",
},
system_health: {
redirect: "/config/system_health",
redirect: "/config/repairs?dialog=system-health",
},
hardware: {
redirect: "/config/hardware",

View File

@ -30,7 +30,7 @@ class StateCardNumber extends mixinBehaviors(
.sliderstate {
min-width: 45px;
}
ha-slider[hidden] {
[hidden] {
display: none !important;
}
ha-textfield {