PR request changes && rvo status added for all devices - em, twilight, thermometer

This commit is contained in:
rasta5man 2024-09-17 08:54:32 +02:00
parent 880edfc604
commit 1b4b9ca973
8 changed files with 230 additions and 195 deletions

View file

@ -3,6 +3,9 @@ class DataToTbHandler
constructor(index) {
this.index = index;
// time, after new value for the given key will be resend to tb (e.g. {status: "OK"})
this.timeToHoldTbValue = 30*60; //30 minutes
this.previousValues = {};
this.debug = false;
this.messageCounter = 0;
@ -99,14 +102,9 @@ class DataToTbHandler
getDiffTimestamp(key)
{
let seconds = 30*60;//30 minutes
//TODO set different value for given key!!!
//if(key == "status") seconds = 2*60*60;//2h
let timestampDiffToRemoveKey = seconds*1000;
return timestampDiffToRemoveKey;
//if(key == "status") this.timeToHoldTbValue = 2*60*60;//2h
return this.timeToHoldTbValue * 1000;
}
prepareValuesForTb(tbname, timestamp, values)