Update to include tick thresholds to avoid spammy messages
This commit is contained in:
parent
f1562451cc
commit
ea26bc54ed
@ -39,8 +39,11 @@ async function temperatoTick() {
|
|||||||
|
|
||||||
if (response.getSensorData.temperato >= SET_POINT) {
|
if (response.getSensorData.temperato >= SET_POINT) {
|
||||||
numberOfTicks++;
|
numberOfTicks++;
|
||||||
if (numberOfTicks == TICK_THRESHOLD) {
|
if (numberOfTicks == TICK_THRESHOLD) {
|
||||||
numberOfTicks = 0;
|
numberOfTicks = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numberOfTicks == 0) {
|
||||||
const basicAuth = Buffer.from(`${USERNAME}:${PASSWORD}`).toString('base64');
|
const basicAuth = Buffer.from(`${USERNAME}:${PASSWORD}`).toString('base64');
|
||||||
await fetch(NOTIF_URL, {
|
await fetch(NOTIF_URL, {
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
Loading…
Reference in New Issue
Block a user