2023-05-18 18:51:41 +00:00
|
|
|
.PHONY: all deps test-deps test deploy run reset
|
2023-05-18 16:37:48 +00:00
|
|
|
|
|
|
|
DEVICE ?= auto
|
|
|
|
DEPS = umqtt.simple
|
|
|
|
TEST_DEPS = unittest
|
|
|
|
|
|
|
|
mpremote = mpremote connect $(DEVICE)
|
|
|
|
|
2023-05-18 18:51:41 +00:00
|
|
|
all: deps deploy reset
|
2023-05-18 16:37:48 +00:00
|
|
|
|
|
|
|
deps: $(DEPS)
|
|
|
|
|
|
|
|
test-deps: $(TEST_DEPS)
|
|
|
|
|
|
|
|
$(DEPS) $(TEST_DEPS):
|
|
|
|
$(mpremote) mip install $@
|
|
|
|
|
|
|
|
test: deploy
|
|
|
|
$(mpremote) cp -r tests ":"
|
|
|
|
$(mpremote) exec 'import unittest; unittest.main("tests")'
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
$(mpremote) cp *.py ":"
|
|
|
|
@if test -f settings.json; then \
|
|
|
|
$(mpremote) cp settings.json ":"; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
run:
|
|
|
|
$(mpremote) run main.py
|
|
|
|
|
|
|
|
reset:
|
|
|
|
$(mpremote) reset
|