TheThingSystem / steward

The Thing System is a set of software components and network protocols that aims to fix the Internet of Things. Our steward software is written in node.js making it both portable and easily extensible. It can run on your laptop, or fit onto a small single board computer like the Raspberry Pi.
http://thethingsystem.com
Other
347 stars 81 forks source link

how are devices discovered? #82

Closed RussNelson closed 10 years ago

RussNelson commented 10 years ago

I'm not seeing something. Maybe it's already written down, and I just don't know where to look. I can see where the blink1 and blinkstick drivers periodically scan, and when they find something, they call devices.discover(), which presumably calls exports.Device() . I don't see how Insteon discovers new devices, though. It looks like the lower-level Insteon code is calling devices.discover() itself.

I'm guessing that I can initialize the lifx driver in the exports.start code, and it will generate a 'bulb' event to which I can listen and create the data structure and call devices.discover().

RussNelson commented 10 years ago

Well, at least in theory my lifx driver compiles and is running but .... I see no indication that my code has ever executed. Maybe the template needs more logging code, to give n00bs more confidence that things are working as planned?

mrose17 commented 10 years ago

go to core/utility.js and you'll see a line like this:

, lighting : { console: { level: 'notice' } }

change it to

, lighting : { console: { level: 'info' } }

and you'll see more information. in particular, when the module loads you'll see something like:

info: [lighting] loading lifx driver

i will make "info" the default setting after 1.3 is released.