fix(cmd/sensor): set tick duration for new sensors

This commit is contained in:
2020-01-11 13:18:38 +01:00
parent 40857249c4
commit 002f3e9e25
3 changed files with 28 additions and 18 deletions

View File

@ -68,7 +68,7 @@ func PrintSensors(cnf *config.Configuration, w io.Writer) error {
// declar tabwriter
tw := tabwriter.NewWriter(w, 0, 0, 3, ' ', 0)
fmt.Fprint(tw, "name\tlocation\ttype\twire-id\ti2c-bus\ti2c-address\tgpio\tenabled\n")
fmt.Fprint(tw, "name\tlocation\ttype\twire-id\ti2c-bus\ti2c-address\tgpio\ttick-duration\tenabled\n")
for _, sensor := range cnf.Sensors {
fmt.Fprintf(tw, "%v\t%v\t%v\t", sensor.Name, sensor.Location, sensor.Model)
@ -97,7 +97,7 @@ func PrintSensors(cnf *config.Configuration, w io.Writer) error {
fmt.Fprintf(tw, "\t")
}
fmt.Fprintf(tw, "%v\n", sensor.Enabled)
fmt.Fprintf(tw, "%v\t%v\n", sensor.TickDuration, sensor.Enabled)
}
tw.Flush()