Solar Array and home energy dashboard.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

56 lines
1.5 KiB

  1. .PHONY: all
  2. .SUFFIXES: .jspp .js
  3. PROJNAME=solardash
  4. VIRTUALENV ?= virtualenv-3.7
  5. VRITUALENVARGS =
  6. CPP ?= cpp
  7. HOST ?= localhost
  8. RAINEAGLEDATAPREF ?= p/src/raineagle/fixtures/data
  9. FILES=$(PROJNAME)/__init__.py
  10. JSFILES = root/js/solardash.file.js root/js/solardash.https.js root/js/solardash.http.js
  11. THIRDPARTYJS = root/js/jquery.js root/js/highstock.js
  12. root/js/jquery.js:
  13. wget -O $@ "https://code.jquery.com/jquery-3.4.1.min.js"
  14. root/js/highstock.js: Makefile
  15. wget -O - "https://code.highcharts.com/stock/8.0.0/highstock.js" | grep -v '^//# sourceMappingURL=' > $@ || (rm "$@"; false)
  16. root/js/highcharts.js: Makefile
  17. wget -O - "https://code.highcharts.com/stock/8.0.0/highcharts.js" | grep -v '^//# sourceMappingURL=' > $@ || (rm "$@"; false)
  18. root/js/solardash.http.js: root/js/solardash.https.js
  19. ln -s solardash.https.js $@
  20. # manual deps
  21. JSBASE = root/js/solardash.base.js
  22. all: $(JSFILES)
  23. run: $(JSFILES)
  24. $(JSFILES): $(THIRDPARTYJS) $(JSBASE)
  25. .jspp.js:
  26. cat $< $(THIRDPARTYJS) $(JSBASE) > $@ || (rm "$@"; false)
  27. keepupdate:
  28. find . -name '*.js' -o -name '*.jspp' | entr make all
  29. test:
  30. (ls $(FILES) $(JSFILES) | entr sh -c 'make all && python -m coverage run -m unittest $(PROJNAME) && coverage report --omit=p/\* -m -i')
  31. test-noentr:
  32. python -m coverage run -m unittest $(PROJNAME) && coverage report --omit=p/\* -m -i
  33. run: $(JSFILES)
  34. python -m aiohttp.web -H $(HOST) -P 38382 solardash:getapp $(RAINEAGLEDATAPREF)
  35. env:
  36. ($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt)