from enviroplus import gas
from subprocess import PIPE, Popen
from PIL import Image
from enviroplus import gas
from subprocess import PIPE, Popen
from PIL import Image
y = y_offset + ((HEIGHT / row_count) * (i % row_count))
message = "{}: {:.1f} {}".format(variable[:4], data_value, unit)
lim = limits[i]
y = y_offset + ((HEIGHT / row_count) * (i % row_count))
message = "{}: {:.1f} {}".format(variable[:4], data_value, unit)
lim = limits[i]
else:
data = float(data.pm_ug_per_m3(1.0))
display_text(variables[mode], data, unit)
else:
data = float(data.pm_ug_per_m3(1.0))
display_text(variables[mode], data, unit)
else:
data = float(data.pm_ug_per_m3(2.5))
display_text(variables[mode], data, unit)
else:
data = float(data.pm_ug_per_m3(2.5))
display_text(variables[mode], data, unit)
else:
data = float(data.pm_ug_per_m3(10))
display_text(variables[mode], data, unit)
else:
data = float(data.pm_ug_per_m3(10))
display_text(variables[mode], data, unit)
- except pmsReadTimeoutError:
- logging.warn("Failed to read PMS5003")
+ except (SerialTimeoutError, pmsReadTimeoutError):
+ logging.warning("Failed to read PMS5003")
else:
save_data(7, float(pms_data.pm_ug_per_m3(1.0)))
save_data(8, float(pms_data.pm_ug_per_m3(2.5)))
else:
save_data(7, float(pms_data.pm_ug_per_m3(1.0)))
save_data(8, float(pms_data.pm_ug_per_m3(2.5)))