diff --git a/src/esp_sensors/dht22.py b/src/esp_sensors/dht22.py index 49b755d..9b6525f 100644 --- a/src/esp_sensors/dht22.py +++ b/src/esp_sensors/dht22.py @@ -129,7 +129,7 @@ class DHT22Sensor(TemperatureSensor, HumiditySensor): def read_humidity(self) -> float: """ - Read the current humidity. + Just returns the _last_humidity. If reading the sensor is needed, call read_temperature first. Returns: The humidity reading as a float (percentage) diff --git a/tests/test_dht22_sensor.py b/tests/test_dht22_sensor.py index 6e77531..500001c 100644 --- a/tests/test_dht22_sensor.py +++ b/tests/test_dht22_sensor.py @@ -113,7 +113,7 @@ def test_dht22_read_updates_both_values(): old_temp = sensor._last_reading sensor._last_humidity = None - # Reading humidity should not change temperature + # Reading humidity should not change anything by itself humidity = sensor.read_humidity() assert sensor._last_reading == old_temp - assert humidity is not None + assert humidity is None