fix: temperature, sensor
changes: - sensor temperature add - sensor temperature list - sensor temperature rm - temperature get - temperature log - temperature push
This commit is contained in:
@ -7,12 +7,14 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var force bool
|
||||
|
||||
var registerRemoteCmd = &cobra.Command{
|
||||
Use: "register",
|
||||
Short: "register on remote servers",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
if err := remote.SendDevice(configDir); err != nil {
|
||||
if err := remote.RegisterDevice(configDir, force); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
@ -20,4 +22,5 @@ var registerRemoteCmd = &cobra.Command{
|
||||
|
||||
func init() {
|
||||
remoteCmd.AddCommand(registerRemoteCmd)
|
||||
registerRemoteCmd.Flags().BoolVarP(&force, "force", "f", false, "Force register on a remote server")
|
||||
}
|
||||
|
@ -8,11 +8,11 @@ var configDir string
|
||||
|
||||
var remoteCmd = &cobra.Command{
|
||||
Use: "remote",
|
||||
Short: "remote",
|
||||
Short: "Manage Remote",
|
||||
}
|
||||
|
||||
func InitCmd(cmd *cobra.Command, c string) {
|
||||
configDir = c
|
||||
func InitCmd(cmd *cobra.Command, cnf string) {
|
||||
configDir = cnf
|
||||
|
||||
cmd.AddCommand(remoteCmd)
|
||||
}
|
||||
|
Reference in New Issue
Block a user