2019-06-13 19:25:32 +00:00
|
|
|
package sensor
|
|
|
|
|
2019-06-17 21:37:48 +00:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
"github.com/go-flucky/flucky/pkg/types"
|
|
|
|
)
|
2019-06-13 19:25:32 +00:00
|
|
|
|
|
|
|
// HumiditySensor is a interface to describe required functions to measure humidities
|
|
|
|
type HumiditySensor interface {
|
|
|
|
GetSensorModel() types.SensorModel
|
2019-06-18 21:02:11 +00:00
|
|
|
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)
|
2019-06-13 19:25:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TemperatureSensor is a interface to describe required functions to measure temperatures
|
|
|
|
type TemperatureSensor interface {
|
|
|
|
GetSensorModel() types.SensorModel
|
2019-06-23 12:17:57 +00:00
|
|
|
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)
|
2019-06-13 19:25:32 +00:00
|
|
|
}
|