Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
Using `mapping.informId` instead of `mapping` as key to `delayed_timers` (unique string). This should fix issue justme-1968#68
  • Loading branch information
pst-on-github authored Nov 29, 2021
1 parent 80d24a0 commit 1ba6b52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2481,17 +2481,17 @@ FHEMAccessory.prototype = {
if( delay < 500 )
delay = 500;

var timer = this.delayed_timers[mapping];
var timer = this.delayed_timers[mapping.informId];
if( timer ) {
//this.log(this.name + ' delayed: removing old command ' + mapping.characteristic_type);
clearTimeout( timer );
}

this.log.info(this.name + ' delaying command ' + mapping.characteristic_type + ' with value ' + value);
this.delayed_timers[mapping] = setTimeout( function(){
delete this.delayed_timers[mapping];
this.command(mapping,value);
}.bind(this), delay );
this.delayed_timers[mapping.informId] = setTimeout( function(){
delete this.delayed_timers[mapping.informId];
this.command(mapping,value);
}.bind(this), delay );
},

command: function(mapping,value) {
Expand Down

0 comments on commit 1ba6b52

Please sign in to comment.