fix: implement repository pkg
This commit is contained in:
@ -5,18 +5,18 @@ import (
|
||||
"io"
|
||||
"text/tabwriter"
|
||||
|
||||
"github.com/volker-raschek/flucky/pkg/config"
|
||||
"github.com/volker-raschek/flucky/pkg/types"
|
||||
)
|
||||
|
||||
// PrintSensors displays a list with all configured sensors
|
||||
func PrintSensors(cnf *config.Config, w io.Writer) error {
|
||||
func PrintSensors(sensors []*types.Sensor, 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\ttick-duration\tenabled\n")
|
||||
|
||||
for _, sensor := range cnf.Sensors {
|
||||
for _, sensor := range sensors {
|
||||
fmt.Fprintf(tw, "%v\t%v\t%v\t", sensor.Name, sensor.Location, sensor.Model)
|
||||
|
||||
if sensor.WireID != nil {
|
||||
|
Reference in New Issue
Block a user