Closed caternuson closed 2 years ago
Some commands only work in idle mode, altitude for example:
This can lead to potentially unexpected hiccups in user code:
>>> scd4x.altitude = 42 >>> scd4x.altitude 42 >>> scd4x.start_periodic_measurement() >>> scd4x.altitude Traceback (most recent call last): File "<stdin>", line 1, in <module> File "adafruit_scd4x.py", line 284, in altitude File "adafruit_scd4x.py", line 307, in _send_command OSError: [Errno 5] Input/output error >>>
Could just catch this in user code, but might be better to handle this more gracefully here in driver code?
ermm maybe throw an exception so at least they know what happened?
like just catch the OSError here and throw something else with a more helpful message?
OSError
yaz
Fixed with #13.
Some commands only work in idle mode, altitude for example:
This can lead to potentially unexpected hiccups in user code:
Could just catch this in user code, but might be better to handle this more gracefully here in driver code?