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.
15 lines
499 B
15 lines
499 B
7 years ago
|
import { MqttApiClient } from "@common/sprinklers/mqtt";
|
||
|
import StateBase from "./StateBase";
|
||
|
import { WebApiClient } from "./websocket";
|
||
|
|
||
|
const isDev = process.env.NODE_ENV === "development";
|
||
|
const websocketPort = isDev ? 8080 : location.port;
|
||
|
|
||
|
export class MqttApiState extends StateBase {
|
||
|
sprinklersApi = new MqttApiClient(`ws://${location.hostname}:1884`);
|
||
|
}
|
||
|
|
||
|
export class WebApiState extends StateBase {
|
||
|
sprinklersApi = new WebApiClient(`ws://${location.hostname}:${websocketPort}`);
|
||
|
}
|