Markus Pesch
5220eac16b
changes: - remove remote operations - add function to write measured values into a channel - add get humidity sensors from config - add get temperature sensors from config - remove FileLogger - exclude some functions from pkf into internal
21 lines
416 B
Go
21 lines
416 B
Go
package collect
|
|
|
|
import (
|
|
"github.com/volker-raschek/flucky/pkg/types"
|
|
)
|
|
|
|
func Temperatures(temperatureChannel <-chan *types.Temperature) []*types.Temperature {
|
|
temperatureList := make([]*types.Temperature, 0)
|
|
for {
|
|
select {
|
|
case temperature, more := <-temperatureChannel:
|
|
if more {
|
|
temperatureList = append(temperatureList, temperature)
|
|
continue
|
|
}
|
|
default:
|
|
return temperatureList
|
|
}
|
|
}
|
|
}
|