You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
428 B
17 lines
428 B
7 years ago
|
import {SprinklersDevice} from "@common/sprinklers";
|
||
|
import * as mqtt from "@common/sprinklers/mqtt";
|
||
|
|
||
|
export class State {
|
||
|
mqttClient!: mqtt.MqttApiClient;
|
||
|
device!: SprinklersDevice;
|
||
|
|
||
|
start() {
|
||
|
this.mqttClient = new mqtt.MqttApiClient("mqtt://localhost:1883");
|
||
|
this.device = this.mqttClient.getDevice("grinklers");
|
||
|
|
||
|
this.mqttClient.start();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export const state: State = new State();
|