29 lines
584 B
Go
29 lines
584 B
Go
|
package humidity
|
||
|
|
||
|
import (
|
||
|
"log"
|
||
|
|
||
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/humidity"
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
var follow, push bool
|
||
|
|
||
|
var getHumidityCmd = &cobra.Command{
|
||
|
Use: "get",
|
||
|
Short: "get humidity from sensor",
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
|
||
|
if err := humidity.Get(); err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
|
||
|
},
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
humidityCmd.AddCommand(getHumidityCmd)
|
||
|
// getTemperatureCmd.Flags().BoolVarP(&follow, "follow", "f", false, "Follow output")
|
||
|
// getTemperatureCmd.Flags().BoolVarP(&push, "push", "p", false, "Push to remote server")
|
||
|
}
|