jertel / vuegraf

Populate metrics from your Emporia Vue energy monitoring devices into an InfluxDB
MIT License
169 stars 54 forks source link

Fix --resetdatabase #147

Closed cdolghier closed 10 months ago

cdolghier commented 10 months ago

After https://github.com/jertel/vuegraf/commit/ea9f9f0afdd801eba9ae85bc8bd9aff0afabf8a5, startupTime has a timezone != None which per spec means that the offset will be included in the generated string: https://docs.python.org/3/library/datetime.html#datetime.datetime.isoformat.

InfluxDB doesn't accept this format, so this MR hackishly removes the suffix. It's quite a dirty fix - the only alternative I am aware of involves creating an identical object with tz=None, but that would run into deprecated methods.

jertel commented 10 months ago

Emporia servers don't accept this format, so this MR hackishly removes the suffix.

You mentioned Emporia servers don't accept this format, but the variable that is affected is stop which only is used in the call to delete the influxDB records. Did you mean InfluxDB, and not Emporia?

cdolghier commented 10 months ago

Ouch you are right, my mistake. Corrected the description.

jertel commented 10 months ago

Thanks. Can you also add a note in the CHANGELOG.md, under the Other changes section? Use the TBD section since there's currently no version number assigned to the next release.