Plugging new modules in


#1

Can I just plug modules in and out with the dock plugged in?

The reason I ask is that I plugged in the light module (with the weather module already plugged in), and ran into this: https://gist.github.com/ulises/16fc476a4a2610a0e854841ddb740239 (shortened, but that’s the behaviour)


#2

You’re calling c.available and that’s returning a list, but then you’re accessing c directly to try and access a member of that list. Try, for example:

l = c.available()['four']


#3

I think even if I get the light module via c.first(flotilla.Light) I get the same behaviour. I’ll try again and report.

Thanks for the quick reply.


#4

Ok, if I get the module via c.available['four'] it seems to work (hot plugging and unplugging), so it was me trying to wrongly get the module.

Having said that, it’s odd that the client would throw such a fit when you use it the wrong way, i.e. https://gist.github.com/ulises/16fc476a4a2610a0e854841ddb740239#file-light-py-L13-L23 ?


#5

So, I figured out why the client was complaining.

I have collectd running my python script every 1 minute. As I was investigating things, in a python repl, the script got run (by collectd) while I had a client in my repl. I can reproduce this behaviour, so I reckon that was it.