Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/common/datetime/create_duration_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { ForDict } from "../../data/automation";

export const createDurationData = (
duration: string | number | ForDict | undefined
): HaDurationData => {
): HaDurationData | undefined => {
if (duration === undefined) {
return {};
return undefined;
}
if (typeof duration !== "object") {
if (typeof duration === "string" || isNaN(duration)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class HaDelayAction extends LitElement implements ActionElement {

@property() public action!: DelayAction;

@property() public _timeData!: HaDurationData;
@property() public _timeData?: HaDurationData;

public static get defaultConfig() {
return { delay: "" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class HaStateCondition extends LitElement implements ConditionElement {

protected render() {
const trgFor = createDurationData(this.condition.for);
const data = { ...this.condition, ...{ for: trgFor } };
const data = { ...this.condition, for: trgFor };
const schema = this._schema(this.condition.entity_id);

return html`
Expand Down