add: humidity (WIP)

This commit is contained in:
2018-12-04 19:11:50 +01:00
parent ba9f0c59f3
commit 81600154f0
141 changed files with 18562 additions and 4 deletions

28
cmd/humidity/get.go Normal file
View 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
View 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)
}