fix(cmd/temperature): list temperatures
This commit is contained in:
parent
2843d96756
commit
258ac998be
@ -2,8 +2,13 @@ package temperature
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/volker-raschek/flucky/pkg/cli"
|
||||
"github.com/volker-raschek/flucky/pkg/config"
|
||||
"github.com/volker-raschek/flucky/pkg/logfile"
|
||||
)
|
||||
|
||||
var listTemperatureCmd = &cobra.Command{
|
||||
@ -13,12 +18,17 @@ var listTemperatureCmd = &cobra.Command{
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
// read configuration
|
||||
// fc, err := config.Read(cnfPath)
|
||||
// if err != nil {
|
||||
// list.Fatalln(err)
|
||||
// }
|
||||
cnf, err := config.Read(cnfPath)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
//cli.PrintTemperatures(temperatures, fc, os.Stdout)
|
||||
temperatures, err := logfile.ReadTemperatures(cnf.Device.TemperatureLogfile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
cli.PrintTemperatures(temperatures, cnf, os.Stdout)
|
||||
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user