Skip to content

Commit

Permalink
Fix port typo and add handler to reset buttons to not pressed at connect
Browse files Browse the repository at this point in the history
  • Loading branch information
ngreatorex committed Mar 16, 2022
1 parent 44e201d commit 3a0e5c9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var homieConfig = {
"device_id": "streamdeck_"+serialNumber,
"mqtt": {
"host": "localhost",
"poer": 1883,
"port": 1883,
"base_topic": "homie/"
}
};
Expand Down Expand Up @@ -66,6 +66,13 @@ myStreamDeck.on('up', keyIndex => {
myStreamDeck.on('error', error => {
console.error(error);
});

myHomieDevice.on('connect', () => {
console.log("Connected");
for (let i = 0; i < buttonNodes.length; i++) {
buttonNodes[i].setProperty('pressed').send('false');
}
});

myHomieDevice.setup();

Expand Down

0 comments on commit 3a0e5c9

Please sign in to comment.