PKGBUILD/cmd/sensor/sync.go
Markus Pesch f8e829d3d2
fix: sync and fetch temperatures
changes:
- add sync command to synchronize device sensor information with remote
  servers
- fix fetch functions to get temperatures
2018-11-29 16:06:39 +01:00

27 lines
526 B
Go

package sensor
import (
"log"
"git.cryptic.systems/fh-trier/go-flucky/pkg/httpcall"
"github.com/spf13/cobra"
)
var force bool
var syncSensorCmd = &cobra.Command{
Use: "sync",
Short: "Synchronise Sensors with Remote Servers",
Run: func(cmd *cobra.Command, args []string) {
if err := httpcall.SyncSensors(configDir, force); err != nil {
log.Fatal(err)
}
},
}
func init() {
sensorCmd.AddCommand(syncSensorCmd)
syncSensorCmd.Flags().BoolVarP(&force, "force", "f", false, "Include disabled remote links")
}