From bcda3ce2f282b84c6d6c955967c956c67dfe373c Mon Sep 17 00:00:00 2001 From: kbickar Date: Fri, 21 Aug 2020 14:32:26 -0400 Subject: [PATCH] Updated snyc version to not validate ssl --- sense_energy/senseable.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sense_energy/senseable.py b/sense_energy/senseable.py index 88a9c50..a830a9d 100644 --- a/sense_energy/senseable.py +++ b/sense_energy/senseable.py @@ -1,5 +1,6 @@ import json import requests +import ssl from requests.exceptions import ReadTimeout from websocket import create_connection from websocket._exceptions import WebSocketTimeoutException @@ -14,7 +15,7 @@ def authenticate(self, username, password): "email": username, "password": password } - + # Create session self.s = requests.session() @@ -48,7 +49,7 @@ def get_realtime_stream(self): ws = 0 url = WS_URL % (self.sense_monitor_id, self.sense_access_token) try: - ws = create_connection(url, timeout=self.wss_timeout) + ws = create_connection(url, timeout=self.wss_timeout, sslopt={"cert_reqs": ssl.CERT_NONE}) while True: # hello, features, [updates,] data result = json.loads(ws.recv()) if result.get('type') == 'realtime_update':