Skip to content

Commit a7bb614

Browse files
committed
docs
1 parent 297fffa commit a7bb614

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

adafruit_hdc302x.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
class HDC302x:
4242
"""Driver for the HDC302x temperature and humidity sensor."""
4343

44+
# Auto modes
4445
AUTO_MODES: Dict[str, int] = {
4546
"5MPS_LP0": 0x2032,
4647
"5MPS_LP1": 0x2024,
@@ -64,7 +65,7 @@ class HDC302x:
6465
"10MPS_LP3": 0x27FF,
6566
"EXIT_AUTO_MODE": 0x3093,
6667
}
67-
68+
# Heater power options
6869
HEATER_POWERS: Dict[str, int] = {
6970
"OFF": 0x0000,
7071
"QUARTER_POWER": 0x009F,
@@ -85,7 +86,7 @@ def __init__(self, i2c_bus: busio.I2C, address: int = 0x44) -> None:
8586
@property
8687
def heater(self) -> bool:
8788
"""
88-
Check if the heater is on.
89+
Heater power
8990
9091
:return: True if the heater is on, False otherwise.
9192
"""
@@ -95,8 +96,6 @@ def heater(self) -> bool:
9596
@heater.setter
9697
def heater(self, power: str) -> None:
9798
"""
98-
Set the heater power.
99-
10099
:param power: The heater power level.
101100
"""
102101
if power not in self.HEATER_POWERS:
@@ -130,7 +129,7 @@ def manufacturer_id(self) -> int:
130129
@property
131130
def nist_id(self) -> List[int]:
132131
"""
133-
Get the NIST ID of the sensor.
132+
NIST ID of the sensor.
134133
135134
:return: NIST ID as a list of integers.
136135
"""
@@ -149,7 +148,7 @@ def nist_id(self) -> List[int]:
149148
@property
150149
def auto_mode(self) -> int:
151150
"""
152-
Current auto mode.
151+
Auto mode for measurements.
153152
154153
:return: The current auto mode.
155154
"""
@@ -158,8 +157,6 @@ def auto_mode(self) -> int:
158157
@auto_mode.setter
159158
def auto_mode(self, mode: int) -> None:
160159
"""
161-
Set the auto mode.
162-
163160
:param mode: The auto mode to set.
164161
"""
165162
if mode not in self.AUTO_MODES:
@@ -171,7 +168,7 @@ def auto_mode(self, mode: int) -> None:
171168
@property
172169
def offsets(self) -> Tuple[float, float]:
173170
"""
174-
Get the temperature and humidity offsets.
171+
Set temperature and relative humidity offsets
175172
176173
:return: The temperature and humidity offsets.
177174
"""
@@ -185,8 +182,6 @@ def offsets(self) -> Tuple[float, float]:
185182
@offsets.setter
186183
def offsets(self, temp: float, humid: float) -> None:
187184
"""
188-
Set the temperature and humidity offsets.
189-
190185
:param values: A tuple containing the temperature and humidity offsets.
191186
"""
192187
rh_offset = self._calculate_offset(humid, False)
@@ -197,7 +192,7 @@ def offsets(self, temp: float, humid: float) -> None:
197192
@property
198193
def auto_temperature(self) -> float:
199194
"""
200-
Get the temperature in auto mode.
195+
Read temperature in auto mode.
201196
202197
:return: The temperature in degrees Celsius.
203198
"""
@@ -207,7 +202,7 @@ def auto_temperature(self) -> float:
207202
@property
208203
def auto_relative_humidity(self) -> float:
209204
"""
210-
Get the relative humidity in auto mode.
205+
Read relative humidity in auto mode.
211206
212207
:return: The relative humidity in percent.
213208
"""

0 commit comments

Comments
 (0)