glynhudson / leaf-python-mqtt

Extract data from Nissan Leaf API and post to mqtt
Apache License 2.0
24 stars 7 forks source link

Python 3.6 #11

Open mph88 opened 6 years ago

mph88 commented 6 years ago

Thanks for the great work you did with this program. I wanted to make your version work under py3.6, so there were a couple of changes I noticed. I'm using the py3 fork of pycarwings2 by BenWoodford.

lower case on ConfigParser in line5: from configparser import SafeConfigParser

The mqtt message to run get_leaf_update or climate_control was not working due to the change in bytes/strings. In line 56, should be: logging.info(msg.topic+" "+msg.payload.decode('UTF-8'))

By the same token in line 59: control_message = msg.payload.decode('UTF-8')

I don't know if these break your version for py2 as I didn't test.

filcole commented 5 years ago

Hi @mph88,

I've made another fork of pycarwings2, supporting python3 and with a few other bug fixes, see https://github.com/filcole/pycarwings2. I've uploaded it to PyPi to make it easy to include.