diff --git a/Dockerfile b/Dockerfile index 08503c7..77bc101 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10-slim +FROM python:3.12-bookworm # Labels LABEL MAINTAINER="Jan-Ole Hübner " @@ -12,5 +12,4 @@ ADD . / # Chmod RUN chmod 755 /pulse.py -CMD ["python3","/get_price.py"] CMD ["python3","/pulse.py"] \ No newline at end of file diff --git a/pulse.py b/pulse.py index 42da4d4..1cf7dbc 100644 --- a/pulse.py +++ b/pulse.py @@ -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...") diff --git a/requirements.txt b/requirements.txt index 25605e1..d74577a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ influxdb-client[ciso] requests -pyTibber +pyTibber @ git+https://github.com/Danielhiversen/pyTibber@f64cb36 tzdata pytz certifi \ No newline at end of file