diff options
author | Thijs Triemstra <info@collab.nl> | 2023-11-17 04:06:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-16 22:06:13 -0500 |
commit | 4688c21c54dfb89ef9902b607521a8cc0e99c94a (patch) | |
tree | 4f446f98f659335ef6036c614d40b3298f8230dd /klippy/extras/htu21d.py | |
parent | 3f8f30d6123c647c05ba3f4f58477d9dda36f03f (diff) | |
download | kutter-4688c21c54dfb89ef9902b607521a8cc0e99c94a.tar.gz kutter-4688c21c54dfb89ef9902b607521a8cc0e99c94a.tar.xz kutter-4688c21c54dfb89ef9902b607521a8cc0e99c94a.zip |
klippy: Replace deprecated logger.warn with logger.warning (#6385)
Replace deprecated logger.warn with logger.warning
logger.warn will be removed in Python 3.13
Signed-off-by: Thijs Triemstra <info@collab.nl>
Diffstat (limited to 'klippy/extras/htu21d.py')
-rw-r--r-- | klippy/extras/htu21d.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/klippy/extras/htu21d.py b/klippy/extras/htu21d.py index 16da7f8e..ec44da63 100644 --- a/klippy/extras/htu21d.py +++ b/klippy/extras/htu21d.py @@ -126,7 +126,7 @@ class HTU21D: rdevId |= response[1] checksum = response[2] if self._chekCRC8(rdevId) != checksum: - logging.warn("htu21d: Reading deviceId !Checksum error!") + logging.warning("htu21d: Reading deviceId !Checksum error!") rdevId = rdevId >> 8 deviceId_list = list( filter( @@ -135,10 +135,10 @@ class HTU21D: if len(deviceId_list) != 0: logging.info("htu21d: Found Device Type %s" % deviceId_list[0]) else: - logging.warn("htu21d: Unknown Device ID %#x " % rdevId) + logging.warning("htu21d: Unknown Device ID %#x " % rdevId) - if(self.deviceId != deviceId_list[0]): - logging.warn( + if self.deviceId != deviceId_list[0]: + logging.warning( "htu21d: Found device %s. Forcing to type %s as config.", deviceId_list[0],self.deviceId) @@ -169,7 +169,9 @@ class HTU21D: rtemp = response[0] << 8 rtemp |= response[1] if self._chekCRC8(rtemp) != response[2]: - logging.warn("htu21d: Checksum error on Temperature reading!") + logging.warning( + "htu21d: Checksum error on Temperature reading!" + ) else: self.temp = (0.002681 * float(rtemp) - 46.85) logging.debug("htu21d: Temperature %.2f " % self.temp) @@ -190,7 +192,7 @@ class HTU21D: rhumid = response[0] << 8 rhumid|= response[1] if self._chekCRC8(rhumid) != response[2]: - logging.warn("htu21d: Checksum error on Humidity reading!") + logging.warning("htu21d: Checksum error on Humidity reading!") else: #clear status bits, # humidity always returns xxxxxx10 in the LSB field |