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.
 
 
 
 
 
 

14 lines
523 B

import { MqttApiClient } from "@common/sprinklers/mqtt";
import { WebSocketApiClient } from "../sprinklers/websocket";
import StateBase from "./StateBase";
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 WebSocketApiClient(`ws://${location.hostname}:${websocketPort}`);
}