decode-config.py: adapt settings

- fix SetOption65 Settings version
- add Setoption66 (buzzer_enable)
- add DisplayWidth (display_width) / DisplayHeight (display_height)
- def housekeeping
This commit is contained in:
Norbert Richter 2019-07-23 18:40:11 +02:00
parent fdda0429d6
commit 9e8d53b977

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
VER = '2.2.0028'
VER = '2.2.0029'
"""
decode-config.py - Backup/Restore Sonoff-Tasmota configuration data
@ -848,7 +848,7 @@ Setting_6_4_1_13.update ({
})
# ======================================================================
Setting_6_4_1_16 = copy.deepcopy(Setting_6_4_1_13)
Setting_6_4_1_16.update({
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($)' )) ),
@ -884,17 +884,17 @@ Setting_6_4_1_18['flag3'][0].update ({
})
# ======================================================================
Setting_6_5_0_3 = copy.deepcopy(Setting_6_4_1_18)
Setting_6_5_0_3.update({
Setting_6_5_0_3.update ({
'novasds_period': ('B', 0x73D, (None, '1 <= $ <= 255', ('Sensor', '"Sensor20 {}".format($)')) ),
})
# ======================================================================
Setting_6_5_0_6 = copy.deepcopy(Setting_6_5_0_3)
Setting_6_5_0_6.update({
Setting_6_5_0_6.update ({
'web_color': ('3B', 0x73E, ([18], None, ('Wifi', '"WebColor{} {}{:06x}".format(#,chr(35),int($,0))')), '"0x{:06x}".format($)' ),
})
# ======================================================================
Setting_6_5_0_7 = copy.deepcopy(Setting_6_5_0_6)
Setting_6_5_0_7.update({
Setting_6_5_0_7.update ({
'ledmask': ('<H', 0x7BC, (None, None, ('Control', '"LedMask {}".format($)')), '"0x{:04x}".format($)' ),
})
# ======================================================================
@ -910,7 +910,7 @@ Setting_6_5_0_11['flag3'][0].update ({
# ======================================================================
Setting_6_5_0_12 = copy.deepcopy(Setting_6_5_0_11)
Setting_6_5_0_12.pop('drivers',None)
Setting_6_5_0_12.update({
Setting_6_5_0_12.update ({
'adc_param_type': ('B', 0x1D5, (None, '2 <= $ <= 3', ('Sensor', '"AdcParam {type},{param1},{param2},{param3}".format(type=$,param1=@["adc_param1"],param2=@["adc_param2"],param3=@["adc_param3"]/10000.0)')) ),
'adc_param1': ('<L', 0x794, (None, None, ('Sensor', None)) ),
'adc_param2': ('<L', 0x798, (None, None, ('Sensor', None)) ),
@ -928,8 +928,18 @@ Setting_6_6_0_1['flag3'][0].update ({
'tuya_dimmer_range_255': ('<L', (0x3A0,1,16), (None, None, ('SetOption', '"SetOption66 {}".format($)')) ),
})
# ======================================================================
Setting_6_6_0_2 = copy.deepcopy(Setting_6_6_0_1)
Setting_6_6_0_2['flag3'][0].update ({
'buzzer_enable': ('<L', (0x3A0,1,17), (None, None, ('SetOption', '"SetOption67 {}".format($)')) ),
})
Setting_6_6_0_2.update ({
'display_width': ('<H', 0x774, (None, None, ('Display', '"DisplayWidth {}".format($)')) ),
'display_height': ('<H', 0x776, (None, None, ('Display', '"DisplayHeight {}".format($)')) ),
})
# ======================================================================
Settings = [
(0x6050010, 0xe00, Setting_6_6_0_1),
(0x6060002, 0xe00, Setting_6_6_0_2),
(0x6060001, 0xe00, Setting_6_6_0_1),
(0x605000F, 0xe00, Setting_6_5_0_15),
(0x605000C, 0xe00, Setting_6_5_0_12),
(0x605000B, 0xe00, Setting_6_5_0_11),