pytibber bugfixes

This commit is contained in:
Jan-Ole Hübner 2024-05-08 13:12:24 +02:00
parent 7546d1fdc7
commit d683970918
3 changed files with 6 additions and 5 deletions

View file

@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.12-bookworm
# Labels
LABEL MAINTAINER="Jan-Ole Hübner <huebner@jan-ole.de>"
@ -12,5 +12,4 @@ ADD . /
# Chmod
RUN chmod 755 /pulse.py
CMD ["python3","/get_price.py"]
CMD ["python3","/pulse.py"]

View file

@ -31,7 +31,7 @@ logger.addHandler(ch)
logger.setLevel(logging.INFO)
__version__ = "v0.1.3"
__version__ = "v0.1.4"
logger.info(__version__)
client = InfluxDBClient(url=URL, token=TOKEN, org=ORG)
@ -53,12 +53,14 @@ def _incoming(pkg):
async def run():
conn = aiohttp.TCPConnector(limit_per_host=3)
async with aiohttp.ClientSession(trust_env=True, connector=conn) as session:
logger.info("connecting to tibber...")
if session.closed:
logger.error("session closed")
exit(1)
try:
tibber_connection = tibber.Tibber(TIBBERTOKEN, user_agent="python")
tibber_connection = tibber.Tibber(TIBBERTOKEN, user_agent="python",websession=session)
except Exception as e:
logger.info("error connecting to tibber...")

View file

@ -1,6 +1,6 @@
influxdb-client[ciso]
requests
pyTibber
pyTibber @ git+https://github.com/Danielhiversen/pyTibber@f64cb36
tzdata
pytz
certifi