use same output for moisture on webpage as in mqtt

This commit is contained in:
2025-05-19 12:16:09 +02:00
parent 171b130a29
commit 9f48b46738
4 changed files with 28 additions and 20 deletions

View File

@@ -106,8 +106,8 @@ interface GetTime {
}
interface Moistures {
moisture_a: [number],
moisture_b: [number],
moisture_a: [string],
moisture_b: [string],
}
interface VersionInfo {

View File

@@ -24,7 +24,7 @@ export class PlantViews {
}
return rv
}
update(moisture_a: [number], moisture_b: [number]) {
update(moisture_a: [string], moisture_b: [string]) {
for (let plantId = 0; plantId < PLANT_COUNT; plantId++) {
const a = moisture_a[plantId]
const b = moisture_b[plantId]
@@ -150,18 +150,9 @@ export class PlantView {
};
}
update(a: number, b: number) {
if (a == 200){
this.moistureA.innerText = "error"
} else {
this.moistureA.innerText = String(a)
}
if (b == 200){
this.moistureB.innerText = "error"
} else {
this.moistureB.innerText = String(b)
}
update(a: string, b: string) {
this.moistureA.innerText = a
this.moistureB.innerText = b
}
setConfig(plantConfig: PlantConfig) {