Merge pull request #13199 from home-assistant/2022.7-hotfix

This commit is contained in:
Zack Barett 2022-07-14 17:26:04 -05:00 committed by GitHub
commit 666ef7a978
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

View File

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

View File

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

View File

@ -3,15 +3,15 @@ import {
CSSResultGroup, CSSResultGroup,
html, html,
LitElement, LitElement,
TemplateResult,
PropertyValues, PropertyValues,
TemplateResult,
} from "lit"; } from "lit";
import { customElement, property, query } from "lit/decorators"; import { customElement, property, query } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event"; import { fireEvent } from "../../common/dom/fire_event";
import { HaCheckbox } from "../ha-checkbox"; import { HaCheckbox } from "../ha-checkbox";
import { HaFormElement, HaFormIntegerData, HaFormIntegerSchema } from "./types";
import "../ha-slider"; import "../ha-slider";
import { HaTextField } from "../ha-textfield"; import { HaTextField } from "../ha-textfield";
import { HaFormElement, HaFormIntegerData, HaFormIntegerSchema } from "./types";
@customElement("ha-form-integer") @customElement("ha-form-integer")
export class HaFormInteger extends LitElement implements HaFormElement { export class HaFormInteger extends LitElement implements HaFormElement {
@ -105,7 +105,7 @@ export class HaFormInteger extends LitElement implements HaFormElement {
} }
return ( return (
this.schema.description?.suggested_value || this.schema.description?.suggested_value !== undefined ||
this.schema.default || this.schema.default ||
this.schema.valueMin || this.schema.valueMin ||
0 0

View File

@ -199,13 +199,15 @@ export const getWeatherUnit = (
case "visibility": case "visibility":
return stateObj.attributes.visibility_unit || lengthUnit; return stateObj.attributes.visibility_unit || lengthUnit;
case "precipitation": case "precipitation":
return stateObj.attributes.precipitation_unit || lengthUnit === "km" return (
? "mm" stateObj.attributes.precipitation_unit ||
: "in"; (lengthUnit === "km" ? "mm" : "in")
);
case "pressure": case "pressure":
return stateObj.attributes.pressure_unit || lengthUnit === "km" return (
? "hPa" stateObj.attributes.pressure_unit ||
: "inHg"; (lengthUnit === "km" ? "hPa" : "inHg")
);
case "temperature": case "temperature":
return ( return (
stateObj.attributes.temperature_unit || stateObj.attributes.temperature_unit ||