fix(cmd/sensor): set tick duration for new sensors
This commit is contained in:
@ -81,6 +81,11 @@ func (c *Configuration) AddSensor(sensor *types.Sensor) error {
|
||||
}
|
||||
}
|
||||
|
||||
// check if sensor has a valid tick time
|
||||
if _, err := time.ParseDuration(sensor.TickDuration); err != nil {
|
||||
return fmt.Errorf("Can not parse tick duration: %v", sensor.TickDuration)
|
||||
}
|
||||
|
||||
// check if sensor has a valid device id
|
||||
if sensor.DeviceID != c.Device.ID {
|
||||
sensor.DeviceID = c.Device.ID
|
||||
|
Reference in New Issue
Block a user