Implement pump flow monitoring and UI normalization enhancements
- Rust: Add `MIN_PUMP_FLOW_ML` constant and logging for insufficient pump flow with fault handling. - UI: Normalize config fields to maintain consistency and prevent false dirty flags after round-trips. - KiCad: Update board zone settings for `PlantCtrlESP32` and `MPPT`. - IntelliJ: Add `.idea` configurations for project setup and inspections.
This commit is contained in:
@@ -36,10 +36,10 @@ export interface BackupHeader {
|
||||
|
||||
export interface NetworkConfig {
|
||||
ap_ssid: string,
|
||||
ssid: string,
|
||||
password: string,
|
||||
mqtt_url: string,
|
||||
base_topic: string,
|
||||
ssid: string | null,
|
||||
password: string | null,
|
||||
mqtt_url: string | null,
|
||||
base_topic: string | null,
|
||||
mqtt_user: string | null,
|
||||
mqtt_password: string | null,
|
||||
max_wait: number
|
||||
|
||||
@@ -246,8 +246,11 @@ export class Controller {
|
||||
const response = await fetch(PUBLIC_URL + "/get_config");
|
||||
const loaded = await response.json();
|
||||
const currentConfig = loaded as PlantControllerConfig;
|
||||
controller.setInitialConfig(currentConfig);
|
||||
controller.setConfig(currentConfig);
|
||||
// Store the config after the UI round-trip so null fields that the UI
|
||||
// normalises (e.g. null → "" → null, null timezone → "UTC") are
|
||||
// represented consistently and don't trigger a false dirty flag.
|
||||
controller.setInitialConfig(controller.getConfig());
|
||||
//sync json view initially
|
||||
controller.configChanged();
|
||||
controller.progressview.removeProgress("get_config");
|
||||
|
||||
@@ -102,25 +102,25 @@ export class NetworkConfigView {
|
||||
|
||||
setConfig(network: NetworkConfig) {
|
||||
this.ap_ssid.value = network.ap_ssid;
|
||||
this.ssid.value = network.ssid;
|
||||
this.password.value = network.password;
|
||||
this.mqtt_url.value = network.mqtt_url;
|
||||
this.base_topic.value = network.base_topic;
|
||||
this.ssid.value = network.ssid ?? "";
|
||||
this.password.value = network.password ?? "";
|
||||
this.mqtt_url.value = network.mqtt_url ?? "";
|
||||
this.base_topic.value = network.base_topic ?? "";
|
||||
this.mqtt_user.value = network.mqtt_user ?? "";
|
||||
this.mqtt_password.value = network.mqtt_password ?? "";
|
||||
this.max_wait.value = network.max_wait.toString();
|
||||
}
|
||||
|
||||
|
||||
getConfig(): NetworkConfig {
|
||||
return {
|
||||
max_wait: +this.max_wait.value,
|
||||
ap_ssid: this.ap_ssid.value,
|
||||
ssid: this.ssid.value ?? null,
|
||||
password: this.password.value ?? null,
|
||||
mqtt_url: this.mqtt_url.value ?? null,
|
||||
mqtt_user: this.mqtt_user.value ? this.mqtt_user.value : null,
|
||||
mqtt_password: this.mqtt_password.value ? this.mqtt_password.value : null,
|
||||
base_topic: this.base_topic.value ?? null
|
||||
ssid: this.ssid.value || null,
|
||||
password: this.password.value || null,
|
||||
mqtt_url: this.mqtt_url.value || null,
|
||||
mqtt_user: this.mqtt_user.value || null,
|
||||
mqtt_password: this.mqtt_password.value || null,
|
||||
base_topic: this.base_topic.value || null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user