Remove milliseconds from state trigger when 0 (#10879)

This commit is contained in:
Bram Kragten 2021-12-12 13:27:14 +01:00 committed by GitHub
parent 2606d55895
commit 942150cda2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,6 +50,13 @@ export class HaStateTrigger extends LitElement implements TriggerElement {
if (!changedProperties.has("trigger")) {
return true;
}
if (
this.trigger.for &&
typeof this.trigger.for === "object" &&
this.trigger.for.milliseconds === 0
) {
delete this.trigger.for.milliseconds;
}
// Check for templates in trigger. If found, revert to YAML mode.
if (this.trigger && hasTemplate(this.trigger)) {
fireEvent(