feat: select optional sensors to read humidity or temperature
This commit is contained in:
@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user