fix(pkg/daemon): use measuredValue interface instead of different structs
This commit is contained in:
@ -7,18 +7,9 @@ import (
|
||||
"github.com/go-flucky/flucky/pkg/types"
|
||||
)
|
||||
|
||||
// HumiditySensor is a interface to describe required functions to measure humidities
|
||||
type HumiditySensor interface {
|
||||
type Sensor interface {
|
||||
GetSensorModel() types.SensorModel
|
||||
ReadHumidity(round float64) (*types.Humidity, error)
|
||||
ReadHumidityWriteIntoChannel(round float64, humidityChannel chan<- *types.Humidity, errorChannel chan<- error, wg *sync.WaitGroup)
|
||||
ReadHumidityContinously(ctx context.Context, round float64, humidityChannel chan<- *types.Humidity, errorChannel chan<- error)
|
||||
}
|
||||
|
||||
// TemperatureSensor is a interface to describe required functions to measure temperatures
|
||||
type TemperatureSensor interface {
|
||||
GetSensorModel() types.SensorModel
|
||||
ReadTemperature(degree types.TemperatureUnit, round float64) (*types.Temperature, error)
|
||||
ReadTemperatureWriteIntoChannel(degree types.TemperatureUnit, round float64, temperatureChannel chan<- *types.Temperature, errorChannel chan<- error, wg *sync.WaitGroup)
|
||||
ReadTemperatureContinously(ctx context.Context, degree types.TemperatureUnit, round float64, temperatureChannel chan<- *types.Temperature, errorChannel chan<- error)
|
||||
Read() ([]types.MeasuredValue, error)
|
||||
ReadChannel(measuredValueChannel chan<- types.MeasuredValue, errorChannel chan<- error, wg *sync.WaitGroup)
|
||||
ReadContinously(ctx context.Context, measuredValueChannel chan<- types.MeasuredValue, errorChannel chan<- error)
|
||||
}
|
||||
|
Reference in New Issue
Block a user