chore(db): set 30min before offline for battery endpoint

Signed-off-by: Klagarge <remi@heredero.ch>
This commit is contained in:
2026-05-27 15:26:38 +02:00
parent c78f1e1509
commit 2355c8f0e9

View File

@@ -110,7 +110,7 @@ func (g *RestGateway) getBattery(c *gin.Context) {
nodeFilter := buildNodeFilter(allNodes)
query := fmt.Sprintf(
`SELECT "node", "battery" FROM "%s" WHERE %s AND time > now() - INTERVAL '3 hour' ORDER BY time DESC`,
`SELECT "node", "battery" FROM "%s" WHERE %s AND time > now() - INTERVAL '30 minutes' ORDER BY time DESC`,
g.measurementName, nodeFilter,
)
@@ -154,7 +154,7 @@ func (g *RestGateway) getBattery(c *gin.Context) {
}
battery, hasData := nodeBattery[nodeID]
if !hasData {
battery = "offline (3h)"
battery = "offline (30 min)"
}
result[room][nodeID] = map[string]any{"battery": battery}
}