add: internal pkgs
This commit is contained in:
@ -5,6 +5,8 @@ import (
|
||||
"io"
|
||||
"text/tabwriter"
|
||||
|
||||
"git.cryptic.systems/fh-trier/go-flucky/pkg/internal/temperature"
|
||||
|
||||
"git.cryptic.systems/fh-trier/go-flucky/pkg/config"
|
||||
"git.cryptic.systems/fh-trier/go-flucky/pkg/types"
|
||||
)
|
||||
@ -103,29 +105,7 @@ func PrintSensors(cnf *config.FluckyConfig, w io.Writer) error {
|
||||
// PrintTemperatures displays a list of temperatures
|
||||
func PrintTemperatures(temperatures []*types.Temperature, cnf *config.FluckyConfig, w io.Writer) {
|
||||
|
||||
sensors := []*types.Sensor{}
|
||||
|
||||
// Search after sensors
|
||||
for _, temperature := range temperatures {
|
||||
found := false
|
||||
|
||||
// Search for the sensor that has acquired the measured value
|
||||
for _, sensor := range cnf.Sensors {
|
||||
if sensor.SensorID == temperature.SensorID {
|
||||
sensors = append(sensors, sensor)
|
||||
found = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// If it was not found, pass only the sensor with the UUID on
|
||||
if !found {
|
||||
sensor := &types.Sensor{
|
||||
SensorID: temperature.SensorID,
|
||||
}
|
||||
sensors = append(sensors, sensor)
|
||||
}
|
||||
}
|
||||
sensors := temperature.GetSensorsByTemperatures(temperatures, cnf)
|
||||
|
||||
// sort temperature values for every sensor
|
||||
orderedTemperatures := make(map[string][]*types.Temperature)
|
||||
|
Reference in New Issue
Block a user