node-red-contrib-homekit-bridged 1.5.0-dev.11 → 1.5.0-dev.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/lib/api.js CHANGED
@@ -31,7 +31,7 @@ const version = require('../../package.json').version.trim();
31
31
  module.exports = function (RED) {
32
32
  const log = (0, logger_1.logger)('NRCHKB', 'API');
33
33
  const _initServiceAPI = () => {
34
- log.debug('Initialize ServiceAPI');
34
+ log.debug('Initialize Service API');
35
35
  const serviceData = {
36
36
  BatteryService: {
37
37
  nrchkbDisabledText: 'BatteryService (deprecated, replaced by Battery)',
@@ -42,6 +42,9 @@ module.exports = function (RED) {
42
42
  BridgingState: {
43
43
  nrchkbDisabledText: 'BridgingState (deprecated, unused)',
44
44
  },
45
+ CameraEventRecordingManagement: {
46
+ nrchkbDisabledText: 'CameraEventRecordingManagement (deprecated, replaced by CameraRecordingManagement)',
47
+ },
45
48
  Relay: {
46
49
  nrchkbDisabledText: 'Relay (deprecated, replaced by CloudRelay)',
47
50
  },
@@ -69,9 +72,7 @@ module.exports = function (RED) {
69
72
  res.json(serviceData);
70
73
  });
71
74
  };
72
- const _initNRCHKBInfoAPI = () => {
73
- log.debug('Initialize NRCHKB Info API');
74
- log.debug(`Running version: ${version}`);
75
+ const stringifyVersion = (version) => {
75
76
  const releaseVersionRegex = /(\d+)\.(\d+)\.(\d+)/;
76
77
  const devVersionRegex = /(\d+)\.(\d+)\.(\d+)-dev\.(\d+)/;
77
78
  const releaseVersionFound = releaseVersionRegex.test(version);
@@ -109,6 +110,12 @@ module.exports = function (RED) {
109
110
  log.debug('Bad version format');
110
111
  xyzVersion = '0.0.0';
111
112
  }
113
+ return xyzVersion;
114
+ };
115
+ const _initNRCHKBInfoAPI = () => {
116
+ log.debug('Initialize NRCHKB Info API');
117
+ log.debug(`Running version: ${version}`);
118
+ const xyzVersion = stringifyVersion(version);
112
119
  log.debug(`Evaluated as: ${xyzVersion}`);
113
120
  const experimental = process.env.NRCHKB_EXPERIMENTAL === 'true';
114
121
  log.debug(`Running experimental: ${experimental}`);
@@ -221,7 +228,8 @@ module.exports = function (RED) {
221
228
  isRedInitialized();
222
229
  }).then(() => {
223
230
  RED.nodes.eachNode((node) => {
224
- if (node.type === 'homekit-service') {
231
+ if (node.type === 'homekit-service' ||
232
+ node.type === 'homekit-service2') {
225
233
  const serviceNodeConfig = node;
226
234
  const serviceNode = RED.nodes.getNode(serviceNodeConfig.id);
227
235
  if (serviceNode &&
@@ -265,7 +273,7 @@ module.exports = function (RED) {
265
273
  }));
266
274
  });
267
275
  const _initAccessoryAPI = function () {
268
- log.debug('Initialize AccessoryAPI');
276
+ log.debug('Initialize Accessory API');
269
277
  const accessoryCategoriesData = {};
270
278
  Object.keys(HapCategories_1.default)
271
279
  .sort()
@@ -288,5 +296,6 @@ module.exports = function (RED) {
288
296
  };
289
297
  return {
290
298
  init,
299
+ stringifyVersion,
291
300
  };
292
301
  };
@@ -20,6 +20,7 @@
20
20
  <select id="node-config-input-advertiser">
21
21
  <option value="bonjour-hap" selected="selected">BONJOUR</option>
22
22
  <option value="ciao">CIAO</option>
23
+ <option value="avahi">AVAHI</option>
23
24
  </select>
24
25
  </div>
25
26
  <div class="form-row">
@@ -105,7 +106,7 @@
105
106
  <li><strong>Accessory Category</strong>: What kind of category is this Accessory, default <em>OTHER</em></li>
106
107
  <li><strong>Pin Code</strong>: Specify the Pin for the pairing process.</li>
107
108
  <li><strong>Port</strong>: If you are behind a Firewall, you may want to specify a port. Cannot be 1880 as it is reserved for node-red. Otherwise, leave empty.</li>
108
- <li><strong>Advertiser</strong>: Which MDNS advertiser to use <em>ciao</em> (new, improved but not yet proved) or (good old) <em>bonjour</em>. Default <em>bonjour</em>.</li>
109
+ <li><strong>Advertiser</strong>: Which MDNS advertiser to use <em>ciao</em> (new, improved but not yet proved) or (good old) <em>bonjour</em> or experimental <em>avahi</em>. Default <em>bonjour</em>.</li>
109
110
  <li><strong>Allow Insecure Request</strong>: Should we allow insecure request? Default false.</li>
110
111
  <li><strong>Manufacturer, Model, Serial Number</strong>: Can be anything you want.</li>
111
112
  <li><strong>Firmware Revision</strong>: Should be a version number string in the form of <em>MAJOR.MINOR.REVISION</em> e.g. <em>1.2.0</em>. Other types of strings are ignored and won't be displayed.</li>
@@ -157,7 +158,7 @@
157
158
  value: 'bonjour-hap',
158
159
  required: false,
159
160
  validate: function (value) {
160
- if (value) return value === 'bonjour-hap' || value === 'ciao'
161
+ if (value) return value === 'bonjour-hap' || value === 'ciao' || value === 'avahi'
161
162
  else return true
162
163
  },
163
164
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-homekit-bridged",
3
- "version": "1.5.0-dev.11",
3
+ "version": "1.5.0-dev.13",
4
4
  "description": "Node-RED nodes to simulate Apple HomeKit devices.",
5
5
  "main": "build/nodes/nrchkb.js",
6
6
  "scripts": {