scottbonline / sense

Sense Energy Monitor API
MIT License
174 stars 45 forks source link

Can't run on python 2.7.6 #25

Closed tavdog closed 5 years ago

tavdog commented 5 years ago

/usr/local/lib/python2.7/dist-packages/urllib3/util/ssl.py:354: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings SNIMissingWarning /usr/local/lib/python2.7/dist-packages/urllib3/util/ssl.py:150: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecurePlatformWarning Traceback (most recent call last): File "sense_api.py", line 246, in print ("Active:", sense.active_power, "W") File "sense_api.py", line 109, in active_power if not self._realtime: self.get_realtime() File "sense_api.py", line 77, in get_realtime return next(self.get_realtime_stream()) File "sense_api.py", line 95, in get_realtime_stream if ws: ws.close() UnboundLocalError: local variable 'ws' referenced before assignment root@TavChunk:~/src/sense-energy/sense_energy# python --version Python 2.7.6

kbickar commented 5 years ago

There is a scope issue I can fix, but the TLS issues are probably due to your OS. Are you running on CentOS 5 or something similar that doesn't support TLS?

tavdog commented 5 years ago

I'm on Ubuntu 14.04LTS. I tried apt-get install tcltls which did seem to install tls, but getting the same errors.

kbickar commented 5 years ago

Can you see if you still have the issue with version 0.6.0?