Skip to content

Commit 43e0e07

Browse files
author
taradiddles
committed
pylint: disable no-member for dynamically generated values
1 parent 5ab5e92 commit 43e0e07

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Caveat: by default the library initializes the IC with constant temperature and
7878
.. code-block:: python3
7979
8080
dps310.reset()
81-
dps310.pressure_oversample_count = SampleCount.COUNT_2
82-
dps310.pressure_rate = Rate.RATE_1_HZ
83-
dps310.mode = Mode.CONT_PRESSURE
81+
dps310.pressure_oversample_count = adafruit_dps310.SampleCount.COUNT_2
82+
dps310.pressure_rate = adafruit_dps310.Rate.RATE_1_HZ
83+
dps310.mode = adafruit_dps310.Mode.CONT_PRESSURE
8484
dps310.wait_pressure_ready()
8585
8686

examples/dps310_low_power_weather_station.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# low power weather station as recommended in the datasheet:
33
# https://www.infineon.com/dgdl/Infineon-DPS310-DS-v01_00-EN.pdf)
44

5+
# (disable pylint warnings for adafruit_dps310.{SampleCount,Rate,Mode}.*
6+
# as they are generated dynamically)
7+
# pylint: disable=no-member
8+
59
import time
610
import board
711
import busio
@@ -12,11 +16,11 @@
1216
dps310 = adafruit_dps310.DPS310(i2c)
1317

1418
dps310.reset()
15-
dps310.pressure_oversample_count = SampleCount.COUNT_2
16-
dps310.pressure_rate = Rate.RATE_1_HZ
17-
dps310.temperature_oversample_count = SampleCount.COUNT_16
18-
dps310.temperature_rate = Rate.RATE_1_HZ
19-
dps310.mode = Mode.CONT_PRESTEMP
19+
dps310.pressure_oversample_count = adafruit_dps310.SampleCount.COUNT_2
20+
dps310.pressure_rate = adafruit_dps310.Rate.RATE_1_HZ
21+
dps310.temperature_oversample_count = adafruit_dps310.SampleCount.COUNT_16
22+
dps310.temperature_rate = adafruit_dps310.Rate.RATE_1_HZ
23+
dps310.mode = adafruit_dps310.Mode.CONT_PRESTEMP
2024
dps310.wait_temperature_ready()
2125
dps310.wait_pressure_ready()
2226

0 commit comments

Comments
 (0)