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

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.
Files changed (2) hide show
  1. package/build/lib/api.js +15 -6
  2. package/package.json +1 -1
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
  };
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.12",
4
4
  "description": "Node-RED nodes to simulate Apple HomeKit devices.",
5
5
  "main": "build/nodes/nrchkb.js",
6
6
  "scripts": {