reworked connection handling a bit

This commit is contained in:
Marcus Westin 2019-12-04 18:52:50 +01:00
parent 1619a94f48
commit 65f5f1a4ba
4 changed files with 42 additions and 68 deletions

View file

@ -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);
});