Skip to content

Commit

Permalink
don't (find) a sensor if there is no serial
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanthecoder committed Mar 7, 2024
1 parent 2044d6b commit 424ac19
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hardware-testing/hardware_testing/drivers/asair_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ def BuildAsairSensor(simulate: bool, autosearch: bool = True) -> AsairSensorBase
ui.print_info(f"Trying to connect to env sensor on port {port}")
sensor = AsairSensor.connect(port)
ser_id = sensor.get_serial()
ui.print_info(f"Found env sensor {ser_id} on port {port}")
return sensor
if len(ser_id) != 0:
ui.print_info(f"Found env sensor {ser_id} on port {port}")
return sensor
except: # noqa: E722
pass
use_sim = ui.get_user_answer("No env sensor found, use simulator?")
Expand Down

0 comments on commit 424ac19

Please sign in to comment.