2 Commits

Author SHA1 Message Date
Hauke Petersen
f8fb9fcadb verbump to 0.0.7 2022-10-10 12:52:57 +02:00
Hauke Petersen
a22b344028 verbump to 0.0.6 2022-09-21 11:21:21 +02:00
2 changed files with 6 additions and 7 deletions

View File

@@ -21,7 +21,7 @@
import setuptools import setuptools
name = "steckie" name = "steckie"
ver = "0.0.5" ver = "0.0.7"
desc = 'Read state from Tasmota smart plugs' desc = 'Read state from Tasmota smart plugs'
setuptools.setup( setuptools.setup(

View File

@@ -21,14 +21,12 @@ import json
import pytz import pytz
import logging import logging
import dateutil import dateutil
import urllib.request import urllib
from datetime import datetime from datetime import datetime
from deichapp import Deichapp from deichapp import Deichapp
from deichflux import Deichflux from deichfluxx import Deichfluxx
from apscheduler.schedulers.blocking import BlockingScheduler from apscheduler.schedulers.blocking import BlockingScheduler
import dateutil
CONFIG_DEFAULT = { CONFIG_DEFAULT = {
"interval": 5.0, "interval": 5.0,
} }
@@ -39,7 +37,7 @@ class Steckie(Deichapp):
super().__init__(cfg_file, CONFIG_DEFAULT) super().__init__(cfg_file, CONFIG_DEFAULT)
self.scheduler = BlockingScheduler() self.scheduler = BlockingScheduler()
self.db = Deichflux(self.cfg["db"]) self.db = Deichfluxx.init(self.cfg["db"])
logging.warning("Steckie V0.72 - loaded...") logging.warning("Steckie V0.72 - loaded...")
@@ -78,7 +76,8 @@ class Steckie(Deichapp):
now = pytz.UTC.localize(datetime.utcnow()) now = pytz.UTC.localize(datetime.utcnow())
try: try:
with urllib.request.urlopen(f'{url}/cm?cmnd=Status%208') as raw: with urllib.request.urlopen(f'{url}/cm?cmnd=Status%208',
timeout=self.cfg["timeout"]) as raw:
resp = json.loads(raw.read().decode("utf-8")) resp = json.loads(raw.read().decode("utf-8"))
except Exception as e: except Exception as e:
logging.warning(f'{name} - no response: {e}') logging.warning(f'{name} - no response: {e}')