mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 01:06:35 +00:00
Only add milliseconds when enabled or if it has a value (#10842)
This commit is contained in:
parent
ead5e288eb
commit
919bf94a03
@ -122,14 +122,20 @@ class HaDurationInput extends LitElement {
|
|||||||
value %= 60;
|
value %= 60;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const newValue: HaDurationData = {
|
||||||
|
hours,
|
||||||
|
minutes,
|
||||||
|
seconds: this._seconds,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (this.enableMillisecond || this._milliseconds) {
|
||||||
|
newValue.milliseconds = this._milliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
newValue[unit] = value;
|
||||||
|
|
||||||
fireEvent(this, "value-changed", {
|
fireEvent(this, "value-changed", {
|
||||||
value: {
|
value: newValue,
|
||||||
hours,
|
|
||||||
minutes,
|
|
||||||
seconds: this._seconds,
|
|
||||||
milliseconds: this._milliseconds,
|
|
||||||
...{ [unit]: value },
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user