diff --git a/setup.py b/setup.py index eab4678df1..5f057d036e 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20210802.0", + version="20210803.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/frontend", author="The Home Assistant Authors", diff --git a/src/onboarding/onboarding-core-config.ts b/src/onboarding/onboarding-core-config.ts index cf330ea87d..982e6e4988 100644 --- a/src/onboarding/onboarding-core-config.ts +++ b/src/onboarding/onboarding-core-config.ts @@ -8,6 +8,7 @@ import { customElement, property, state } from "lit/decorators"; import memoizeOne from "memoize-one"; import { fireEvent } from "../common/dom/fire_event"; import type { LocalizeFunc } from "../common/translations/localize"; +import { createCurrencyListEl } from "../components/currency-datalist"; import "../components/map/ha-locations-editor"; import type { MarkerLocation } from "../components/map/ha-locations-editor"; import { createTimezoneListEl } from "../components/timezone-datalist"; @@ -16,11 +17,12 @@ import { detectCoreConfig, saveCoreConfig, } from "../data/core"; +import { SYMBOL_TO_ISO } from "../data/currency"; import { onboardCoreConfigStep } from "../data/onboarding"; import type { PolymerChangedEvent } from "../polymer-types"; import type { HomeAssistant } from "../types"; -const amsterdam = [52.3731339, 4.8903147]; +const amsterdam: [number, number] = [52.3731339, 4.8903147]; const mql = matchMedia("(prefers-color-scheme: dark)"); @customElement("onboarding-core-config") @@ -31,15 +33,17 @@ class OnboardingCoreConfig extends LitElement { @state() private _working = false; - @state() private _name!: ConfigUpdateValues["location_name"]; + @state() private _name?: ConfigUpdateValues["location_name"]; - @state() private _location!: [number, number]; + @state() private _location?: [number, number]; - @state() private _elevation!: string; + @state() private _elevation?: string; - @state() private _unitSystem!: ConfigUpdateValues["unit_system"]; + @state() private _unitSystem?: ConfigUpdateValues["unit_system"]; - @state() private _timeZone!: string; + @state() private _currency?: ConfigUpdateValues["currency"]; + + @state() private _timeZone?: string; protected render(): TemplateResult { return html` @@ -159,6 +163,35 @@ class OnboardingCoreConfig extends LitElement { +
+
+ ${this.hass.localize( + "ui.panel.config.core.section.core.core_config.currency" + )}
+ ${this.hass.localize( + "ui.panel.config.core.section.core.core_config.find_currency_value" + )} +
+ + +
+ + `; } + private _pickToday() { + this._setDate(startOfToday()); + } + private _pickPreviousDay() { this._setDate(addDays(this._startDate!, -1)); } @@ -83,12 +89,30 @@ export class HuiEnergyPeriodSelector extends SubscribeMixin(LitElement) { .row { display: flex; align-items: center; + justify-content: flex-end; } .label { - flex: 1; + padding: 0 8px; text-align: center; font-size: 20px; } + mwc-icon-button { + --mdc-icon-button-size: 28px; + } + mwc-button { + padding-left: 8px; + --mdc-theme-primary: currentColor; + --mdc-button-outline-color: currentColor; + + --mdc-button-disabled-outline-color: rgba( + var(--rgb-text-primary-color), + 0.5 + ); + --mdc-button-disabled-ink-color: rgba( + var(--rgb-text-primary-color), + 0.5 + ); + } `; } } diff --git a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts index ab670415a6..7bbf791059 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts @@ -60,9 +60,9 @@ export class HuiViewEditor extends LitElement { get _type(): string { if (!this._config) { - return "masonary"; + return "masonry"; } - return this._config.panel ? "panel" : this._config.type || "masonary"; + return this._config.panel ? "panel" : this._config.type || "masonry"; } set config(config: LovelaceViewConfig) { @@ -125,7 +125,7 @@ export class HuiViewEditor extends LitElement { attr-for-selected="type" @iron-select=${this._typeChanged} > - ${["masonary", "sidebar", "panel"].map( + ${["masonry", "sidebar", "panel"].map( (type) => html` ${this.hass.localize( `ui.panel.lovelace.editor.edit_view.types.${type}` @@ -167,7 +167,7 @@ export class HuiViewEditor extends LitElement { ...this._config, }; delete newConfig.panel; - if (selected === "masonary") { + if (selected === "masonry") { delete newConfig.type; } else { newConfig.type = selected; diff --git a/src/translations/en.json b/src/translations/en.json index 134baaea93..e2439ad3c7 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1052,7 +1052,10 @@ "sub": "Tracking the energy usage of individual devices allows Home Assistant to break down your energy usage by device.", "learn_more": "More information on how to get started.", "add_stat": "Pick entity to track energy of", - "selected_stat": "Tracking energy for" + "selected_stat": "Tracking energy for", + "dialog": { + "selected_stat_intro": "Select the entity that represents the device energy usage." + } } }, "helpers": { @@ -2943,7 +2946,7 @@ }, "type": "View type", "types": { - "masonary": "Masonary (default)", + "masonry": "Masonry (default)", "sidebar": "Sidebar", "panel": "Panel (1 card)" }