tasmota / decode-config

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

returncode to bash is always 0 #75

Closed b0wtie closed 11 months ago

b0wtie commented 11 months ago

Describe the bug

When I use bash to invoke decode-config.py to backup or restore my tasmota-devices, I always get a returncode of 0, even if the operation fails. This troubles me, because I only want to reset and / or upgrade my device once I have a working backup.

To Reproduce

Expected behavior

If i use a non-tasmota IP in the $tasmota_ip variable, the backup option fails and the bash script should see the return code.

Version Information

Script:   decode-config.py
Version:  13.1.0.2 [3fb1a98]
Python:   3.11.2
Platform: Linux-6.1.0-13-amd64-x86_64-with-glibc2.36 - x86_64
OS:       Linux 6.1.0-13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29)
Time:     2023-10-08 17:01:43

System' information of your Tasmota data

Append -g System to your decode-config parameter, e. g. decode-config.py -s myconfig.dmp -g System

Even when appending -g System to the call of decode-config in my script, it still always returns 0.

Additional context

Please be patient with me if this has to do with my bad understanding of venvs and not with decode-config. Thank you very much!

Edit: I installed the librarys systemwide with "--break-system-packages" flag. This way I can run the decode-config.py "directly" without a virtual environment. This also always returns 0.