node-red-contrib-homekit-bridged 1.5.0-dev.0 → 1.5.0-dev.10

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.
@@ -1,15 +1,24 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
5
14
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("./types/HostType"));
7
- const preload_1 = __importDefault(require("semver/preload"));
15
+ const logger_1 = require("@nrchkb/logger");
8
16
  const hap_nodejs_1 = require("hap-nodejs");
9
- const HapCategories_1 = __importDefault(require("./types/HapCategories"));
10
17
  const semver_1 = require("semver");
11
- const logger_1 = require("@nrchkb/logger");
18
+ const preload_1 = __importDefault(require("semver/preload"));
12
19
  const NRCHKBError_1 = __importDefault(require("./NRCHKBError"));
20
+ const HapCategories_1 = __importDefault(require("./types/HapCategories"));
21
+ const HostType_1 = __importDefault(require("./types/HostType"));
13
22
  module.exports = (RED, hostType) => {
14
23
  const MdnsUtils = require('./utils/MdnsUtils')();
15
24
  const init = function (config) {
@@ -99,14 +108,18 @@ module.exports = (RED, hostType) => {
99
108
  return true;
100
109
  };
101
110
  self.on('close', function (removed, done) {
102
- if (removed) {
103
- self.host.destroy();
104
- }
105
- else {
106
- self.host.unpublish();
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ if (removed) {
113
+ log.debug('This node has been deleted');
114
+ yield self.host.destroy();
115
+ }
116
+ else {
117
+ log.debug('This node is being restarted');
118
+ yield self.host.unpublish();
119
+ }
107
120
  self.published = false;
108
- }
109
- done();
121
+ done();
122
+ });
110
123
  });
