Migrate aedes MQTT server to ESM

This commit is contained in:
tsightler
2023-01-02 15:27:00 -05:00
parent 0229922d5f
commit 584b576cd1

View File

@@ -3,7 +3,7 @@ import chalk from 'chalk'
import utils from './utils.js'
import fs from 'fs'
import parseArgs from 'minimist'
import aedes from 'aedes'
import Aedes from 'aedes'
import net from 'net'
import debugModule from 'debug'
const debug = debugModule('ring-mqtt')
@@ -15,9 +15,9 @@ export default new class Mqtt {
this.connected = false
// Start internal broker, used only for inter-process communication (IPC)
const aedesServer = new aedes()
const mqttServer = net.createServer(aedesServer.handle)
mqttServer.listen(51883, '127.0.0.1')
const mqttServer = new Aedes()
const netServer = net.createServer(mqttServer.handle)
netServer.listen(51883, '127.0.0.1')
// Configure event listeners
utils.event.on('ring_api_state', async (state) => {