Skip to content

Commit 75fdee6

Browse files
committed
Remove Optional typing, comments about returning None
It looks to be a holdover from a previous commit that actually did have the ability to return None.
1 parent a824e49 commit 75fdee6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

adafruit_bme280/basic.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,9 @@ def temperature(self) -> float:
204204
return self._t_fine / 5120.0
205205

206206
@property
207-
def pressure(self) -> Optional[float]:
207+
def pressure(self) -> float:
208208
"""
209209
The compensated pressure in hectoPascals.
210-
returns None if pressure measurement is disabled
211210
"""
212211
self._read_temperature()
213212

@@ -237,18 +236,16 @@ def pressure(self) -> Optional[float]:
237236
return pressure
238237

239238
@property
240-
def relative_humidity(self) -> Optional[float]:
239+
def relative_humidity(self) -> float:
241240
"""
242241
The relative humidity in RH %
243-
returns None if humidity measurement is disabled
244242
"""
245243
return self.humidity
246244

247245
@property
248-
def humidity(self) -> Optional[float]:
246+
def humidity(self) -> float:
249247
"""
250248
The relative humidity in RH %
251-
returns None if humidity measurement is disabled
252249
"""
253250
self._read_temperature()
254251
hum = self._read_register(0xFD, 2) # BME280_REGISTER_HUMIDDATA

0 commit comments

Comments
 (0)