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
tabindex="-1"
.id=${schema.name}
.name=${schema.name}
.type=${inputType}
.value=${this.stepData[schema.name] || ""}
.autocomplete=${schema.autocomplete}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,8 +36,6 @@ class HaAppLayout extends customElements.get("app-header-layout") {
*/
position: relative;
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"]) {
@ -82,6 +80,8 @@ class HaAppLayout extends customElements.get("app-header-layout") {
transform: translate(0);
margin-left: env(safe-area-inset-left);
margin-right: env(safe-area-inset-right);
padding-top: env(safe-area-inset-top);
padding-bottom: env(safe-area-inset-bottom);
}
@media print {

View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@ export class HuiStatisticCard extends LitElement implements LovelaceCard {
return {
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 {
title?: string;
name?: string;
entities: Array<EntityConfig | string>;
period: {
fixed_period?: { start: string; end: string };

View File

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