From a2e9313bcb775d46626cddba1f1de62479867e31 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 30 Apr 2018 22:19:09 +0200 Subject: [PATCH] Prepare specialized configs Signed-off-by: Knut Ahlers --- Makefile | 6 +++--- config.yml => config_sonoff.yml | 0 update.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) rename config.yml => config_sonoff.yml (100%) 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):