From 9b42fafdaf9c9d2d3c344215bdfe06849b8c10e0 Mon Sep 17 00:00:00 2001 From: Nick Farina Date: Mon, 7 Mar 2016 11:49:13 -0800 Subject: [PATCH 1/3] Add README example for plugin development --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index c1d3462..9f8fa7b 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,16 @@ And you can find an example plugin that publishes an individual accessory at [he See more examples on how to create Platform classes in the [Legacy Plugins](https://github.com/nfarina/homebridge-legacy-plugins/tree/master/platforms) repository. +# Plugin Development + +When writing your plugin, you'll want Homebridge to load it from your development directory instead of publishing it to `npm` each time. You can tell Homebridge to look for your plugin at a specific location using the command-line parameter `-P`. For example, if you are in the Homebridge directory (as checked out from Github), you might type: + +```sh +DEBUG=* ./bin/homebridge -D -P ../my-great-plugin/ +``` + +This will start up Homebridge and load your in-development plugin from a nearby directory. + # Common Issues ### My iOS App Can't Find Homebridge From 87c48d7267b5cceef1256648410f56290d89f46c Mon Sep 17 00:00:00 2001 From: Nick Farina Date: Mon, 7 Mar 2016 14:42:28 -0800 Subject: [PATCH 2/3] Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f8fa7b..87584f2 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,11 @@ When writing your plugin, you'll want Homebridge to load it from your developmen DEBUG=* ./bin/homebridge -D -P ../my-great-plugin/ ``` -This will start up Homebridge and load your in-development plugin from a nearby directory. +This will start up Homebridge and load your in-development plugin from a nearby directory. Note that you can also direct Homebridge to load your configuration from somewhere besides the default `~/.homebridge`, for example: + +```sh +DEBUG=* ./bin/homebridge -D -U ~/.homebridge-dev -P ../my-great-plugin/ +``` # Common Issues From 13333999f37e217e1cabd76745c6ffca624bebd1 Mon Sep 17 00:00:00 2001 From: Nick Farina Date: Mon, 7 Mar 2016 14:43:16 -0800 Subject: [PATCH 3/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 87584f2..cc96ba9 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,8 @@ This will start up Homebridge and load your in-development plugin from a nearby DEBUG=* ./bin/homebridge -D -U ~/.homebridge-dev -P ../my-great-plugin/ ``` +This is very useful when you are already using your development machine to host a "real" Homebridge instance (with all your accessories) that you don't want to disturb. + # Common Issues ### My iOS App Can't Find Homebridge