diff --git a/Makefile b/Makefile index 07add8e..dd2c8e2 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ chown: ci: full-clean default -build_%: download update_user-config venv +build_%: download update_user-config_$* venv cd tasmota && ../venv/bin/platformio run -e $* mkdir -p build cp tasmota/.pioenvs/$*/firmware.bin build/$*.bin @@ -22,8 +22,8 @@ download: full-clean: clean rm -rf build -update_user-config: venv - ./venv/bin/python update.py +update_user-config_%: venv + ./venv/bin/python update.py config_$*.yml cd tasmota && git --no-pager diff -w sonoff/user_config.h venv: diff --git a/config.yml b/config_sonoff.yml similarity index 100% rename from config.yml rename to config_sonoff.yml diff --git a/update.py b/update.py index d43720e..d91684c 100644 --- a/update.py +++ b/update.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import os +import sys import yaml @@ -25,7 +26,7 @@ def get_line(param, content, comment): def main(): - cfg = yaml.load(open('config.yml')) + cfg = yaml.load(open(sys.argv[1])) config = open('tasmota/sonoff/user_config.h').read().split('\n') for (i, line) in enumerate(config):