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