Skip to content

Commit 7d2eb7a

Browse files
committed
updating according to feedback
1 parent 4329a90 commit 7d2eb7a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

adafruit_ags02ma.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
try:
3131
from busio import I2C
32-
from typing_extensions import NoReturn
3332
except ImportError:
3433
pass
3534

@@ -53,7 +52,7 @@
5352
def _generate_crc(data: int) -> int:
5453
"""8-bit CRC algorithm for checking data
5554
56-
:param bytearray data: The data to generate a CRC for
55+
:param int data: The data to generate a CRC for
5756
"""
5857

5958
crc = _AGS02MA_CRC8_INIT
@@ -73,7 +72,9 @@ class AGS02MA:
7372
"""Driver for the AGS02MA air quality sensor.
7473
7574
.. warning::
76-
I2C communication rate cannot be higher than 30KHZ
75+
I2C communication rate cannot be higher than 30KHZ. Refer to
76+
https://cdn-shop.adafruit.com/product-files/5593/datasheet+ags02ma.pdf
77+
Section 3.
7778
7879
:param ~busio.I2C i2c_bus: The I2C bus the AGS02MA is connected to.
7980
:param int address: The I2C device address. Defaults to :const:`0x1A`
@@ -123,7 +124,7 @@ def firmware_version(self) -> int:
123124
return self._read_reg(_AGS02MA_VERSION_REG, 30)
124125

125126
@property
126-
def gas_resistance(self) -> float:
127+
def gas_resistance(self) -> int:
127128
"""The resistance of the MEMS gas sensor"""
128129
return self._read_reg(_AGS02MA_GASRES_REG, 1500) * 100 # in 0.1Kohm
129130

@@ -140,7 +141,7 @@ def TVOC(self) -> int: # pylint: disable=invalid-name
140141
raise RuntimeError("Sensor still preheating")
141142
return val & 0xFFFFFF
142143

143-
def set_address(self, new_addr: int) -> NoReturn:
144+
def set_address(self, new_addr: int) -> None:
144145
"""Set the address for the I2C interface, from 0x0 to 0x7F
145146
The sensor supports modifying the I2C address. After sending
146147
this command, the new address will take effect immediately,

0 commit comments

Comments
 (0)