octoblu / legacy-gateway

Octoblu Gateway for your LAN-based IoT devices
http://skynet.im
MIT License
30 stars 11 forks source link

Install Plugin using gatewayConfig should return plugin object in result payload #6

Open kmariano opened 10 years ago

kmariano commented 10 years ago

When installing a new plugin we use a socket to emit a message to the gateway telling it to install a new plugin the result, does not return the actual plugin object with optionsSchema and messageSchema. If possible the result should contain the plugin object so that Octoblu does not have to make an additional request to skynet to get the updated Hub.

The hub socket API for 'installPlugin' of 'gatewayConfig' should return the plugin object so that Octoblu can update the information on the front-end.

monteslu commented 10 years ago

This one is tough. It seems that changes to npm via install, update, or remove require a restart of the hub. Because of that I don't think we can reply with data without maybe some persisting of data to reply with the correct message id at restart.

kmariano commented 10 years ago

Another thing I noticed was that when you install a new plugin, the hub needs to be restarted before the new plugin is returned in the list of installed plugins.