diff --git a/pysenec/__init__.py b/pysenec/__init__.py index b170125..852573d 100644 --- a/pysenec/__init__.py +++ b/pysenec/__init__.py @@ -10,7 +10,10 @@ class Senec: def __init__(self, host, websession): self.host = host self.websession: aiohttp.websession = websession - self.url = f"http://{host}/lala.cgi" + if host.startswith("http"): + self.url = f"{host}/lala.cgi" + else: + self.url = f"http://{host}/lala.cgi" @property def system_state(self) -> str: diff --git a/pysenec/cli.py b/pysenec/cli.py index b8c40ac..f9cceb8 100644 --- a/pysenec/cli.py +++ b/pysenec/cli.py @@ -8,7 +8,9 @@ async def run(host, verbose=False): - async with aiohttp.ClientSession() as session: + async with aiohttp.ClientSession( + connector=aiohttp.TCPConnector(verify_ssl=False) + ) as session: senec = pysenec.Senec(host, session) if verbose: await senec.read_senec_v21_all()