@mschaeffler/node-red-bthome 0.4.1 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bthome.js +3 -3
- package/package.json +1 -1
package/bthome.js
CHANGED
|
@@ -16,7 +16,7 @@ module.exports = function(RED) {
|
|
|
16
16
|
this.contextVar = config.contextVar ?? "bthome";
|
|
17
17
|
this.contextStore = config.contextStore ?? "none";
|
|
18
18
|
this.data = {};
|
|
19
|
-
this.statistics = { ok:0,
|
|
19
|
+
this.statistics = { ok:0, dup:0, old:0, err:0 };
|
|
20
20
|
node.status( "" );
|
|
21
21
|
if( node.contextStore !== "none" )
|
|
22
22
|
{
|
|
@@ -87,8 +87,8 @@ module.exports = function(RED) {
|
|
|
87
87
|
if( node.counterTime )
|
|
88
88
|
{
|
|
89
89
|
const counterInt = counter[0] | (counter[1]<<8) | (counter[2]<<16) | (counter[3]<<24);
|
|
90
|
-
const delta =
|
|
91
|
-
if( delta > 15000 )
|
|
90
|
+
const delta = msgTime - counterInt*1000;
|
|
91
|
+
if( delta > 30000 || delta < -15000 )
|
|
92
92
|
{
|
|
93
93
|
throw new Error( "bthome "+msg.payload.gateway+" "+name+" "+(new Date(counterInt*1000))+" "+delta );
|
|
94
94
|
}
|