Markus Pesch
6d9368e86c
changes: - sensor temperature add - sensor temperature list - sensor temperature rm - temperature get - temperature log - temperature push
28 lines
481 B
Go
28 lines
481 B
Go
package temperature
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"git.cryptic.systems/fh-trier/go-flucky/pkg/temperature"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var push bool
|
|
|
|
var getTemperatureCmd = &cobra.Command{
|
|
Use: "get",
|
|
Short: "get temperature from sensor",
|
|
Args: cobra.ExactArgs(1),
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if err := temperature.Get(os.Stdout, args[0], configDir); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
temperatureCmd.AddCommand(getTemperatureCmd)
|
|
}
|