Start switching over to simple-mqtt-client, but it's not finished yet

This commit is contained in:
Starbeamrainbowlabs 2019-07-04 20:53:00 +01:00
parent e3a667cb69
commit 1a39c5902e
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
"use strict";
import { data as ttn_data } from 'ttn';
import MqttClient from 'simple-mqtt-client';
class TTNAppServer {
// Destructure the awilix container
@ -17,7 +17,9 @@ class TTNAppServer {
console.error(`${this.a.fred}${this.a.hicol}Error: No TTN app id specified. Try filling in the required values in settings.toml. If they don't exist yet, try using server/settings.default.toml as a reference.${this.a.reset}`);
return false;
}
this.ttn_client = await ttn_data(
this.ttn_client = MqttClient.new().init()(
this.settings.ttn.app_id,
this.settings.ttn.access_key
);