Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Addins #161

Merged
merged 9 commits into from
May 1, 2020
Merged

Remote Addins #161

merged 9 commits into from
May 1, 2020

Conversation

Luehrsen
Copy link
Contributor

@Luehrsen Luehrsen commented Apr 18, 2020

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');

fixes #160

@snowdd1 snowdd1 merged commit c2ecf67 into snowdd1:master May 1, 2020
@Luehrsen Luehrsen deleted the add/remote-addins branch May 13, 2020 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External Source for Add-Ins
2 participants