fix: splited temperatures

Changes:
- Split temperatures from log file into blocks.
  Every block has a size of 500 entries. Every block would be send to
  the remote host
This commit is contained in:
2018-12-07 22:50:28 +01:00
parent 81600154f0
commit 500d1a5823
8 changed files with 175 additions and 102 deletions

View File

@ -11,8 +11,9 @@ import (
var quiet bool
var listSensorCmd = &cobra.Command{
Use: "list",
Short: "List Sensors",
Use: "ls",
Short: "List Sensors",
Aliases: []string{"list"},
Run: func(cmd *cobra.Command, args []string) {
if err := sensor.Print(os.Stdout, configDir, quiet); err != nil {
log.Fatal(err)

View File

@ -8,9 +8,10 @@ import (
)
var rmSensorCmd = &cobra.Command{
Use: "rm",
Short: "Remove Sensor",
Args: cobra.ExactArgs(1),
Use: "rm",
Short: "Remove Sensor",
Aliases: []string{"remove"},
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
if err := sensor.Remove(args[0], configDir); err != nil {
log.Fatal(err)

View File

@ -10,8 +10,9 @@ import (
var force bool
var syncSensorCmd = &cobra.Command{
Use: "sync",
Short: "Synchronise Sensors with Remote Servers",
Use: "sync",
Short: "Synchronise Sensors with Remote Servers",
Aliases: []string{"synchronize"},
Run: func(cmd *cobra.Command, args []string) {
if err := httpcall.SyncSensors(configDir, force); err != nil {