feat: add fertilizer pump test functionality with web integration and HAL support
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -304,6 +304,12 @@ export class Controller {
|
||||
})
|
||||
}
|
||||
|
||||
testFertilizerPump() {
|
||||
fetch(PUBLIC_URL + "/fertilizerpumptest", {
|
||||
method: "POST"
|
||||
})
|
||||
}
|
||||
|
||||
testPlant(plantId: number) {
|
||||
let counter = 0
|
||||
let limit = 30
|
||||
|
||||
Reference in New Issue
Block a user