feat: add fertilizer pump test functionality with web integration and HAL support

This commit is contained in:
2026-04-30 20:37:07 +02:00
parent 542ff578bc
commit 0ca09ed498
7 changed files with 43 additions and 2 deletions

View File

@@ -22,3 +22,8 @@
<div class="boardkey">Pump corrosion protection (weekly)</div>
<input type="checkbox" id="hardware_pump_corrosion_protection">
</div>
<div class="subtitle">Fertilizer Pump:</div>
<div class="flexcontainer">
<button class="subtitle" id="fertilizer_pump_test">Test Fertilizer Pump</button>
</div>

View File

@@ -5,6 +5,7 @@ export class HardwareConfigView {
private readonly hardware_board_value: HTMLSelectElement;
private readonly hardware_battery_value: HTMLSelectElement;
private readonly hardware_pump_corrosion_protection: HTMLInputElement;
private readonly fertilizer_pump_test: HTMLButtonElement;
constructor(controller:Controller){
(document.getElementById("hardwareview") as HTMLElement).innerHTML = require('./hardware.html') as string;
@@ -33,6 +34,11 @@ export class HardwareConfigView {
this.hardware_pump_corrosion_protection = document.getElementById("hardware_pump_corrosion_protection") as HTMLInputElement;
this.hardware_pump_corrosion_protection.onchange = controller.configChanged
this.fertilizer_pump_test = document.getElementById("fertilizer_pump_test") as HTMLButtonElement;
this.fertilizer_pump_test.onclick = () => {
controller.testFertilizerPump();
}
}
setConfig(hardware: BoardHardware) {

View File

@@ -304,6 +304,12 @@ export class Controller {
})
}
testFertilizerPump() {
fetch(PUBLIC_URL + "/fertilizerpumptest", {
method: "POST"
})
}
testPlant(plantId: number) {
let counter = 0
let limit = 30