feat: add fertilizer pump functionality with configuration, web UI, and HAL integration
This commit is contained in:
@@ -79,6 +79,7 @@ export class PlantView {
|
||||
private readonly minMoisture: HTMLInputElement;
|
||||
private readonly pumpTimeS: HTMLInputElement;
|
||||
private readonly pumpCooldown: HTMLInputElement;
|
||||
private readonly fertilizerS: HTMLInputElement;
|
||||
private readonly pumpHourStart: HTMLSelectElement;
|
||||
private readonly pumpHourEnd: HTMLSelectElement;
|
||||
private readonly sensorAInstalled: HTMLInputElement;
|
||||
@@ -180,6 +181,11 @@ export class PlantView {
|
||||
controller.configChanged()
|
||||
}
|
||||
|
||||
this.fertilizerS = document.getElementById("plant_" + plantId + "_fertilizer_s") as HTMLInputElement;
|
||||
this.fertilizerS.onchange = function () {
|
||||
controller.configChanged()
|
||||
}
|
||||
|
||||
this.pumpHourStart = document.getElementById("plant_" + plantId + "_pump_hour_start") as HTMLSelectElement;
|
||||
this.pumpHourStart.onchange = function () {
|
||||
controller.configChanged()
|
||||
@@ -328,6 +334,7 @@ export class PlantView {
|
||||
this.minMoisture.value = plantConfig.min_moisture?.toString() || "";
|
||||
this.pumpTimeS.value = plantConfig.pump_time_s.toString();
|
||||
this.pumpCooldown.value = plantConfig.pump_cooldown_min.toString();
|
||||
this.fertilizerS.value = plantConfig.fertilizer_s?.toString() || "0";
|
||||
this.pumpHourStart.value = plantConfig.pump_hour_start.toString();
|
||||
this.pumpHourEnd.value = plantConfig.pump_hour_end.toString();
|
||||
this.sensorBInstalled.checked = plantConfig.sensor_b;
|
||||
@@ -355,6 +362,7 @@ export class PlantView {
|
||||
pump_time_s: this.pumpTimeS.valueAsNumber,
|
||||
pump_limit_ml: 5000,
|
||||
pump_cooldown_min: this.pumpCooldown.valueAsNumber,
|
||||
fertilizer_s: this.fertilizerS.valueAsNumber || 0,
|
||||
pump_hour_start: +this.pumpHourStart.value,
|
||||
pump_hour_end: +this.pumpHourEnd.value,
|
||||
sensor_b: this.sensorBInstalled.checked,
|
||||
|
||||
Reference in New Issue
Block a user