Errors when LIFX device name has apostrophe

User avatar
edrabbit
Posts: 39
Joined: Wed Apr 09, 2014 11:31 pm

Errors when LIFX device name has apostrophe

Post by edrabbit »

Here are the errors I was seeing in my Indigo logs from the plugin when loading the LIFX plugin:

Code: Select all

 LIFX Error                      StandardError detected communicating with LIFX lamp. Line '165' has error=''ascii' codec can't decode byte 0xe2 in position 2: ordinal not in range(128)'
After throwing that error, all the lights showed up in red with No ack in Indigo because it bailed on communicating with the rest.

This is more of an iOS/LIFX issue, but caused an issue for me when interacting with the plugin in Indigo. This happens when I had an apostrophe in my LIFX device name (ex. Ed's Light). At least I thought it was an apostrophe. Turns out when I set the device name through the LIFX iOS app, the apostrophe on the iOS keyboard is actually the unicode right quote (u\2019) and LIFX stores it as such. If you want to use a real ascii apostrophe, long press on the right quote and select the actual apostrophe from the popup. Or you can just remove the quote mark from the name altogether.

Looks like other unicode characters will also cause this error.

Hopefully this saves someone from some head scratching and python debugging.
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: Errors when LIFX device name has apostrophe

Post by autolog »

edrabbit wrote:... Hopefully this saves someone from some head scratching and python debugging.
Many thanks for the heads-up. I will look at handling this in a future version. :)
Post Reply

Return to “LIFX Controller”