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]
name = "home-assistant-frontend"
version = "20220707.0"
version = "20220707.1"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"

View File

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

View File

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

View File

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