add: humidity (WIP)
This commit is contained in:
28
cmd/humidity/get.go
Normal file
28
cmd/humidity/get.go
Normal file
@ -0,0 +1,28 @@
|
||||
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")
|
||||
}
|
20
cmd/humidity/humidity.go
Normal file
20
cmd/humidity/humidity.go
Normal file
@ -0,0 +1,20 @@
|
||||
package humidity
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var configDir string
|
||||
|
||||
var humidityCmd = &cobra.Command{
|
||||
Use: "humidity",
|
||||
Short: "Read humidity from sensor",
|
||||
}
|
||||
|
||||
// Execute a
|
||||
func InitCmd(cmd *cobra.Command, cnf string) {
|
||||
configDir = cnf
|
||||
|
||||
cmd.AddCommand(humidityCmd)
|
||||
|
||||
}
|
Reference in New Issue
Block a user