Skip to content

Commit

Permalink
change sensors address to 01 (#14074)
Browse files Browse the repository at this point in the history
Co-authored-by: wweiye <[email protected]>
  • Loading branch information
2 people authored and ncdiehl11 committed Dec 19, 2023
1 parent d19e1d9 commit 983b5d4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hardware-testing/hardware_testing/drivers/asair_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,9 @@ def get_reading(self) -> Reading:

def get_serial(self) -> str:
"""Read the device ID register."""
serial_addr = "0A"
data_packet = "{}0300000002{}".format(serial_addr, addrs[serial_addr])
data_packet = "{}0300000002{}".format(
self._sensor_address, addrs[self._sensor_address]
)
log.debug(f"sending {data_packet}")
command_bytes = codecs.decode(data_packet.encode(), "hex")
try:
Expand All @@ -197,6 +198,7 @@ def get_serial(self) -> str:

length = self._th_sensor.inWaiting()
res = self._th_sensor.read(length)
res = codecs.encode(res, "hex")
log.debug(f"received {res}")
dev_id = res[6:14]
return dev_id.decode()
Expand Down

0 comments on commit 983b5d4

Please sign in to comment.