feat: select optional sensors to read humidity or temperature

This commit is contained in:
2019-02-28 23:23:21 +01:00
parent 91d20b6e95
commit 82e82952ed
3 changed files with 95 additions and 8 deletions

View File

@ -1,6 +1,7 @@
package temperature
import (
"fmt"
"log"
"os"
@ -13,8 +14,9 @@ import (
var follow, push bool
var readTemperatureCmd = &cobra.Command{
Use: "read",
Short: "read temperature from sensor",
Use: "read",
Short: "read temperature from sensor",
Example: fmt.Sprintf("flucky temperature read\nflucky temperature read outdoor"),
Run: func(cmd *cobra.Command, args []string) {
// read configuration
@ -24,7 +26,7 @@ var readTemperatureCmd = &cobra.Command{
}
// fetch all temperature sensors
temperatureSensors, err := fc.GetTemperatureSensors()
temperatureSensors, err := fc.GetTemperatureSensors(args)
if err != nil {
log.Fatalln(err)
}