This PR adds the ability for addins to be located outside of the NPM package. That makes the addins more versatile and custom behaviour is easier to realise.
These are the main changes of this PR:
1) Load addins from the knx_addins folder in the homebridge config folder
When an accessory loads a Handler the customServiceApi first looks into the local addins folder. If an appropriate Handler-file is found there, that is being loaded. If not, it looks in the knx_addins folder in the homebridge config folder.
2) Provide a localised require named knxRequire
In order for external modules to be treated as internally, for loading modules etc., we had to wrap a require function and register that globally.
The only notable change for external addins from the current paradigma would be the name of the require function for handlerpattern and debug.
var HandlerPattern = knxRequire( './lib/addins/handlerpattern.js' );
var log = knxRequire('debug')('GiraThermostatServo3Handler');
This PR adds the ability for addins to be located outside of the NPM package. That makes the addins more versatile and custom behaviour is easier to realise.
These are the main changes of this PR:
1) Load addins from the
knx_addins
folder in the homebridge config folderWhen an accessory loads a Handler the
customServiceApi
first looks into the local addins folder. If an appropriate Handler-file is found there, that is being loaded. If not, it looks in theknx_addins
folder in the homebridge config folder.2) Provide a localised require named
knxRequire
In order for external modules to be treated as internally, for loading modules etc., we had to wrap a require function and register that globally.
The only notable change for external addins from the current paradigma would be the name of the require function for handlerpattern and debug.
fixes #160