diff --git a/src/index.ts b/src/index.ts index d7dfbea..0a7990c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -39,8 +39,11 @@ async function temperatoTick() { if (response.getSensorData.temperato >= SET_POINT) { numberOfTicks++; - if (numberOfTicks == TICK_THRESHOLD) { - numberOfTicks = 0; + if (numberOfTicks == TICK_THRESHOLD) { + numberOfTicks = 0; + } + + if (numberOfTicks == 0) { const basicAuth = Buffer.from(`${USERNAME}:${PASSWORD}`).toString('base64'); await fetch(NOTIF_URL, { method: 'post',