From 3005dbe7e7763c4c5dfa66f90f531cd751ef3873 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 2 Sep 2022 11:16:41 +0200 Subject: [PATCH] verbump to 0.0.4 --- setup.py | 2 +- steckie/steckie.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 1455894..e5a5d07 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ import setuptools name = "steckie" -ver = "0.0.3" +ver = "0.0.4" desc = 'Read state from Tasmota smart plugs' setuptools.setup( diff --git a/steckie/steckie.py b/steckie/steckie.py index ae928fb..5c19113 100755 --- a/steckie/steckie.py +++ b/steckie/steckie.py @@ -20,6 +20,7 @@ import sys import json import pytz import logging +import dateutil import urllib.request from datetime import datetime from deichapp import Deichapp @@ -57,9 +58,7 @@ class Steckie(Deichapp): f'ORDER BY DESC LIMIT 1' res = self.db.query(query, None) for p in res.get_points(): - print(p) - last = pytz.UTC.localize(datetime.utcfromtimestamp(p["time"] / 1e9)) - self.counters[name]["last"] = last + self.counters[name]["last"] = dateutil.parser.isoparse(p["time"]) total = p["e_total_kwh"] self.counters[name]["year"] = total - p["e_year_kwh"] self.counters[name]["month"] = total - p["e_month_kwh"]