doobix / csgo-c4-hue

Change the colors of your Philips Hue lights based on the CS:GO C4 bomb status
MIT License
24 stars 5 forks source link

Python 3 intégration #2

Closed sebburon closed 8 years ago

sebburon commented 8 years ago

Your code is amazing i was trying to update it so it could run on python 3 but can't get around this error TypeError: the JSON object must be str, not 'bytes'

doobix commented 8 years ago

i haven't messed with python 3 yet, but i did some googling...

in csgo-c4-hue-server.py, this line:

json_data = json.loads(request.data)

probably needs to be changed to this:

json_data = json.loads(request.data.decode())

or to this:

json_data = json.loads(request.data.decode('utf-8'))
sebburon commented 8 years ago

i'll try and keep you posted !

sebburon commented 8 years ago

Now fully working with python 3 !

doobix commented 8 years ago

awesome, good job!