feat(db): add battery field

Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
2026-05-21 09:57:00 +02:00
parent 1bcaad895d
commit 04c3883744

View File

@@ -23,6 +23,7 @@ type ProvenceData struct {
CO2PPM int `json:"co2_ppm"`
Temp float64 `json:"temp"`
Humidity int `json:"humidity"`
Battery int `json:"battery"`
Window bool `json:"window"`
}
@@ -135,7 +136,8 @@ func main() {
return
}
log.Printf("[Main] Received gateway=%s node=%s -> campus=%s room=%s\n", gatewayID, nodeID, campus, room)
batteryLevel := dp.GetValues().Battery
log.Printf("[Main] Received gateway=%s node=%s -> campus=%s room=%s (Battery %d%%)\n", gatewayID, nodeID, campus, room, batteryLevel)
// Re-create the datapoint with campus/room tags for Influx
influxTags := []point.Topic{