fix(cmd/temperature): list temperatures
This commit is contained in:
		| @@ -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) | ||||
|  | ||||
| 	}, | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user