Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8fb9fcadb | ||
|
|
a22b344028 |
2
setup.py
2
setup.py
@@ -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(
|
||||||
|
|||||||
@@ -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}')
|
||||||
|
|||||||
Reference in New Issue
Block a user