Bastian 2025-06-16 11:13:53 +02:00 committed by GitHub
commit 96d851a25e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 9 deletions

View File

@ -5,6 +5,7 @@ import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/ha-checkbox"; import "../../../../components/ha-checkbox";
import "../../../../components/ha-formfield"; import "../../../../components/ha-formfield";
import "../../../../components/ha-icon-picker"; import "../../../../components/ha-icon-picker";
import "../../../../components/ha-time-input";
import "../../../../components/ha-textfield"; import "../../../../components/ha-textfield";
import type { DurationDict, Timer } from "../../../../data/timer"; import type { DurationDict, Timer } from "../../../../data/timer";
import { haStyle } from "../../../../resources/styles"; import { haStyle } from "../../../../resources/styles";
@ -16,6 +17,8 @@ class HaTimerForm extends LitElement {
@property({ type: Boolean }) public new = false; @property({ type: Boolean }) public new = false;
@property({ attribute: "enable-second", type: Boolean }) enableSecond = true;
private _item?: Timer; private _item?: Timer;
@state() private _name!: string; @state() private _name!: string;
@ -79,14 +82,14 @@ class HaTimerForm extends LitElement {
"ui.dialogs.helper_settings.generic.icon" "ui.dialogs.helper_settings.generic.icon"
)} )}
></ha-icon-picker> ></ha-icon-picker>
<ha-textfield <ha-time-input
.configValue=${"duration"} .configValue=${"duration"}
.value=${this._duration} .value=${this._duration}
@input=${this._valueChanged} .locale=${this.hass.locale}
.label=${this.hass.localize( clearable
"ui.dialogs.helper_settings.timer.duration" .enableSecond=${this.enableSecond}
)} @value-changed=${this._valueChanged}
></ha-textfield> ></ha-time-input>
<ha-formfield <ha-formfield
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.dialogs.helper_settings.timer.restore" "ui.dialogs.helper_settings.timer.restore"
@ -138,7 +141,8 @@ class HaTimerForm extends LitElement {
.form { .form {
color: var(--primary-text-color); color: var(--primary-text-color);
} }
ha-textfield { ha-textfield,
ha-time-input {
display: block; display: block;
margin: 8px 0; margin: 8px 0;
} }