diff --git a/pyproject.toml b/pyproject.toml index 7eb2cd6854..9ccb502873 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/components/ha-form/compute-initial-ha-form-data.ts b/src/components/ha-form/compute-initial-ha-form-data.ts index b70148fa86..b83835ad70 100644 --- a/src/components/ha-form/compute-initial-ha-form-data.ts +++ b/src/components/ha-form/compute-initial-ha-form-data.ts @@ -6,7 +6,7 @@ export const computeInitialHaFormData = ( ): Record => { 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; diff --git a/src/components/ha-form/ha-form-integer.ts b/src/components/ha-form/ha-form-integer.ts index 5873eff158..e71425ba27 100644 --- a/src/components/ha-form/ha-form-integer.ts +++ b/src/components/ha-form/ha-form-integer.ts @@ -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 diff --git a/src/data/weather.ts b/src/data/weather.ts index f77da5c9b0..6c2fb20fcb 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -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 ||