Mote arrived yesterday and is working well.
I tried out the Apple Homekit integration (via mote_api.py and Homebridge … and there are a few problems that I think mote_api.py could handle better.
Error as follows:
Traceback (most recent call last):
File "/usr/share/pyshared/flask/app.py", line 1836, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/share/pyshared/flask/app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/usr/share/pyshared/flask/app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/share/pyshared/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/usr/share/pyshared/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/share/pyshared/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/share/pyshared/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/share/pyshared/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/pi/Pimoroni/mote_api.py", line 65, in set_colour
mote_on(colour)
File "/home/pi/Pimoroni/mote_api.py", line 22, in mote_on
r, g, b = hex_to_rgb(c)
File "/home/pi/Pimoroni/mote_api.py", line 19, in hex_to_rgb
return tuple(int(value[i:i + length / 3], 16) for i in range(0, length, length / 3))
File "/home/pi/Pimoroni/mote_api.py", line 19, in <genexpr>
return tuple(int(value[i:i + length / 3], 16) for i in range(0, length, length / 3))
ValueError: invalid literal for int() with base 16: 'NaN'
I suspect that Siri or Apple Home application is not setting some of the values - e.g. Color - when doing a simple On command - which results in error and then issues with Apple thinking device is on when it is not.