From 26b91d5d0505854413cc930eecefa20f74be2a01 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Fri, 15 Feb 2019 18:35:29 +0100 Subject: [PATCH] decode-config.py: adapt settings; add Template --- tools/decode-config.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tools/decode-config.py b/tools/decode-config.py index f0779279a..642c31954 100755 --- a/tools/decode-config.py +++ b/tools/decode-config.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -VER = '2.1.0020' +VER = '2.1.0021' """ decode-config.py - Backup/Restore Sonoff-Tasmota configuration data @@ -841,9 +841,37 @@ Setting_6_4_1_13.update ({ 'mhz19b_abc_disable': ('B', (0x717,1, 7), (None, None, ('Sensor', '"Sensor15 {}".format($)')) ), }, 0x717, (None, None, ('*', None)), (None, False) ), }) - +# ====================================================================== +Setting_6_4_1_16 = copy.deepcopy(Setting_6_4_1_13) +Setting_6_4_1_16.update({ + 'user_template_base': ('B', 0x71F, (None, None, ('Management', '"Template {}".format($)')), ('$ + 1','$ - 1') ), + 'user_template': ({ + 'name': ('15s', 0x720, (None, None, ('Management', '"Template {{\\\"NAME\\\":\\\"{}\\\"}}".format($)' )) ), + 'gpio00': ('B', 0x72F, (None, None, ('Management', '"Template {{\\\"GPIO\\\":[{},{},{},{},{},{},{},{},{},{},{},{},{}]}}".format(@["user_template"]["gpio00"],@["user_template"]["gpio01"],@["user_template"]["gpio02"],@["user_template"]["gpio03"],@["user_template"]["gpio04"],@["user_template"]["gpio05"],@["user_template"]["gpio09"],@["user_template"]["gpio10"],@["user_template"]["gpio12"],@["user_template"]["gpio13"],@["user_template"]["gpio14"],@["user_template"]["gpio15"],@["user_template"]["gpio16"])')) ), + 'gpio01': ('B', 0x730, (None, None, ('Management', None)) ), + 'gpio02': ('B', 0x731, (None, None, ('Management', None)) ), + 'gpio03': ('B', 0x732, (None, None, ('Management', None)) ), + 'gpio04': ('B', 0x733, (None, None, ('Management', None)) ), + 'gpio05': ('B', 0x734, (None, None, ('Management', None)) ), + 'gpio09': ('B', 0x735, (None, None, ('Management', None)) ), + 'gpio10': ('B', 0x736, (None, None, ('Management', None)) ), + 'gpio12': ('B', 0x737, (None, None, ('Management', None)) ), + 'gpio13': ('B', 0x738, (None, None, ('Management', None)) ), + 'gpio14': ('B', 0x739, (None, None, ('Management', None)) ), + 'gpio15': ('B', 0x73A, (None, None, ('Management', None)) ), + 'gpio16': ('B', 0x73B, (None, None, ('Management', None)) ), + 'flag': ({ + 'value': ('B', 0x73C , (None, None, ('Management', '"Template {{\\\"FLAG\\\":{}}}".format($)')) ), + 'adc0': ('B', (0x73C,1,0), (None, None, ('Management', None)) ), + 'pullup': ('B', (0x73C,1,1), (None, None, ('Management', None)) ), + }, 0x73C, (None, None, ('Management', None)) + ), + }, 0x720, (None, None, ('Management', '"Template GPIO:{}".format(@["user_template"]["gp"][0])')) + ), +}) # ====================================================================== Settings = [ + (0x6040110, 0xe00, Setting_6_4_1_16), (0x604010D, 0xe00, Setting_6_4_1_13), (0x604010B, 0xe00, Setting_6_4_1_11), (0x6040108, 0xe00, Setting_6_4_1_8), @@ -2850,4 +2878,4 @@ if __name__ == "__main__": tasmotacmnds = Mapping2Cmnd(decode_cfg, configmapping) OutputTasmotaCmnds(tasmotacmnds) - sys.exit(exitcode) \ No newline at end of file + sys.exit(exitcode)