fix: temperature, sensor

changes:
- sensor temperature add
- sensor temperature list
- sensor temperature rm
- temperature get
- temperature log
- temperature push
This commit is contained in:
2018-11-20 22:55:06 +01:00
parent dd7ea3156e
commit 6d9368e86c
25 changed files with 850 additions and 48 deletions

View File

@ -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")
}

View File

@ -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)
}