From 5dd67f2d3d140f696f05ce4de0c597b7061acc1a Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Tue, 15 Mar 2022 18:56:47 +0100 Subject: [PATCH] Fix alarm not being fired sometimes --- api/js/etemplate/et2_widget_countdown.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/js/etemplate/et2_widget_countdown.ts b/api/js/etemplate/et2_widget_countdown.ts index b9d5e8d449c..d4c150f1e4d 100644 --- a/api/js/etemplate/et2_widget_countdown.ts +++ b/api/js/etemplate/et2_widget_countdown.ts @@ -125,7 +125,7 @@ export class et2_countdown extends et2_valueWidget { for (let i=0;i<=alarms.length;i++) { - if (alarms[i] > 0 && alarms[i] == distance/1000 && typeof this.onAlarm == 'function') + if (alarms[i] > 0 && alarms[i] == Math.floor(distance/1000) && typeof this.onAlarm == 'function') { this.onAlarm(); }