verbump to 0.0.4
This commit is contained in:
2
setup.py
2
setup.py
@@ -21,7 +21,7 @@
|
|||||||
import setuptools
|
import setuptools
|
||||||
|
|
||||||
name = "steckie"
|
name = "steckie"
|
||||||
ver = "0.0.3"
|
ver = "0.0.4"
|
||||||
desc = 'Read state from Tasmota smart plugs'
|
desc = 'Read state from Tasmota smart plugs'
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import sys
|
|||||||
import json
|
import json
|
||||||
import pytz
|
import pytz
|
||||||
import logging
|
import logging
|
||||||
|
import dateutil
|
||||||
import urllib.request
|
import urllib.request
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from deichapp import Deichapp
|
from deichapp import Deichapp
|
||||||
@@ -57,9 +58,7 @@ class Steckie(Deichapp):
|
|||||||
f'ORDER BY DESC LIMIT 1'
|
f'ORDER BY DESC LIMIT 1'
|
||||||
res = self.db.query(query, None)
|
res = self.db.query(query, None)
|
||||||
for p in res.get_points():
|
for p in res.get_points():
|
||||||
print(p)
|
self.counters[name]["last"] = dateutil.parser.isoparse(p["time"])
|
||||||
last = pytz.UTC.localize(datetime.utcfromtimestamp(p["time"] / 1e9))
|
|
||||||
self.counters[name]["last"] = last
|
|
||||||
total = p["e_total_kwh"]
|
total = p["e_total_kwh"]
|
||||||
self.counters[name]["year"] = total - p["e_year_kwh"]
|
self.counters[name]["year"] = total - p["e_year_kwh"]
|
||||||
self.counters[name]["month"] = total - p["e_month_kwh"]
|
self.counters[name]["month"] = total - p["e_month_kwh"]
|
||||||
|
|||||||
Reference in New Issue
Block a user