PlantCtrl/rust/src_webpack/src/api.ts

65 lines
1.1 KiB
TypeScript
Raw Normal View History

2024-12-14 01:24:31 +01:00
interface NetworkConfig {
ap_ssid: string,
ssid: string,
password: string,
mqtt_url: string,
base_topic: string
}
interface NightLampConfig {
night_lamp_hour_start: number,
night_lamp_hour_end: number,
night_lamp_only_when_dark: boolean,
}
interface TankConfig {
tank_sensor_enabled: boolean,
tank_allow_pumping_if_sensor_error: boolean,
tank_useable_ml: number,
tank_warn_percent: number,
tank_empty_percent: number,
tank_full_percent: number,
}
2024-12-11 21:01:11 +01:00
interface PlantControllerConfig {
2024-12-14 01:24:31 +01:00
network: NetworkConfig,
tank: TankConfig,
nightLamp: NightLampConfig,
plants: PlantConfig[]
}
interface PlantConfig {
mode: string,
target_moisture: number,
pump_time_s: number,
pump_cooldown_min: number,
pump_hour_start: number,
pump_hour_end: number,
sensor_b: boolean,
max_consecutive_pump_count: number,
}
interface SSIDList {
ssids: [string]
}
interface TestPump {
pump: number
}
interface SetTime {
time: string
}
interface GetData {
rtc: string,
native: string,
moisture_a: [number],
moisture_b: [number],
}
interface VersionInfo {
git_hash: string,
build_time: string
}