reworked connection handling a bit
This commit is contained in:
parent
1619a94f48
commit
65f5f1a4ba
4 changed files with 42 additions and 68 deletions
2
main.js
2
main.js
|
|
@ -14,7 +14,7 @@ async function main() {
|
|||
plejdApi.getCryptoKey((cryptoKey) => {
|
||||
const devices = plejdApi.getDevices();
|
||||
|
||||
client.once('connected', () => {
|
||||
client.on('connected', () => {
|
||||
console.log('plejd-mqtt: connected to mqtt.');
|
||||
client.discover(devices);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue