Fix alarm not being fired sometimes

This commit is contained in:
Hadi Nategh 2022-03-15 18:56:47 +01:00
parent 1d559e9263
commit 5dd67f2d3d

View File

@ -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();
}