PKGBUILD/cmd/sensor/temperature/add.go
Markus Pesch 6d9368e86c
fix: temperature, sensor
changes:
- sensor temperature add
- sensor temperature list
- sensor temperature rm
- temperature get
- temperature log
- temperature push
2018-11-21 19:30:14 +01:00

25 lines
485 B
Go

package temperature
import (
"log"
"git.cryptic.systems/fh-trier/go-flucky/pkg/sensor"
"github.com/spf13/cobra"
)
var addTemperatureSensorCmd = &cobra.Command{
Use: "add",
Short: "Add Temperature Sensor",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
if err := sensor.AddTemperature(args[0], sensorName, configDir, wirePath); err != nil {
log.Fatal(err)
}
},
}
func init() {
temperatureSensorCmd.AddCommand(addTemperatureSensorCmd)
}