verbump to 0.0.6

This commit is contained in:
Hauke Petersen
2022-09-21 11:21:21 +02:00
parent cb3e651983
commit a22b344028
2 changed files with 4 additions and 5 deletions

View File

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

View File

@@ -21,14 +21,12 @@ import json
import pytz
import logging
import dateutil
import urllib.request
import urllib
from datetime import datetime
from deichapp import Deichapp
from deichflux import Deichflux
from apscheduler.schedulers.blocking import BlockingScheduler
import dateutil
CONFIG_DEFAULT = {
"interval": 5.0,
}
@@ -78,7 +76,8 @@ class Steckie(Deichapp):
now = pytz.UTC.localize(datetime.utcnow())
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"))
except Exception as e:
logging.warning(f'{name} - no response: {e}')