111
124
  self.host.on('identify', function (paired, callback) {
112
125
  if (paired) {
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("./types/HostType"));
7
- const hap_nodejs_1 = require("hap-nodejs");
8
6
  const logger_1 = require("@nrchkb/logger");
9
- const FlowType_1 = require("./types/FlowType");
7
+ const hap_nodejs_1 = require("hap-nodejs");
10
8
  const NRCHKBError_1 = __importDefault(require("./NRCHKBError"));
9
+ const FlowType_1 = require("./types/FlowType");
10
+ const HostType_1 = __importDefault(require("./types/HostType"));
11
11
  module.exports = (RED) => {
12
12
  const nrchkbConfigCompatibilityOverride = function () {
13
13
  const self = this;
@@ -74,6 +74,7 @@ module.exports = (RED) => {
74
74
  log.debug('Starting Parent Service');
75
75
  configure.call(self);
76
76
  self.configured = true;
77
+ self.reachable = true;
77
78
  }
78
79
  else {
79
80
  const serviceType = config.serviceName === 'CameraControl' ? 'Camera' : 'Linked';
@@ -115,14 +116,15 @@ module.exports = (RED) => {
115
116
  log.error('Parent Node not assigned', false);
116
117
  throw new NRCHKBError_1.default('Parent Node not assigned');
117
118
  }
118
- self.parentService = parentNode.service;
119
+ self.parentNode = parentNode;
120
+ self.parentService = self.parentNode.service;
119
121
  if (!self.parentService) {
120
122
  log.error('Parent Service not assigned', false);
121
123
  throw new NRCHKBError_1.default('Parent Service not assigned');
122
124
  }
123
- self.hostNode = parentNode.hostNode;
124
- parentNode.childNodes.push(self);
125
- self.accessory = parentNode.accessory;
125
+ self.hostNode = self.parentNode.hostNode;
126
+ self.parentNode.childNodes.push(self);
127
+ self.accessory = self.parentNode.accessory;
126
128
  }
127
129
  self.name = self.config.name;
128
130
  if (self.hasOwnProperty('_flow') &&
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("./types/HostType"));
7
- const hap_nodejs_1 = require("hap-nodejs");
8
6
  const logger_1 = require("@nrchkb/logger");
9
- const FlowType_1 = require("./types/FlowType");
7
+ const hap_nodejs_1 = require("hap-nodejs");
10
8
  const NRCHKBError_1 = __importDefault(require("./NRCHKBError"));
9
+ const FlowType_1 = require("./types/FlowType");
10
+ const HostType_1 = __importDefault(require("./types/HostType"));
11
11
  module.exports = (RED) => {
12
12
  const nrchkbConfigCompatibilityOverride = function () {
13
13
  const self = this;
@@ -74,6 +74,7 @@ module.exports = (RED) => {
74
74
  log.debug('Starting Parent Service');
75
75
  configure.call(self);
76
76
  self.configured = true;
77
+ self.reachable = true;
77
78
  }
78
79
  else {
79
80
  const serviceType = config.serviceName === 'CameraControl' ? 'Camera' : 'Linked';
@@ -115,14 +116,15 @@ module.exports = (RED) => {
115
116
  log.error('Parent Node not assigned', false);
116
117
  throw new NRCHKBError_1.default('Parent Node not assigned');
117
118
  }
118
- self.parentService = parentNode.service;
119
+ self.parentNode = parentNode;
120
+ self.parentService = self.parentNode.service;
119
121
  if (!self.parentService) {
120
122
  log.error('Parent Service not assigned', false);
121
123
  throw new NRCHKBError_1.default('Parent Service not assigned');
122
124
  }
123
- self.hostNode = parentNode.hostNode;
124
- parentNode.childNodes.push(self);
125
- self.accessory = parentNode.accessory;
125
+ self.hostNode = self.parentNode.hostNode;
126
+ self.parentNode.childNodes.push(self);
127
+ self.accessory = self.parentNode.accessory;
126
128
  }
127
129
  self.name = self.config.name;
128
130
  if (self.hasOwnProperty('_flow') &&
@@ -1,7 +1,7 @@
1
- import storage, { InitOptions } from 'node-persist';
2
- import { StorageType } from './types/storage/StorageType';
3
1
  import { CharacteristicEventTypes, SerializedAccessory, SerializedService } from 'hap-nodejs';
2
+ import storage, { InitOptions } from 'node-persist';
4
3
  import { SerializedHostType } from './types/storage/SerializedHostType';
4
+ import { StorageType } from './types/storage/StorageType';
5
5
  declare type EventCallback = {
6
6
  event: CharacteristicEventTypes;
7
7
  callback: (value?: any) => void;
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Storage = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const node_persist_1 = __importDefault(require("node-persist"));
9
- const StorageType_1 = require("./types/storage/StorageType");
10
7
  const logger_1 = require("@nrchkb/logger");
8
+ const node_persist_1 = __importDefault(require("node-persist"));
9
+ const path_1 = __importDefault(require("path"));
11
10
  const uuid_1 = require("uuid");
12
11
  const NRCHKBError_1 = __importDefault(require("./NRCHKBError"));
12
+ const StorageType_1 = require("./types/storage/StorageType");
13
13
  class Storage {
14
14
  static storagePath() {
15
15
  if (!Storage.storageInitialized) {
package/build/lib/api.js CHANGED
@@ -23,10 +23,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- const HapCategories_1 = __importDefault(require("./types/HapCategories"));
27
- const hap_nodejs_1 = require("hap-nodejs");
28
26
  const logger_1 = require("@nrchkb/logger");
27
+ const hap_nodejs_1 = require("hap-nodejs");
29
28
  const Storage_1 = require("./Storage");
29
+ const HapCategories_1 = __importDefault(require("./types/HapCategories"));
30
30
  const version = require('../../package.json').version.trim();
31
31
  module.exports = function (RED) {
32
32
  const log = (0, logger_1.logger)('NRCHKB', 'API');
@@ -123,7 +123,7 @@ module.exports = function (RED) {
123
123
  const getCustomCharacteristics = () => {
124
124
  return Storage_1.Storage.loadCustomCharacteristics()
125
125
  .then((value) => {
126
- log.trace(`loadCustomCharacteristics()`);
126
+ log.trace('loadCustomCharacteristics()');
127
127
  log.trace(value);
128
128
  if (Array.isArray(value)) {
129
129
  return value;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -321,8 +325,7 @@ Camera.prototype.handleStreamRequest = function (request) {
321
325
  ' -r ' +
322
326
  fps +
323
327
  ' -f rawvideo' +
324
- ' ' +
325
- additionalCommandline +
328
+ (additionalCommandline ? ' ' + additionalCommandline : '') +
326
329
  (vf.length > 0 ? ' -vf ' + vf.join(',') : '') +
327
330
  ' -b:v ' +
328
331
  vbitrate +
@@ -1,7 +1,7 @@
1
+ import { MDNSAdvertiser } from 'hap-nodejs';
1
2
  import { NodeDef } from 'node-red';
2
3
  import { SemVer } from 'semver';
3
4
  import HapCategories from './HapCategories';
4
- import { MDNSAdvertiser } from 'hap-nodejs';
5
5
  declare type HAPHostConfigType = NodeDef & {
6
6
  bridgeName: string;
7
7
  pinCode: string;
@@ -1,8 +1,8 @@
1
- import NodeType from './NodeType';
2
- import HAPHostConfigType from './HAPHostConfigType';
1
+ import { MulticastOptions } from 'bonjour-hap';
3
2
  import { Accessory, Categories } from 'hap-nodejs';
3
+ import HAPHostConfigType from './HAPHostConfigType';
4
4
  import HostType from './HostType';
5
- import { MulticastOptions } from 'bonjour-hap';
5
+ import NodeType from './NodeType';
6
6
  declare type HAPHostNodeType = NodeType & {
7
7
  config: HAPHostConfigType;
8
8
  mdnsConfig: MulticastOptions;
@@ -1,12 +1,12 @@
1
- import NodeType from './NodeType';
2
- import { NodeAPI } from 'node-red';
3
- import HAPService2ConfigType from './HAPService2ConfigType';
4
1
  import { Accessory, Characteristic, CharacteristicChange, CharacteristicGetCallback, CharacteristicProps, CharacteristicSetCallback, CharacteristicValue, Service } from 'hap-nodejs';
2
+ import { HAPConnection } from 'hap-nodejs/dist/lib/util/eventedhttp';
3
+ import { NodeAPI } from 'node-red';
5
4
  import HAPHostNodeType from './HAPHostNodeType';
5
+ import HAPService2ConfigType from './HAPService2ConfigType';
6
+ import HAPServiceNodeType from './HAPServiceNodeType';
7
+ import NodeType from './NodeType';
6
8
  import PublishTimersType from './PublishTimersType';
7
9
  import StatusUtilType from './StatusUtilType';
8
- import HAPServiceNodeType from './HAPServiceNodeType';
9
- import { HAPConnection } from 'hap-nodejs/dist/lib/util/eventedhttp';
10
10
  declare type HAPService2NodeType = NodeType & {
11
11
  config: HAPService2ConfigType;
12
12
  RED: NodeAPI;
@@ -18,6 +18,7 @@ declare type HAPService2NodeType = NodeType & {
18
18
  childNodes: (HAPService2NodeType | HAPServiceNodeType)[];
19
19
  service: Service;
20
20
  parentService: Service;
21
+ parentNode?: HAPService2NodeType | HAPServiceNodeType;
21
22
  accessory: Accessory;
22
23
  characteristicProperties: {
23
24
  [key: string]: CharacteristicProps;
@@ -29,5 +30,6 @@ declare type HAPService2NodeType = NodeType & {
29
30
  onCharacteristicSet: (this: Characteristic, newValue: CharacteristicValue, callback: CharacteristicSetCallback, context: any, connection?: HAPConnection) => void;
30
31
  onCharacteristicChange: (this: Characteristic, change: CharacteristicChange) => void;
31
32
  uniqueIdentifier: string;
33
+ reachable?: boolean;
32
34
  } & StatusUtilType;
33
35
  export default HAPService2NodeType;
@@ -1,12 +1,12 @@
1
- import NodeType from './NodeType';
2
- import { NodeAPI } from 'node-red';
3
1
  import { Accessory, Characteristic, CharacteristicChange, CharacteristicGetCallback, CharacteristicProps, CharacteristicSetCallback, CharacteristicValue, Service } from 'hap-nodejs';
2
+ import { HAPConnection } from 'hap-nodejs/dist/lib/util/eventedhttp';
3
+ import { NodeAPI } from 'node-red';
4
4
  import HAPHostNodeType from './HAPHostNodeType';
5
+ import HAPService2NodeType from './HAPService2NodeType';
6
+ import HAPServiceConfigType from './HAPServiceConfigType';
7
+ import NodeType from './NodeType';
5
8
  import PublishTimersType from './PublishTimersType';
6
9
  import StatusUtilType from './StatusUtilType';
7
- import HAPServiceConfigType from './HAPServiceConfigType';
8
- import HAPService2NodeType from './HAPService2NodeType';
9
- import { HAPConnection } from 'hap-nodejs/dist/lib/util/eventedhttp';
10
10
  declare type HAPServiceNodeType = NodeType & {
11
11
  config: HAPServiceConfigType;
12
12
  RED: NodeAPI;
@@ -18,6 +18,7 @@ declare type HAPServiceNodeType = NodeType & {
18
18
  childNodes: (HAPService2NodeType | HAPServiceNodeType)[];
19
19
  service: Service;
20
20
  parentService: Service;
21
+ parentNode?: HAPService2NodeType | HAPServiceNodeType;
21
22
  accessory: Accessory;
22
23
  characteristicProperties: {
23
24
  [key: string]: CharacteristicProps;
@@ -29,5 +30,6 @@ declare type HAPServiceNodeType = NodeType & {
29
30
  onCharacteristicSet: (this: Characteristic, newValue: CharacteristicValue, callback: CharacteristicSetCallback, context: any, connection?: HAPConnection) => void;
30
31
  onCharacteristicChange: (this: Characteristic, change: CharacteristicChange) => void;
31
32
  uniqueIdentifier: string;
33
+ reachable?: boolean;
32
34
  } & StatusUtilType;
33
35
  export default HAPServiceNodeType;
@@ -1,8 +1,8 @@
1
- import NodeType from './NodeType';
2
1
  import { NodeAPI } from 'node-red';
3
- import StatusUtilType from './StatusUtilType';
4
2
  import HAPServiceNodeType from './HAPServiceNodeType';
5
3
  import HAPStatusConfigType from './HAPStatusConfigType';
4
+ import NodeType from './NodeType';
5
+ import StatusUtilType from './StatusUtilType';
6
6
  declare type HAPStatusNodeType = NodeType & {
7
7
  config: HAPStatusConfigType;
8
8
  RED: NodeAPI;
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("../types/HostType"));
7
6
  const logger_1 = require("@nrchkb/logger");
7
+ const HostType_1 = __importDefault(require("../types/HostType"));
8
8
  module.exports = function () {
9
9
  const delayedPublish = function (node) {
10
10
  const log = (0, logger_1.logger)('NRCHKB', 'BridgeUtils', node.config.name, node);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const hap_nodejs_1 = require("hap-nodejs");
4
3
  const logger_1 = require("@nrchkb/logger");
4
+ const hap_nodejs_1 = require("hap-nodejs");
5
5
  module.exports = function (node) {
6
6
  const log = (0, logger_1.logger)('NRCHKB', 'CharacteristicUtils', node.config.name, node);
7
7
  const ServiceUtils = require('./ServiceUtils')(node);
@@ -42,7 +42,7 @@ module.exports = function (node) {
42
42
  characteristic.props.minValue = -100;
43
43
  }
44
44
  });
45
- return supported;
45
+ return [...new Set(supported)];
46
46
  };
47
47
  return {
48
48
  load: load,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const hap_nodejs_1 = require("hap-nodejs");
4
3
  const logger_1 = require("@nrchkb/logger");
4
+ const hap_nodejs_1 = require("hap-nodejs");
5
5
  module.exports = function (node) {
6
6
  const log = (0, logger_1.logger)('NRCHKB', 'CharacteristicUtils', node.config.name, node);
7
7
  const ServiceUtils = require('./ServiceUtils2')(node);
@@ -42,7 +42,7 @@ module.exports = function (node) {
42
42
  characteristic.props.minValue = -100;
43
43
  }
44
44
  });
45
- return supported;
45
+ return [...new Set(supported)];
46
46
  };
47
47
  return {
48
48
  load: load,
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("../types/HostType"));
7
6
  const logger_1 = require("@nrchkb/logger");
7
+ const hap_nodejs_1 = require("hap-nodejs");
8
8
  const NRCHKBError_1 = __importDefault(require("../NRCHKBError"));
9
9
  module.exports = function (node) {
10
10
  const log = (0, logger_1.logger)('NRCHKB', 'ServiceUtils', node.config.name, node);
@@ -31,12 +31,13 @@ module.exports = function (node) {
31
31
  return hap;
32
32
  };
33
33
  const onCharacteristicGet = function (callback, context, connection) {
34
- log.debug(`onCharacteristicGet with status: ${this.statusCode}, value: ${this.value}, reachability is ${node.accessory.reachable} with context ${JSON.stringify(context)} on connection ${connection === null || connection === void 0 ? void 0 : connection.sessionID}`);
34
+ var _a, _b;
35
+ log.debug(`onCharacteristicGet with status: ${this.statusCode}, value: ${this.value}, reachability is ${((_a = node.parentNode) !== null && _a !== void 0 ? _a : node).reachable} with context ${JSON.stringify(context)} on connection ${connection === null || connection === void 0 ? void 0 : connection.sessionID}`);
35
36
  if (callback) {
36
37
  try {
37
- callback(node.accessory.reachable
38
- ? this.statusCode
39
- : new Error(NO_RESPONSE_MSG), this.value);
38
+ callback(((_b = node.parentNode) !== null && _b !== void 0 ? _b : node).reachable
39
+ ? null
40
+ : new hap_nodejs_1.HapStatusError(-70402), this.value);
40
41
  }
41
42
  catch (_) { }
42
43
  }
@@ -48,21 +49,30 @@ module.exports = function (node) {
48
49
  msg.payload[key] = newValue;
49
50
  msg.hap = prepareHapData(context, connection);
50
51
  msg.hap.allChars = allCharacteristics.reduce((allChars, singleChar) => {
51
- allChars[singleChar.displayName] = singleChar.value;
52
+ const cKey = singleChar.constructor.name;
53
+ allChars[cKey] = singleChar.value;
52
54
  return allChars;
53
55
  }, {});
54
56
  if (oldValue !== undefined) {
55
57
  msg.hap.oldValue = oldValue;
56
58
  }
57
- msg.hap.newValue = newValue;
58
- const statusId = node.setStatus({
59
- fill: 'yellow',
60
- shape: 'dot',
61
- text: key + ': ' + newValue,
62
- });
63
- setTimeout(function () {
64
- node.clearStatus(statusId);
65
- }, 3000);
59
+ if (!node.reachable) {
60
+ msg.hap.reachable = false;
61
+ node.setStatus({
62
+ fill: 'yellow',
63
+ shape: 'dot',
64
+ text: 'Not reachable',
65
+ }, 3000);
66
+ }
67
+ else {
68
+ msg.hap.reachable = true;
69
+ msg.hap.newValue = newValue;
70
+ node.setStatus({
71
+ fill: 'yellow',
72
+ shape: 'dot',
73
+ text: key + ': ' + newValue,
74
+ }, 3000);
75
+ }
66
76
  log.debug(`${node.name} received ${key} : ${newValue}`);
67
77
  if (connection ||
68
78
  context ||
@@ -76,13 +86,14 @@ module.exports = function (node) {
76
86
  }
77
87
  };
78
88
  const onCharacteristicSet = (allCharacteristics) => function (newValue, callback, context, connection) {
79
- log.debug(`onCharacteristicSet with status: ${this.statusCode}, value: ${this.value}, reachability is ${node.accessory.reachable}
89
+ var _a, _b;
90
+ log.debug(`onCharacteristicSet with status: ${this.statusCode}, value: ${this.value}, reachability is ${((_a = node.parentNode) !== null && _a !== void 0 ? _a : node).reachable}
80
91
  with context ${JSON.stringify(context)} on connection ${connection === null || connection === void 0 ? void 0 : connection.sessionID}`);
81
92
  try {
82
93
  if (callback) {
83
- callback(node.accessory.reachable
94
+ callback(((_b = node.parentNode) !== null && _b !== void 0 ? _b : node).reachable
84
95
  ? null
85
- : new Error(NO_RESPONSE_MSG));
96
+ : new hap_nodejs_1.HapStatusError(-70402));
86
97
  }
87
98
  }
88
99
  catch (_) { }
@@ -92,8 +103,9 @@ module.exports = function (node) {
92
103
  }, connection);
93
104
  };
94
105
  const onCharacteristicChange = (allCharacteristics) => function (change) {
106
+ var _a;
95
107
  const { oldValue, newValue, context, originator, reason } = change;
96
- log.debug(`onCharacteristicChange with reason: ${reason}, oldValue: ${oldValue}, newValue: ${newValue}, reachability is ${node.accessory.reachable}
108
+ log.debug(`onCharacteristicChange with reason: ${reason}, oldValue: ${oldValue}, newValue: ${newValue}, reachability is ${((_a = node.parentNode) !== null && _a !== void 0 ? _a : node).reachable}
97
109
  with context ${JSON.stringify(context)} on connection ${originator === null || originator === void 0 ? void 0 : originator.sessionID}`);
98
110
  if (oldValue != newValue) {
99
111
  onValueChange.call(this, allCharacteristics, 0, {
@@ -127,22 +139,20 @@ module.exports = function (node) {
127
139
  }
128
140
  node.topic_in = msg.topic ? msg.topic : '';
129
141
  Object.keys(msg.payload).map((key) => {
142
+ var _a, _b;
130
143
  if (node.supported.indexOf(key) < 0) {
131
- log.error(`Instead of ${key} try one of these characteristics: ${node.supported.join(', ')}`);
144
+ log.error(`Instead of '${key}' try one of these characteristics: '${node.supported.join("', '")}'`);
132
145
  }
133
146
  else {
134
- if ((node.config.isParent &&
135
- node.config.hostType == HostType_1.default.BRIDGE) ||
136
- (!node.config.isParent &&
137
- node.hostNode.hostType == HostType_1.default.BRIDGE)) {
138
- node.accessory.updateReachability(msg.payload[key] !== NO_RESPONSE_MSG);
139
- }
147
+ const value = (_a = msg.payload) === null || _a === void 0 ? void 0 : _a[key];
148
+ const parentNode = (_b = node.parentNode) !== null && _b !== void 0 ? _b : node;
149
+ parentNode.reachable = value !== NO_RESPONSE_MSG;
140
150
  const characteristic = node.service.getCharacteristic(Characteristic[key]);
141
151
  if (context !== null) {
142
- characteristic.setValue(msg.payload[key], undefined, context);
152
+ characteristic.setValue(value, context);
143
153
  }
144
154
  else {
145
- characteristic.setValue(msg.payload[key]);
155
+ characteristic.setValue(value);
146
156
  }
147
157
  }
148
158
  });
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("../types/HostType"));
7
6
  const logger_1 = require("@nrchkb/logger");
8
- const Storage_1 = require("../Storage");
7
+ const hap_nodejs_1 = require("hap-nodejs");
9
8
  const NRCHKBError_1 = __importDefault(require("../NRCHKBError"));
9
+ const Storage_1 = require("../Storage");
10
10
  module.exports = function (node) {
11
11
  const log = (0, logger_1.logger)('NRCHKB', 'ServiceUtils2', node.config.name, node);
12
12
  const HapNodeJS = require('hap-nodejs');
@@ -23,17 +23,32 @@ module.exports = function (node) {
23
23
  };
24
24
  msg.payload = {};
25
25
  msg.hap = {
26
- newValue,
27
26
  event: eventObject,
28
27
  allChars: allCharacteristics.reduce((allChars, singleChar) => {
29
- allChars[singleChar.displayName] = singleChar.value;
28
+ const cKey = singleChar.constructor.name;
29
+ allChars[cKey] = singleChar.value;
30
30
  return allChars;
31
31
  }, {}),
32
+ oldValue,
32
33
  };
33
- if (oldValue !== undefined) {
34
- msg.hap.oldValue = oldValue;
35
- }
36
34
  const key = this.constructor.name;
35
+ if (!node.reachable) {
36
+ msg.hap.reachable = false;
37
+ node.setStatus({
38
+ fill: 'yellow',
39
+ shape: 'dot',
40
+ text: 'Not reachable',
41
+ }, 3000);
42
+ }
43
+ else {
44
+ msg.hap.reachable = true;
45
+ msg.hap.newValue = newValue;
46
+ node.setStatus({
47
+ fill: 'yellow',
48
+ shape: 'dot',
49
+ text: `[${eventObject.name}] ${key}${newValue != undefined ? `: ${newValue}` : ''}`,
50
+ }, 3000);
51
+ }
37
52
  msg.payload[key] = newValue;
38
53
  if (connection) {
39
54
  msg.hap.session = {
@@ -44,11 +59,6 @@ module.exports = function (node) {
44
59
  httpPort: connection.remotePort,
45
60
  };
46
61
  }
47
- node.setStatus({
48
- fill: 'yellow',
49
- shape: 'dot',
50
- text: `[${eventObject.name}] ${key}${newValue != undefined ? `: ${newValue}` : ''}`,
51
- }, 3000);
52
62
  log.debug(`${node.name} received ${eventObject.name} ${key}: ${newValue}`);
53
63
  if (connection || node.hostNode.config.allowMessagePassthrough) {
54
64
  node.send(msg);
@@ -58,12 +68,13 @@ module.exports = function (node) {
58
68
  const characteristic = this;
59
69
  const oldValue = characteristic.value;
60
70
  const delayedCallback = (value) => {
71
+ var _a;
61
72
  const newValue = value !== null && value !== void 0 ? value : characteristic.value;
62
73
  if (callback) {
63
74
  try {
64
- callback(node.accessory.reachable
65
- ? characteristic.statusCode
66
- : new Error(NO_RESPONSE_MSG), newValue);
75
+ callback(((_a = node.parentNode) !== null && _a !== void 0 ? _a : node).reachable
76
+ ? null
77
+ : new hap_nodejs_1.HapStatusError(-70402), newValue);
67
78
  }
68
79
  catch (_) { }
69
80
  }
@@ -88,11 +99,12 @@ module.exports = function (node) {
88
99
  }
89
100
  };
90
101
  const onCharacteristicSet = (allCharacteristics) => function (newValue, callback, _context, connection) {
102
+ var _a;
91
103
  try {
92
104
  if (callback) {
93
- callback(node.accessory.reachable
105
+ callback(((_a = node.parentNode) !== null && _a !== void 0 ? _a : node).reachable
94
106
  ? null
95
- : new Error(NO_RESPONSE_MSG));
107
+ : new hap_nodejs_1.HapStatusError(-70402));
96
108
  }
97
109
  }
98
110
  catch (_) { }
@@ -135,7 +147,7 @@ module.exports = function (node) {
135
147
  }
136
148
  node.topic_in = (_a = msg.topic) !== null && _a !== void 0 ? _a : '';
137
149
  Object.keys(msg.payload).map((key) => {
138
- var _a, _b;
150
+ var _a, _b, _c;
139
151
  if (node.supported.indexOf(key) < 0) {
140
152
  if (node.config.useEventCallback &&
141
153
  Storage_1.Storage.uuid4Validate(key)) {
@@ -151,20 +163,16 @@ module.exports = function (node) {
151
163
  }
152
164
  }
153
165
  else {
154
- log.error(`Instead of ${key} try one of these characteristics: ${node.supported.join(', ')}`);
166
+ log.error(`Instead of '${key}' try one of these characteristics: '${node.supported.join("', '")}'`);
155
167
  }
156
168
  }
157
169
  else {
158
170
  const value = (_b = msg.payload) === null || _b === void 0 ? void 0 : _b[key];
159
- if ((node.config.isParent &&
160
- node.config.hostType == HostType_1.default.BRIDGE) ||
161
- (!node.config.isParent &&
162
- node.hostNode.hostType == HostType_1.default.BRIDGE)) {
163
- node.accessory.updateReachability(value !== NO_RESPONSE_MSG);
164
- }
171
+ const parentNode = (_c = node.parentNode) !== null && _c !== void 0 ? _c : node;
172
+ parentNode.reachable = value !== NO_RESPONSE_MSG;
165
173
  const characteristic = node.service.getCharacteristic(Characteristic[key]);
166
174
  if (context !== null) {
167
- characteristic.setValue(value, undefined, context);
175
+ characteristic.setValue(value, context);
168
176
  }
169
177
  else {
170
178
  characteristic.setValue(value);
@@ -12,6 +12,7 @@
12
12
  <select id="node-config-input-advertiser">
13
13
  <option value="bonjour-hap" selected="selected">BONJOUR</option>
14
14
  <option value="ciao">CIAO</option>
15
+ <option value="avahi">AVAHI</option>
15
16
  </select>
16
17
  </div>
17
18
  <div class="form-row">
@@ -98,7 +99,7 @@
98
99
  <ul>
99
100
  <li><strong>Pin Code</strong>: Specify the Pin for the pairing process.</li>
100
101
  <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>
101
- <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>
102
+ <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>
102
103
  <li><strong>Allow Insecure Request</strong>: Should we allow insecure request? Default false.</li>
103
104
  <li><strong>Manufacturer, Model, Serial Number</strong>: Can be anything you want.</li>
104
105
  <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>
@@ -148,7 +149,7 @@
148
149
  value: 'bonjour-hap',
149
150
  required: false,
150
151
  validate: function (value) {
151
- if (value) return value === 'bonjour-hap' || value === 'ciao'
152
+ if (value) return value === 'bonjour-hap' || value === 'ciao' || value === 'avahi'
152
153
  else return true
153
154
  },
154
155
  },
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("../lib/types/HostType"));
7
6
  const logger_1 = require("@nrchkb/logger");
7
+ const HostType_1 = __importDefault(require("../lib/types/HostType"));
8
8
  const log = (0, logger_1.logger)('NRCHKB', 'HAPHostNode');
9
9
  module.exports = (RED) => {
10
10
  const HAPHostNode = require('../lib/HAPHostNode')(RED, HostType_1.default.BRIDGE);
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -22,10 +26,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
27
  };
24
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
+ const logger_1 = require("@nrchkb/logger");
30
+ const hap_nodejs_1 = require("hap-nodejs");
25
31
  const path = __importStar(require("path"));
26
32
  const semver_1 = __importDefault(require("semver"));
27
- const hap_nodejs_1 = require("hap-nodejs");
28
- const logger_1 = require("@nrchkb/logger");
29
33
  const Storage_1 = require("../lib/Storage");
30
34
  (0, logger_1.loggerSetup)({ timestampEnabled: 'NRCHKB' });
31
35
  const log = (0, logger_1.logger)('NRCHKB');
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const HostType_1 = __importDefault(require("../lib/types/HostType"));
7
6
  const logger_1 = require("@nrchkb/logger");
7
+ const HostType_1 = __importDefault(require("../lib/types/HostType"));
8
8
  const log = (0, logger_1.logger)('NRCHKB', 'HAPHostNode');
9
9
  module.exports = (RED) => {
10
10
  const HAPHostNode = require('../lib/HAPHostNode')(RED, HostType_1.default.STANDALONE);
package/package.json CHANGED
@@ -1,16 +1,15 @@
1
1
  {
2
2
  "name": "node-red-contrib-homekit-bridged",
3
- "version": "1.5.0-dev.0",
3
+ "version": "1.5.0-dev.10",
4
4
  "description": "Node-RED nodes to simulate Apple HomeKit devices.",
5
5
  "main": "build/nodes/nrchkb.js",
6
6
  "scripts": {
7
- "build": "yarn clean && tsc",
7
+ "build": "npm run clean && tsc",
8
8
  "clean": "rimraf build/lib build/**/*.js",
9
- "test": "yarn build && mocha -r ts-node/register './src/**/*.test.[tj]s' --exit",
9
+ "test": "npm run build && mocha -r ts-node/register './src/**/*.test.[tj]s' --exit",
10
10
  "prettier": "prettier --write \"**/*.{js,ts}\"",
11
- "_postinstall": "husky install",
12
- "prepublishOnly": "pinst --disable",
13
- "postpublish": "pinst --enable"
11
+ "eslint": "eslint \"**/*.ts\"",
12
+ "prepare": "husky install"
14
13
  },
15
14
  "repository": {
16
15
  "type": "git",
@@ -18,11 +17,11 @@
18
17
  },
19
18
  "keywords": [
20
19
  "homekit",
21
- "hap-nodejs",
22
20
  "node-red",
21
+ "NRCHKB",
23
22
  "iot",
24
23
  "home",
25
- "NRCHKB",
24
+ "hap-nodejs",
26
25
  "homebridge"
27
26
  ],
28
27
  "node-red": {
@@ -33,11 +32,12 @@
33
32
  "service": "build/nodes/service.js",
34
33
  "service2": "build/nodes/service2.js",
35
34
  "status": "build/nodes/status.js"
36
- }
35
+ },
36
+ "version": ">=1.3.7"
37
37
  },
38
38
  "author": {
39
39
  "name": "Tadeusz Wyrzykowski",
40
- "email": "tadeusz@hey.com",
40
+ "email": "shaquu@icloud.com",
41
41
  "url": "https://github.com/Shaquu"
42
42
  },
43
43
  "license": "Apache-2.0",
@@ -47,34 +47,36 @@
47
47
  "homepage": "https://github.com/NRCHKB/node-red-contrib-homekit-bridged#readme",
48
48
  "dependencies": {
49
49
  "@nrchkb/logger": "^1.3.3",
50
- "hap-nodejs": "^0.9.6",
50
+ "hap-nodejs": "0.10.4",
51
51
  "node-persist": "^3.1.0",
52
- "semver": "^7.3.5",
53
- "uuid": "^8.3.2"
52
+ "semver": "^7.3.7",
53
+ "uuid": "^9.0.0"
54
54
  },
55
55
  "devDependencies": {
56
- "@homebridge/ciao": "^1.1.3",
57
- "@node-red/registry": "^1.3.7",
58
- "@types/mocha": "^9.0.0",
59
- "@types/node": "^10.17.50",
60
- "@types/node-persist": "^3.1.2",
61
- "@types/node-red": "^1.1.1",
62
- "@types/semver": "^7.3.9",
63
- "@types/uuid": "^8.3.1",
64
- "@typescript-eslint/eslint-plugin": "^5.2.0",
65
- "@typescript-eslint/parser": "^5.2.0",
56
+ "@homebridge/ciao": "^1.1.5",
57
+ "@node-red/registry": "^2.2.3",
58
+ "@types/mocha": "^9.1.1",
59
+ "@types/node": "^10.17.60",
60
+ "@types/node-persist": "^3.1.3",
61
+ "@types/node-red": "^1.2.1",
62
+ "@types/node-red-node-test-helper": "^0.2.2",
63
+ "@types/semver": "^7.3.12",
64
+ "@types/uuid": "^8.3.4",
65
+ "@typescript-eslint/eslint-plugin": "^5.38.1",
66
+ "@typescript-eslint/parser": "^5.38.1",
66
67
  "babel-eslint": "^10.1.0",
67
- "eslint": "^8.1.0",
68
- "eslint-config-prettier": "^8.3.0",
69
- "eslint-plugin-prettier": "^4.0.0",
70
- "husky": "^7.0.4",
71
- "mocha": "^9.1.3",
72
- "node-red": "^1.3.7",
73
- "node-red-node-test-helper": "^0.2.7",
74
- "pinst": "^2.1.6",
75
- "prettier": "^2.4.1",
76
- "ts-node": "^10.4.0",
77
- "typescript": "^4.4.4"
68
+ "eslint": "^8.24.0",
69
+ "eslint-config-prettier": "^8.5.0",
70
+ "eslint-plugin-prettier": "^4.2.1",
71
+ "eslint-plugin-simple-import-sort": "^8.0.0",
72
+ "husky": "^8.0.1",
73
+ "mocha": "^10.0.0",
74
+ "node-red": "^2.2.3",
75
+ "node-red-node-test-helper": "^0.3.0",
76
+ "prettier": "^2.7.1",
77
+ "rimraf": "^3.0.2",
78
+ "ts-node": "^10.9.1",
79
+ "typescript": "^4.8.4"
78
80
  },
79
81
  "engines": {
80
82
  "node": ">=10.22.1"
package/CHANGELOG.md DELETED
@@ -1,339 +0,0 @@
1
- #### ⚠️ CAUTION ⚠️
2
-
3
- ##### Before upgrading make sure that you are using the latest version of [Node-RED](https://nodered.org/docs/getting-started/local) and latest LTS version of [Node.js](https://nodejs.org/en/download/)
4
-
5
- ###### Upgrading from versions 0.X to 1.X is a breaking change, all devices will be reset in the Home app. Please review the [release notes](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/releases/tag/v1.0.1) thoroughly before updating!
6
-
7
- # Changelog
8
-
9
- All notable changes to this project will be documented in this file.
10
-
11
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres
12
- to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
13
-
14
- ## [1.5.0-dev.0]
15
-
16
- ## [1.4.3]
17
-
18
- ### Added
19
-
20
- - Pass Characteristic key in event context for Service2
21
-
22
- ### Changed
23
-
24
- - Updated hap-nodejs to [0.9.6](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.9.6) (bug fixes and security fixes)
25
-
26
- ## [1.4.2]
27
-
28
- ### Fixed
29
-
30
- - Resolve issue with customCharacteristics not loading from file
31
- - Fixed publish process
32
-
33
- ## [1.4.1]
34
-
35
- ### Fixed
36
-
37
- - Fix readme appearance on `flows.nodered.org`
38
-
39
- ## [1.4.0]
40
-
41
- ### Fixed
42
-
43
- - Fixed customCharacteristics incorrect refresh in UI
44
- - Implemented static accessoryUUIDs for subflows Enables the use of nrchkb nodes in subflows with backwards
45
- compatibility #393 - thanks @kevinkub
46
- - Fixed Custom MDNS Configuration not showing in UI for Standalone Accessory
47
- - Stop components from clearing other component's node.status call
48
- - Add missing advertiser selector in UI for Standalone Accessory
49
- - Not naming the host node causes a crash #424
50
- - Do not output oldValue for onSet as it does not have access to old value
51
-
52
- ### Added
53
-
54
- - Notice during app launch: Node.js 10 will be deprecated in Node-RED 2.0.0
55
- - Event output in Service 2 which is available in NRCHKB_EXPERIMENTAL #392 #437
56
- - Status node to fetch Serialized Service #210
57
- - Support for environment variables in characteristic properties #217
58
-
59
- ### Changed
60
-
61
- - Updated hap-nodejs to [0.9.5](https://github.com/homebridge/HAP-NodeJS/releases/tag/v0.9.5) (added new iOS 15 Services and Characteristics)
62
- - Updated dependencies to latest versions
63
- - Changed `BatteryService` to `Battery` in demo examples as `BatteryService` is deprecated #381 - thanks @crxporter
64
- - Readme rework - thanks @crxporter
65
- - More descriptive error when incorrect Characteristic has been used in msg.payload
66
- - Add msg.hap.allChars to service nodes #438
67
-
68
- ## [1.3.6]
69
-
70
- ### Fixed
71
-
72
- - nrchkb complaining about validValues #52
73
-
74
- ## [1.3.5]
75
-
76
- ### Fixed
77
-
78
- - NO_RESPONSE not working
79
-
80
- ## [1.3.4]
81
-
82
- ### Fixed
83
-
84
- - onChange fired when value not changed #390 - thanks for reporting @Delphius7
85
-
86
- ## [1.3.3]
87
-
88
- ### Fixed
89
-
90
- - Resolve issues with incorrect Characteristics names used in node output
91
-
92
- ## [1.3.2]
93
-
94
- ### Fixed
95
-
96
- - Resolve issues with some Characteristics names not being accepted since hap-nodejs upgrade
97
-
98
- ## [1.3.1]
99
-
100
- ### Fixed
101
-
102
- - Fix allowMessagePassthrough=false not working for messages from Home.app
103
-
104
- ## [1.3.0]
105
-
106
- ### Fixed
107
-
108
- - There was a problem when mdnsConfig was
109
- empty [#322](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/322)
110
- - There was a problem when NRCHKB was updated without Node-RED
111
- restart [#363](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/363)
112
- - Linked service throws error during setup if parent waits for the setup message (thanks @AlexOwl)
113
- - . in Bridge name was causing it not being published without any feedback to user
114
-
115
- ### Added
116
-
117
- - More code tests
118
- - Verify if Node.js version criteria is met on start
119
- - Support fo9r Standalone Accessory mode (like in old
120
- times) [#310](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/310)
121
- - (Experimental) Support for Custom
122
- Characteristics [#52](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/52)
123
- - Add client IP address to onSet/onChange output
124
- message (`msg.hap.session`) [#328](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/328)
125
- - As of new mdns advertiser available now there is a possibility to choose which you want to use in Bridge Config:
126
- ciao (
127
- new, improved but not yet proved) or (good old) bonjour. Default bonjour
128
-
129
- ### Changed
130
-
131
- - Updated hap-nodejs to 0.9.4
132
- - Updated dependencies to latest versions
133
- - TypeScript-ify code
134
- - Generate random pin code for new Bridge nodes
135
-
136
- ## [1.2.0] - 2020.08.16
137
-
138
- ### Fixed
139
-
140
- - JS console error when opening a linked
141
- service [#278](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/278)
142
- - Fixed outputs number not being remembered by editor
143
- - Fixed saving Software Revision fo Service node
144
- - Fixed HAPStorage path on Windows
145
- - There was a translation issue, changed pilot to remote in README.
146
-
147
- ### Added
148
-
149
- - Added Firmware, Software and Hardware Revision fields to Bridge configuration
150
- - Now we have examples that you can import in node-red!
151
- - You can make Service node wait for setup message.
152
-
153
- ### Changed
154
-
155
- - Now Firmware, Software and Hardware Revision and Model fields are set by default to NRCHKB version, Manufacturer is
156
- NRCHKB by default
157
- - Updated hap-nodejs to 0.7.8
158
- - Updated dependencies to latest versions
159
- - Disallow using port 1880 for Bridge as that port is reserved for node-red
160
-
161
- ## [1.1.1] - 2020.06.30
162
-
163
- ### Added
164
-
165
- - Firmware Revision configuration option (
166
- optional) [#211](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/pull/211)
167
- - Hardware and Software Revision configuration option (optional)
168
- - Project now support typescript!
169
-
170
- ### Fixed
171
-
172
- - Error status is not passed to callback when "No response" was
173
- triggered [#227](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/pull/227) also discussed
174
- in [#185](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/pull/185)
175
-
176
- ### Changed
177
-
178
- - Some README.md rework
179
- - Updated hap-nodejs to 0.7.3
180
- - Updated dependencies to latest versions
181
- - Moved lint-staged config to main level and added minimum nodejs version
182
-
183
- ### Removed
184
-
185
- - Some unused code disappeared.
186
-
187
- ## [1.0.4] - 2020.03.03
188
-
189
- ### Fixed
190
-
191
- - Warn when trying to deploy node without bridge or parentService
192
- attached [#214](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/214#issuecomment-594084125)
193
- - Additional Command Line value in Camera Control is now
194
- optional [#214](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/214#issuecomment-593736115)
195
-
196
- ## [1.0.3] - 2020.03.01
197
-
198
- ### Fixed
199
-
200
- - Video Filter value in Camera Control is now optional in node-red editor
201
- too [#214](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/214)
202
-
203
- ## [1.0.2] - 2020.03.01
204
-
205
- ### Added
206
-
207
- - Warning about lost compatibility on README page.
208
-
209
- ## [1.0.0] - 2020.02.23
210
-
211
- Lost backward compatibility. In order to make it work read
212
- this [notice](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/pull/163#issuecomment-590108567).
213
-
214
- ### Fixed
215
-
216
- - Node id macify algorithm changed [#170](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/170)
217
- - Corrections regarding issue [#12](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/12) so that
218
- changes can be deployed without restarting node-red
219
- - Automatically creating a new service and replacing the old one if the service type changed
220
- - Automatically replacing an accessory with a new one if the accessory information changes (e.g., Name, Manufacturer,
221
- ...)
222
- - Video Filter value in Camera Control is now
223
- optional [#194](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/194) (can be empty, before it was
224
- generated if was empty)
225
- - Removed updateReachability as it is deprecated (and doesn't make a difference)
226
-
227
- ### Added
228
-
229
- - After Service selection in node configuration Category will be automatically set to default for Service
230
- - Interface Name for Camera Service configuration
231
- - Support for new TV Remote services
232
- - Now first output is for onChange, second for onSet and third for camera
233
- snapshot. [#200](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/200)
234
- - Sponsor Button on repository page
235
-
236
- ### Changed
237
-
238
- - Accessory Category in node configuration moved under Service selection
239
- - Clarify NO_RESPONSE in README
240
- - Update node-red version in dependencies
241
- - Camera Service source code to match the newest improvements in homebridge-camera-ffmpeg
242
- - Update to latest HAP-NodeJS
243
- - Removed unnecessary accessory category from service node
244
- - Removed fields Manufacturer, Serial Number and Model from linked service nodes
245
- - Moved eslint and prettier configuration to package.json
246
- - Added automatic linting on pre-commit
247
-
248
- ## [0.8.0] - 2019.10.14
249
-
250
- ### Added
251
-
252
- - Added greenkeeper
253
- - Added setting to Bridge configuration called Allow Message Passthrough
254
-
255
- ### Changed
256
-
257
- - Updated README
258
-
259
- ### Fixed
260
-
261
- - Revert hap.context in node output
262
-
263
- ## [0.7.1] - 2019.10.13
264
-
265
- ### Fixed
266
-
267
- - Added labels to node outputs as there are new output for camera snapshot
268
-
269
- ## [0.7.0] - 2019.10.12
270
-
271
- ### Added
272
-
273
- - CHANGELOG page introduction
274
- - Change from "characteristic-change" to "set" to listen to HAP-NodeJS events
275
- - Sorted Service Type list in UI
276
- - Camera support (RTSP, Video Doorbell and others)
277
- - RemoteKey value now appears in node output!
278
- - HAP-NodeJS version changed to latest (0.5.0)
279
- - Added Accessory Category field for Parent Service
280
- - More code refactoring
281
- - The Newest HomeKit Docs uploaded
282
- - Security hints
283
- - And more...
284
-
285
- ### Changed
286
-
287
- - MIT license
288
- - Better node-red tests
289
- - Prettified and linted code!
290
- - Support for node 8 and 10 only
291
- - GitHub Actions for automatic tests and publish
292
- - And more...
293
-
294
- ### Fixed
295
-
296
- - Removed read/write boundaries for Characteristics
297
- - And more...
298
-
299
- ## [0.6.2] - 2019.03.27
300
-
301
- ### Changed
302
-
303
- - Some minor changes in README
304
-
305
- ### Fixed
306
-
307
- - Hotfix for "NO_RESPONSE"
308
-
309
- ## [0.6.1] - 2019.03.21
310
-
311
- ### Added
312
-
313
- - Reintroduced DEBUG mode (DEBUG=NRCHKB node-red)
314
-
315
- ### Changed
316
-
317
- - Renaming organisation
318
- - Minor changes to process of finding Parent Service as Linked Service
319
-
320
- ### Fixed
321
-
322
- - Crash upon removing bridge from Home [#22](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/22)
323
- - Fix: "Error: This callback function has already been called by someone
324
- else..." [#66](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/66)
325
-
326
- ## [0.6.0] - 2019.03.16
327
-
328
- ### Added
329
-
330
- - Introduce Linked Services [#41](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/41)
331
- - MDNS Configuration [#44](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/44)
332
- - Filter on Topic
333
- - NO_RESPONSE trigger [#48](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/48)
334
- - onIdentify [#54](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues/54)
335
- - Added automatic tests for building project, code quality and finding vulnerabilities
336
-
337
- ### Changed
338
-
339
- - Redesigned README