Skip to content

Commit

Permalink
Updated snyc version to not validate ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
kbickar committed Aug 21, 2020
1 parent e52644a commit bcda3ce
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sense_energy/senseable.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,7 +15,7 @@ def authenticate(self, username, password):
"email": username,
"password": password
}

# Create session
self.s = requests.session()

Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit bcda3ce

Please sign in to comment.