20221102.1 (#14264)

This commit is contained in:
Bram Kragten 2022-11-02 19:15:35 +01:00 committed by GitHub
commit 663c58512d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 32 additions and 13 deletions

View File

@ -92,6 +92,7 @@ export class HaPasswordManagerPolyfill extends LitElement {
<input <input
tabindex="-1" tabindex="-1"
.id=${schema.name} .id=${schema.name}
.name=${schema.name}
.type=${inputType} .type=${inputType}
.value=${this.stepData[schema.name] || ""} .value=${this.stepData[schema.name] || ""}
.autocomplete=${schema.autocomplete} .autocomplete=${schema.autocomplete}

View File

@ -60,6 +60,7 @@ export class HaFormString extends LitElement implements HaFormElement {
.disabled=${this.disabled} .disabled=${this.disabled}
.required=${this.schema.required} .required=${this.schema.required}
.autoValidate=${this.schema.required} .autoValidate=${this.schema.required}
.name=${this.schema.name}
.autocomplete=${this.schema.autocomplete} .autocomplete=${this.schema.autocomplete}
.suffix=${isPassword .suffix=${isPassword
? // reserve some space for the icon. ? // reserve some space for the icon.

View File

@ -81,6 +81,7 @@ export class HaForm extends LitElement implements HaFormElement {
? html`<ha-selector ? html`<ha-selector
.schema=${item} .schema=${item}
.hass=${this.hass} .hass=${this.hass}
.name=${item.name}
.selector=${item.selector} .selector=${item.selector}
.value=${getValue(this.data, item)} .value=${getValue(this.data, item)}
.label=${this._computeLabel(item, this.data)} .label=${this._computeLabel(item, this.data)}

View File

@ -14,6 +14,8 @@ export class HaTextSelector extends LitElement {
@property() public value?: any; @property() public value?: any;
@property() public name?: string;
@property() public label?: string; @property() public label?: string;
@property() public placeholder?: string; @property() public placeholder?: string;
@ -31,6 +33,7 @@ export class HaTextSelector extends LitElement {
protected render() { protected render() {
if (this.selector.text?.multiline) { if (this.selector.text?.multiline) {
return html`<ha-textarea return html`<ha-textarea
.name=${this.name}
.label=${this.label} .label=${this.label}
.placeholder=${this.placeholder} .placeholder=${this.placeholder}
.value=${this.value || ""} .value=${this.value || ""}
@ -46,6 +49,7 @@ export class HaTextSelector extends LitElement {
></ha-textarea>`; ></ha-textarea>`;
} }
return html`<ha-textfield return html`<ha-textfield
.name=${this.name}
.value=${this.value || ""} .value=${this.value || ""}
.placeholder=${this.placeholder || ""} .placeholder=${this.placeholder || ""}
.helper=${this.helper} .helper=${this.helper}

View File

@ -40,6 +40,8 @@ const LOAD_ELEMENTS = {
export class HaSelector extends LitElement { export class HaSelector extends LitElement {
@property() public hass!: HomeAssistant; @property() public hass!: HomeAssistant;
@property() public name?: string;
@property() public selector!: Selector; @property() public selector!: Selector;
@property() public value?: any; @property() public value?: any;
@ -74,6 +76,7 @@ export class HaSelector extends LitElement {
return html` return html`
${dynamicElement(`ha-selector-${this._type}`, { ${dynamicElement(`ha-selector-${this._type}`, {
hass: this.hass, hass: this.hass,
name: this.name,
selector: this.selector, selector: this.selector,
value: this.value, value: this.value,
label: this.label, label: this.label,

View File

@ -273,14 +273,15 @@ export interface EnergyData {
export const getReferencedStatisticIds = ( export const getReferencedStatisticIds = (
prefs: EnergyPreferences, prefs: EnergyPreferences,
info: EnergyInfo, info: EnergyInfo,
exclude?: string[] includeTypes?: string[]
): string[] => { ): string[] => {
const statIDs: string[] = []; const statIDs: string[] = [];
for (const source of prefs.energy_sources) { for (const source of prefs.energy_sources) {
if (exclude?.includes(source.type)) { if (includeTypes && !includeTypes.includes(source.type)) {
continue; continue;
} }
if (source.type === "solar") { if (source.type === "solar") {
statIDs.push(source.stat_energy_from); statIDs.push(source.stat_energy_from);
continue; continue;
@ -288,6 +289,7 @@ export const getReferencedStatisticIds = (
if (source.type === "gas" || source.type === "water") { if (source.type === "gas" || source.type === "water") {
statIDs.push(source.stat_energy_from); statIDs.push(source.stat_energy_from);
if (source.stat_cost) { if (source.stat_cost) {
statIDs.push(source.stat_cost); statIDs.push(source.stat_cost);
} }
@ -366,7 +368,6 @@ const getEnergyData = async (
} }
} }
const waterStatIds: string[] = [];
const consumptionStatIDs: string[] = []; const consumptionStatIDs: string[] = [];
for (const source of prefs.energy_sources) { for (const source of prefs.energy_sources) {
// grid source // grid source
@ -375,11 +376,14 @@ const getEnergyData = async (
consumptionStatIDs.push(flowFrom.stat_energy_from); consumptionStatIDs.push(flowFrom.stat_energy_from);
} }
} }
if (source.type === "water") {
waterStatIds.push(source.stat_energy_from);
}
} }
const energyStatIds = getReferencedStatisticIds(prefs, info, ["water"]); const energyStatIds = getReferencedStatisticIds(prefs, info, [
"grid",
"solar",
"battery",
"gas",
]);
const waterStatIds = getReferencedStatisticIds(prefs, info, ["water"]);
const allStatIDs = [...energyStatIds, ...waterStatIds]; const allStatIDs = [...energyStatIds, ...waterStatIds];

View File

@ -36,8 +36,6 @@ class HaAppLayout extends customElements.get("app-header-layout") {
*/ */
position: relative; position: relative;
z-index: 0; z-index: 0;
padding: env(safe-area-inset-top) env(safe-area-inset-right)
env(safe-area-inset-bottom) env(safe-area-inset-left);
} }
#wrapper ::slotted([slot="header"]) { #wrapper ::slotted([slot="header"]) {
@ -82,6 +80,8 @@ class HaAppLayout extends customElements.get("app-header-layout") {
transform: translate(0); transform: translate(0);
margin-left: env(safe-area-inset-left); margin-left: env(safe-area-inset-left);
margin-right: env(safe-area-inset-right); margin-right: env(safe-area-inset-right);
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
} }
@media print { @media print {

View File

@ -113,6 +113,7 @@ export class CloudLogin extends LitElement {
"ui.panel.config.cloud.login.email" "ui.panel.config.cloud.login.email"
)} )}
id="email" id="email"
name="username"
type="email" type="email"
autocomplete="username" autocomplete="username"
required required
@ -125,6 +126,7 @@ export class CloudLogin extends LitElement {
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
id="password" id="password"
name="password"
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.panel.config.cloud.login.password" "ui.panel.config.cloud.login.password"
)} )}

View File

@ -132,6 +132,7 @@ export class CloudRegister extends LitElement {
<ha-textfield <ha-textfield
autofocus autofocus
id="email" id="email"
name="email"
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.panel.config.cloud.register.email_address" "ui.panel.config.cloud.register.email_address"
)} )}
@ -146,6 +147,7 @@ export class CloudRegister extends LitElement {
></ha-textfield> ></ha-textfield>
<ha-textfield <ha-textfield
id="password" id="password"
name="password"
label="Password" label="Password"
.value=${this._password} .value=${this._password}
type="password" type="password"

View File

@ -20,7 +20,7 @@ const SCHEMA = [
selector: { selector: {
text: { text: {
type: "password", type: "password",
autofill: "new-password", autocomplete: "new-password",
}, },
}, },
}, },
@ -30,7 +30,7 @@ const SCHEMA = [
selector: { selector: {
text: { text: {
type: "password", type: "password",
autofill: "new-password", autocomplete: "new-password",
}, },
}, },
}, },

View File

@ -61,7 +61,7 @@ export class HuiStatisticCard extends LitElement implements LovelaceCard {
return { return {
entity: foundEntities[0] || "", entity: foundEntities[0] || "",
period: { calendar: { period: "month", offset: 0 } }, period: { calendar: { period: "month" } },
}; };
} }

View File

@ -311,7 +311,7 @@ export interface StatisticsGraphCardConfig extends LovelaceCardConfig {
} }
export interface StatisticCardConfig extends LovelaceCardConfig { export interface StatisticCardConfig extends LovelaceCardConfig {
title?: string; name?: string;
entities: Array<EntityConfig | string>; entities: Array<EntityConfig | string>;
period: { period: {
fixed_period?: { start: string; end: string }; fixed_period?: { start: string; end: string };

View File

@ -51,6 +51,7 @@ class HaChangePasswordCard extends LitElement {
<ha-textfield <ha-textfield
id="currentPassword" id="currentPassword"
name="currentPassword"
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.panel.profile.change_password.current_password" "ui.panel.profile.change_password.current_password"
)} )}