Didn't need to declare, needed to hand over config
This commit is contained in:
parent
9f42cc6240
commit
89ccd032a9
@ -26,9 +26,9 @@ export class Communicator {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
init(state) {
|
init(state, config) {
|
||||||
// Connect to the MQTT Broker
|
// Connect to the MQTT Broker
|
||||||
const this.client = mqtt.connect(config.mqtt.address);
|
this.client = mqtt.connect(config.mqtt.address);
|
||||||
const { client } = this;
|
const { client } = this;
|
||||||
|
|
||||||
client.on('connect', () => {
|
client.on('connect', () => {
|
||||||
|
@ -15,7 +15,7 @@ window.onload = async function() {
|
|||||||
config = data;
|
config = data;
|
||||||
console.log(config);
|
console.log(config);
|
||||||
psState.init(config);
|
psState.init(config);
|
||||||
comms.init(psState);
|
comms.init(psState, config);
|
||||||
refreshState(window.document, psState);
|
refreshState(window.document, psState);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
Loading…
Reference in New Issue
Block a user