fix(pkg/logfile): add temperature json testfiles

This commit is contained in:
2019-06-14 21:35:13 +02:00
parent 510819654a
commit 8aa6db6b7d
12 changed files with 510 additions and 41 deletions

View File

@ -1,33 +1,26 @@
package daemon
import (
"fmt"
"os"
"os/signal"
"syscall"
"github.com/volker-raschek/flucky/pkg/config"
"github.com/volker-raschek/flucky/pkg/sensor"
"github.com/volker-raschek/flucky/pkg/types"
)
// Start the daemon
func Start(cnf *config.FluckyConfig) error {
func Start(cnf *config.Configuration) error {
interrupt := make(chan os.Signal, 1)
signal.Notify(interrupt, os.Interrupt, os.Kill, syscall.SIGTERM)
// interrupt := make(chan os.Signal, 1)
// signal.Notify(interrupt, os.Interrupt, os.Kill, syscall.SIGTERM)
humidityChannel := make(chan *types.Humidity)
temperatureChannel := make(chan *types.Temperature)
// humidityChannel := make(chan *types.Humidity)
// temperatureChannel := make(chan *types.Temperature)
go sensor.ReadHumiditiesContinuously(humiditySensors, humidityChannel)
go sensor.ReadTemperaturesContinuously(temperatureSensors, temperatureChannel)
for {
select {
case killSignal := <-interrupt:
return fmt.Errorf("Daemon was interruped by system signal %v", killSignal)
}
}
// go sensor.ReadHumiditiesContinuously(humiditySensors, humidityChannel)
// go sensor.ReadTemperaturesContinuously(temperatureSensors, temperatureChannel)
// for {
// select {
// case killSignal := <-interrupt:
// return fmt.Errorf("Daemon was interruped by system signal %v", killSignal)
// }
// }
return nil
}