use same output for moisture on webpage as in mqtt
This commit is contained in:
@@ -106,8 +106,8 @@ interface GetTime {
|
||||
}
|
||||
|
||||
interface Moistures {
|
||||
moisture_a: [number],
|
||||
moisture_b: [number],
|
||||
moisture_a: [string],
|
||||
moisture_b: [string],
|
||||
}
|
||||
|
||||
interface VersionInfo {
|
||||
|
@@ -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) {
|
||||
|
Reference in New Issue
Block a user