tasmota / decode-config

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

utcfromtimestamp() deprecated #78

Closed jdwhite closed 9 months ago

jdwhite commented 9 months ago

Describe the bug

This isn't so much a bug, but a FYI regarding a warning I received today:

INFO: Load data by http from device 'plug-1'
/usr/local/bin/decode-config:5926: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
  'timestamp':datetime.utcfromtimestamp(cfg_timestamp).strftime("%Y-%m-%d %H:%M:%S"),
/usr/local/bin/decode-config:5926: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
  'timestamp':datetime.utcfromtimestamp(cfg_timestamp).strftime("%Y-%m-%d %H:%M:%S"),
INFO: Backup successful to 'plug-1_13.2.0_config-20231127_112514.json' (JSON format)
INFO: Backup successful to 'plug-1_13.2.0_backup-20231127_112514.dmp' (Tasmota format)

To Reproduce

Steps to reproduce the behavior:

Run decode-config is any manner that actually performs a download -- not just help.

Expected behavior

Shouldn't see a warning, ideally.

Version Information

Please complete the following information
use decode-config.py -V --debug to retrieve the info

decode-config v13.2.0.2 [71cdd0c] by Norbert Richter nr@prsolution.eu

Script:   decode-config
Version:  13.2.0.2 [71cdd0c]
Python:   3.12.0
Platform: Linux-6.5.12-300.fc39.x86_64-x86_64-with-glibc2.38 - x86_64
OS:       Linux 6.5.12-300.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Nov 20 22:44:24 UTC 2023
Time:     2023-11-27 11:42:25

System' information of your Tasmota data

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

Appending -g System did not produce any additional output than what was provided under "Describe the bug".

Additional context

curzon01 commented 9 months ago

thx