tasmota / decode-config

Backup/restore and decode configuration tool for Tasmota
GNU Lesser General Public License v3.0
211 stars 32 forks source link

Feature request: Command output diff showing only non-default settings #36

Closed oakwhiz closed 2 years ago

oakwhiz commented 2 years ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

Describe alternatives you've considered

Additional context

curzon01 commented 2 years ago

regardless of the fact that the command output is insufficient for a complete configuration, what is a default config?

curzon01 commented 2 years ago

Since decode-config has no way of finding out what the default configuration of a Tasmota device is (maybe you mean what a Reset 1 does, I don't know), a difference cannot be determined automatically by accessing the Tasmota configuration data. Tasmota only allows querying and writing of the current binary encrypted configuration data, not more.

Apart from that, it is not recommended to use the output of -T cmnd|-T command as a complete configuration setup, as it is incomplete. The output of the Tasmota commands is intended to quickly convert conscious subsets of settings into Tasmota commands. It must be clear to the user that this is not complete and that the configuration of a Tasmota device using this way is incomplete.

I therefore recommend using the JSON format od decode-config as the basis for an initial setup.

You have to decide for yourselve and for your device(s) what a default configuration is, as this can be very different due to the use of USE_CONFIG_OVERRIDE, among other things.

I recommend then to create a default.json, then with the help of external tools like git diff the differences can be displayed:

git diff --no-index default.json current.json

I do not intend to implement such function processes in decode-config, which are helpful in themselves. That must be reserved for external tools and processes. decode-config should only remain the interface for this.

decode-config only serves to convert the unreadable Tasmota binary format into readable and vice versa.