fix: dht11 sensor implementation

This commit is contained in:
Markus Pesch 2019-03-04 10:45:19 +01:00
parent fd638452ac
commit 80dd02f9d5
Signed by: volker.raschek
GPG Key ID: 852BCC170D81A982

View File

@ -29,7 +29,7 @@ func (s *DHT11Sensor) ReadHumidity() (*types.Humidity, error) {
return nil, fmt.Errorf("NewDHT error: %v", err) return nil, fmt.Errorf("NewDHT error: %v", err)
} }
humidityValue, _, err := dht.ReadRetry(11) humidityValue, _, err := dht.Read()
if err != nil { if err != nil {
return nil, fmt.Errorf("Read error: %v", err) return nil, fmt.Errorf("Read error: %v", err)
} }
@ -60,7 +60,7 @@ func (s *DHT11Sensor) ReadTemperature() (*types.Temperature, error) {
return nil, fmt.Errorf("NewDHT error: %v", err) return nil, fmt.Errorf("NewDHT error: %v", err)
} }
_, temperatureValue, err := dht.ReadRetry(11) _, temperatureValue, err := dht.Read()
if err != nil { if err != nil {
return nil, fmt.Errorf("Read error: %v", err) return nil, fmt.Errorf("Read error: %v", err)
} }