Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use late configuration to detect senec system version and wallbox #14

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
use https and dont verify ssl certificates
Ulf Dambacher committed Sep 4, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 0bf31ce9356019715f8ca8a56a62329d5768ef49
7 changes: 3 additions & 4 deletions pysenec/__init__.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ class Senec:
def __init__(self, host, websession):
self.host = host
self.websession: aiohttp.websession = websession
self.url = f"http://{host}/lala.cgi"
self.url = f"https://{host}/lala.cgi"

self.type = None # variables for late config
self.hasWallbox = False
@@ -255,8 +255,7 @@ async def late_config(self):
"HW_TYPE": "",
},
}

async with self.websession.post(self.url, json=identForm) as res:
async with self.websession.post(self.url, json=identForm, ssl=False) as res:
res.raise_for_status()
self._ident = parse(await res.json())

@@ -399,6 +398,6 @@ async def read_senec(self, form):
Note: Not all values are "high priority" and reading everything causes problems with Senec device, i.e. no sync with Senec cloud possible.
"""

async with self.websession.post(self.url, json=form) as res:
async with self.websession.post(self.url, json=form, ssl=False) as res:
res.raise_for_status()
self._raw = parse(await res.json())