fix(pkg/daemon): save measured values into postgres database if defined

This commit is contained in:
2019-09-04 13:37:50 +02:00
parent 6223f4e79b
commit 04bc3baffe
60 changed files with 680 additions and 378 deletions

View File

@ -5,11 +5,11 @@ import (
"log"
"os"
"github.com/go-flucky/flucky/pkg/storage/logfile"
"github.com/go-flucky/flucky/pkg/types"
"github.com/go-flucky/flucky/pkg/cli"
"github.com/go-flucky/flucky/pkg/config"
"github.com/go-flucky/flucky/pkg/logfile"
"github.com/go-flucky/flucky/pkg/rgbled"
"github.com/spf13/cobra"
)
@ -26,7 +26,7 @@ var listTemperatureCmd = &cobra.Command{
log.Fatalln(err)
}
logfile := logfile.New(cnf.Device.Logfile)
logfile := logfile.New(cnf.Logfile)
rgbLEDs := cnf.GetRGBLEDs(config.ENABLED)
if err := rgbled.Logfile(rgbLEDs); err != nil {

View File

@ -7,11 +7,11 @@ import (
"os"
"github.com/go-flucky/flucky/pkg/rgbled"
"github.com/go-flucky/flucky/pkg/storage/logfile"
"github.com/go-flucky/flucky/pkg/types"
"github.com/go-flucky/flucky/pkg/cli"
"github.com/go-flucky/flucky/pkg/config"
"github.com/go-flucky/flucky/pkg/logfile"
"github.com/go-flucky/flucky/pkg/sensor"
"github.com/spf13/cobra"
)
@ -60,7 +60,7 @@ var readTemperatureCmd = &cobra.Command{
cli.PrintMeasuredValues(measuredValues, cnf, os.Stdout)
if logs {
measuredValuesLogfile := logfile.New(cnf.Device.Logfile)
measuredValuesLogfile := logfile.New(cnf.Logfile)
err := logfile.Append(measuredValuesLogfile, compression, round, measuredValues)
if err != nil {
rgbled.Error(rgbLEDs)