diff --git a/.development/tilda_tools.py b/.development/tilda_tools.py index 44424f3..8557aac 100755 --- a/.development/tilda_tools.py +++ b/.development/tilda_tools.py @@ -124,8 +124,11 @@ def main(): paths = args.paths if len(args.paths) else None if args.bootstrapped_apps: for k,val in list(resources.items()): + requested = paths and k in paths + bootstrapped = val.get("bootstrapped", False) if val.get("type", None) == "app": - if not k in paths and not val.get("bootstrapped", False): + if not (bootstrapped or (paths and requested)): + # App is not in the bootstrap list, and isn't explicitly requested if args.verbose: print("Removing app '{0}' from sync list".format(k)) del resources[k] diff --git a/air_quality/main.py b/air_quality/main.py new file mode 100644 index 0000000..1b863db --- /dev/null +++ b/air_quality/main.py @@ -0,0 +1,198 @@ +"""This app needs an SDS011 sensor attacthed to UART 4 """ + +___name___ = "Air Quality" +___license___ = "MIT" +___dependencies___ = ["sleep", "app", "ugfx_helper", "buttons", "homescreen"] +___categories___ = ["EMF"] +___bootstrapped___ = False # Whether or not apps get downloaded on first install. Defaults to "False", mostly likely you won't have to use this at all. + +import app +import ugfx, os, time, sleep +from tilda import Buttons +from tilda import Sensors +from machine import Pin +from machine import UART +from machine import Neopix +import random + +class DustSensorTester(object): + + verbose = False + + def contains_sequence (self,data, test): + """ Checks to see if the data sequence contains the test sewquence + + Args: + data: sequence of data items + test: test sequence + Returns: + True if the test sequence is in the data sequence + """ + + if len(data) 0: + sensor_port.readinto(buffer,1) + sensor.pump_byte(buffer[0]) + sleep.wfi() + +ugfx.clear() + +app.restart_to_default() +