- data = pms5003.read()
- data = data.pm_ug_per_m3(2.5)
- display_text(variables[mode], data, unit)
+ try:
+ data = pms5003.read()
+ except pmsReadTimeoutError:
+ logging.warn("Failed to read PMS5003")
+ else:
+ data = data.pm_ug_per_m3(2.5)
+ display_text(variables[mode], data, unit)