read all sensors implemented

This commit is contained in:
2025-10-09 16:56:23 +02:00
parent 8cf9219534
commit 92640d1ad0
2 changed files with 9 additions and 5 deletions
+8 -1
View File
@@ -116,7 +116,14 @@ func (i *inMemory) ReadSensorValues(sensorID string, from time.Time, to time.Tim
}
func (i *inMemory) ReadAllSensors() ([]Sensor, error) {
panic("unimplemented")
i.mu.Lock()
defer i.mu.Unlock()
sensors := make([]Sensor, 0, len(i.sensors))
for _, s := range i.sensors {
sensors = append(sensors, *s)
}
return sensors, nil
}
type DecoratorRepo struct {