hap-nodejs 0.12.3-beta.2 → 0.12.3-beta.21

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 (175) hide show
  1. package/README.md +1 -0
  2. package/dist/accessories/AirConditioner_accessory.js +24 -24
  3. package/dist/accessories/AirConditioner_accessory.js.map +1 -1
  4. package/dist/accessories/AppleTVRemote_accessory.js +23 -23
  5. package/dist/accessories/AppleTVRemote_accessory.js.map +1 -1
  6. package/dist/accessories/Camera_accessory.js +292 -373
  7. package/dist/accessories/Camera_accessory.js.map +1 -1
  8. package/dist/accessories/Fan_accessory.js +15 -21
  9. package/dist/accessories/Fan_accessory.js.map +1 -1
  10. package/dist/accessories/GarageDoorOpener_accessory.js +12 -12
  11. package/dist/accessories/GarageDoorOpener_accessory.js.map +1 -1
  12. package/dist/accessories/Light-AdaptiveLighting_accessory.js +31 -21
  13. package/dist/accessories/Light-AdaptiveLighting_accessory.js.map +1 -1
  14. package/dist/accessories/Light_accessory.js +45 -48
  15. package/dist/accessories/Light_accessory.js.map +1 -1
  16. package/dist/accessories/Lock_accessory.js +11 -11
  17. package/dist/accessories/Lock_accessory.js.map +1 -1
  18. package/dist/accessories/MotionSensor_accessory.js +8 -8
  19. package/dist/accessories/MotionSensor_accessory.js.map +1 -1
  20. package/dist/accessories/Outlet_accessory.js +10 -10
  21. package/dist/accessories/Outlet_accessory.js.map +1 -1
  22. package/dist/accessories/SmartSpeaker_accessory.js +11 -11
  23. package/dist/accessories/SmartSpeaker_accessory.js.map +1 -1
  24. package/dist/accessories/Sprinkler_accessory.js +19 -19
  25. package/dist/accessories/Sprinkler_accessory.js.map +1 -1
  26. package/dist/accessories/TV_accessory.js +17 -17
  27. package/dist/accessories/TV_accessory.js.map +1 -1
  28. package/dist/accessories/TemperatureSensor_accessory.js +6 -6
  29. package/dist/accessories/TemperatureSensor_accessory.js.map +1 -1
  30. package/dist/accessories/Wi-FiRouter_accessory.js +3 -3
  31. package/dist/accessories/Wi-FiRouter_accessory.js.map +1 -1
  32. package/dist/accessories/Wi-FiSatellite_accessory.js +4 -4
  33. package/dist/accessories/Wi-FiSatellite_accessory.js.map +1 -1
  34. package/dist/accessories/gstreamer-audioProducer.js +36 -47
  35. package/dist/accessories/gstreamer-audioProducer.js.map +1 -1
  36. package/dist/accessories/types.js +2 -2
  37. package/dist/accessories/types.js.map +1 -1
  38. package/dist/index.d.ts +0 -14
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +5 -28
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/Accessory.d.ts +1 -58
  43. package/dist/lib/Accessory.d.ts.map +1 -1
  44. package/dist/lib/Accessory.js +747 -1149
  45. package/dist/lib/Accessory.js.map +1 -1
  46. package/dist/lib/Advertiser.d.ts +1 -2
  47. package/dist/lib/Advertiser.d.ts.map +1 -1
  48. package/dist/lib/Advertiser.js +392 -524
  49. package/dist/lib/Advertiser.js.map +1 -1
  50. package/dist/lib/Bridge.js +6 -10
  51. package/dist/lib/Bridge.js.map +1 -1
  52. package/dist/lib/Characteristic.d.ts +2 -133
  53. package/dist/lib/Characteristic.d.ts.map +1 -1
  54. package/dist/lib/Characteristic.js +1467 -669
  55. package/dist/lib/Characteristic.js.map +1 -1
  56. package/dist/lib/HAPServer.d.ts +0 -10
  57. package/dist/lib/HAPServer.d.ts.map +1 -1
  58. package/dist/lib/HAPServer.js +216 -280
  59. package/dist/lib/HAPServer.js.map +1 -1
  60. package/dist/lib/Service.d.ts +1 -51
  61. package/dist/lib/Service.d.ts.map +1 -1
  62. package/dist/lib/Service.js +474 -322
  63. package/dist/lib/Service.js.map +1 -1
  64. package/dist/lib/camera/RTPProxy.js +112 -104
  65. package/dist/lib/camera/RTPProxy.js.map +1 -1
  66. package/dist/lib/camera/RTPStreamManagement.d.ts +0 -65
  67. package/dist/lib/camera/RTPStreamManagement.d.ts.map +1 -1
  68. package/dist/lib/camera/RTPStreamManagement.js +255 -278
  69. package/dist/lib/camera/RTPStreamManagement.js.map +1 -1
  70. package/dist/lib/camera/RecordingManagement.js +318 -381
  71. package/dist/lib/camera/RecordingManagement.js.map +1 -1
  72. package/dist/lib/camera/index.d.ts +0 -1
  73. package/dist/lib/camera/index.d.ts.map +1 -1
  74. package/dist/lib/camera/index.js +1 -2
  75. package/dist/lib/camera/index.js.map +1 -1
  76. package/dist/lib/controller/AdaptiveLightingController.d.ts +19 -3
  77. package/dist/lib/controller/AdaptiveLightingController.d.ts.map +1 -1
  78. package/dist/lib/controller/AdaptiveLightingController.js +217 -218
  79. package/dist/lib/controller/AdaptiveLightingController.js.map +1 -1
  80. package/dist/lib/controller/CameraController.d.ts +0 -4
  81. package/dist/lib/controller/CameraController.d.ts.map +1 -1
  82. package/dist/lib/controller/CameraController.js +189 -256
  83. package/dist/lib/controller/CameraController.js.map +1 -1
  84. package/dist/lib/controller/DoorbellController.js +38 -39
  85. package/dist/lib/controller/DoorbellController.js.map +1 -1
  86. package/dist/lib/controller/RemoteController.d.ts +0 -14
  87. package/dist/lib/controller/RemoteController.d.ts.map +1 -1
  88. package/dist/lib/controller/RemoteController.js +340 -415
  89. package/dist/lib/controller/RemoteController.js.map +1 -1
  90. package/dist/lib/controller/index.js +1 -1
  91. package/dist/lib/datastream/DataStreamManagement.js +56 -57
  92. package/dist/lib/datastream/DataStreamManagement.js.map +1 -1
  93. package/dist/lib/datastream/DataStreamParser.js +259 -304
  94. package/dist/lib/datastream/DataStreamParser.js.map +1 -1
  95. package/dist/lib/datastream/DataStreamServer.d.ts +0 -5
  96. package/dist/lib/datastream/DataStreamServer.d.ts.map +1 -1
  97. package/dist/lib/datastream/DataStreamServer.js +252 -269
  98. package/dist/lib/datastream/DataStreamServer.js.map +1 -1
  99. package/dist/lib/datastream/index.js +1 -1
  100. package/dist/lib/definitions/CharacteristicDefinitions.d.ts +1 -106
  101. package/dist/lib/definitions/CharacteristicDefinitions.d.ts.map +1 -1
  102. package/dist/lib/definitions/CharacteristicDefinitions.js +2000 -2995
  103. package/dist/lib/definitions/CharacteristicDefinitions.js.map +1 -1
  104. package/dist/lib/definitions/ServiceDefinitions.d.ts +0 -32
  105. package/dist/lib/definitions/ServiceDefinitions.d.ts.map +1 -1
  106. package/dist/lib/definitions/ServiceDefinitions.js +820 -1147
  107. package/dist/lib/definitions/ServiceDefinitions.js.map +1 -1
  108. package/dist/lib/definitions/generate-definitions.js +383 -679
  109. package/dist/lib/definitions/generate-definitions.js.map +1 -1
  110. package/dist/lib/definitions/generator-configuration.js +29 -29
  111. package/dist/lib/definitions/generator-configuration.js.map +1 -1
  112. package/dist/lib/definitions/index.js +1 -1
  113. package/dist/lib/model/AccessoryInfo.js +101 -136
  114. package/dist/lib/model/AccessoryInfo.js.map +1 -1
  115. package/dist/lib/model/ControllerStorage.js +86 -89
  116. package/dist/lib/model/ControllerStorage.js.map +1 -1
  117. package/dist/lib/model/HAPStorage.js +15 -16
  118. package/dist/lib/model/HAPStorage.js.map +1 -1
  119. package/dist/lib/model/IdentifierCache.js +49 -49
  120. package/dist/lib/model/IdentifierCache.js.map +1 -1
  121. package/dist/lib/tv/AccessControlManagement.js +40 -44
  122. package/dist/lib/tv/AccessControlManagement.js.map +1 -1
  123. package/dist/lib/util/checkName.d.ts +2 -1
  124. package/dist/lib/util/checkName.d.ts.map +1 -1
  125. package/dist/lib/util/checkName.js +7 -11
  126. package/dist/lib/util/checkName.js.map +1 -1
  127. package/dist/lib/util/clone.js +5 -27
  128. package/dist/lib/util/clone.js.map +1 -1
  129. package/dist/lib/util/color-utils.js +8 -12
  130. package/dist/lib/util/color-utils.js.map +1 -1
  131. package/dist/lib/util/eventedhttp.d.ts.map +1 -1
  132. package/dist/lib/util/eventedhttp.js +301 -409
  133. package/dist/lib/util/eventedhttp.js.map +1 -1
  134. package/dist/lib/util/hapCrypto.js +31 -32
  135. package/dist/lib/util/hapCrypto.js.map +1 -1
  136. package/dist/lib/util/hapStatusError.js +9 -12
  137. package/dist/lib/util/hapStatusError.js.map +1 -1
  138. package/dist/lib/util/net-utils.js +32 -53
  139. package/dist/lib/util/net-utils.js.map +1 -1
  140. package/dist/lib/util/once.js +3 -8
  141. package/dist/lib/util/once.js.map +1 -1
  142. package/dist/lib/util/promise-utils.js +8 -13
  143. package/dist/lib/util/promise-utils.js.map +1 -1
  144. package/dist/lib/util/request-util.js +2 -3
  145. package/dist/lib/util/request-util.js.map +1 -1
  146. package/dist/lib/util/time.js +5 -5
  147. package/dist/lib/util/time.js.map +1 -1
  148. package/dist/lib/util/tlv.d.ts +0 -27
  149. package/dist/lib/util/tlv.d.ts.map +1 -1
  150. package/dist/lib/util/tlv.js +71 -113
  151. package/dist/lib/util/tlv.js.map +1 -1
  152. package/dist/lib/util/uuid.d.ts +0 -9
  153. package/dist/lib/util/uuid.d.ts.map +1 -1
  154. package/dist/lib/util/uuid.js +15 -33
  155. package/dist/lib/util/uuid.js.map +1 -1
  156. package/dist/types.d.ts +0 -35
  157. package/dist/types.d.ts.map +1 -1
  158. package/dist/types.js.map +1 -1
  159. package/package.json +10 -10
  160. package/dist/BridgedCore.d.ts +0 -2
  161. package/dist/BridgedCore.d.ts.map +0 -1
  162. package/dist/BridgedCore.js +0 -43
  163. package/dist/BridgedCore.js.map +0 -1
  164. package/dist/Core.d.ts +0 -2
  165. package/dist/Core.d.ts.map +0 -1
  166. package/dist/Core.js +0 -52
  167. package/dist/Core.js.map +0 -1
  168. package/dist/lib/AccessoryLoader.d.ts +0 -28
  169. package/dist/lib/AccessoryLoader.d.ts.map +0 -1
  170. package/dist/lib/AccessoryLoader.js +0 -166
  171. package/dist/lib/AccessoryLoader.js.map +0 -1
  172. package/dist/lib/camera/Camera.d.ts +0 -43
  173. package/dist/lib/camera/Camera.d.ts.map +0 -1
  174. package/dist/lib/camera/Camera.js +0 -36
  175. package/dist/lib/camera/Camera.js.map +0 -1
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CameraController = exports.CameraControllerEvents = exports.ResourceRequestReason = void 0;
4
- var tslib_1 = require("tslib");
5
- var crypto_1 = tslib_1.__importDefault(require("crypto"));
6
- var debug_1 = tslib_1.__importDefault(require("debug"));
7
- var events_1 = require("events");
8
- var camera_1 = require("../camera");
9
- var Characteristic_1 = require("../Characteristic");
10
- var datastream_1 = require("../datastream");
11
- var Service_1 = require("../Service");
12
- var hapStatusError_1 = require("../util/hapStatusError");
13
- var debug = (0, debug_1.default)("HAP-NodeJS:Camera:Controller");
4
+ const tslib_1 = require("tslib");
5
+ const crypto_1 = tslib_1.__importDefault(require("crypto"));
6
+ const debug_1 = tslib_1.__importDefault(require("debug"));
7
+ const events_1 = require("events");
8
+ const camera_1 = require("../camera");
9
+ const Characteristic_1 = require("../Characteristic");
10
+ const datastream_1 = require("../datastream");
11
+ const Service_1 = require("../Service");
12
+ const hapStatusError_1 = require("../util/hapStatusError");
13
+ const debug = (0, debug_1.default)("HAP-NodeJS:Camera:Controller");
14
14
  /**
15
15
  * @group Camera
16
16
  */
@@ -50,36 +50,57 @@ var CameraControllerEvents;
50
50
  * @group Camera
51
51
  */
52
52
  // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
53
- var CameraController = /** @class */ (function (_super) {
54
- tslib_1.__extends(CameraController, _super);
55
- function CameraController(options, legacyMode) {
56
- if (legacyMode === void 0) { legacyMode = false; }
57
- var _this = _super.call(this) || this;
58
- _this.legacyMode = false;
59
- /**
60
- * @private
61
- */
62
- _this.streamManagements = [];
63
- _this.microphoneMuted = false;
64
- _this.microphoneVolume = 100;
65
- _this.speakerMuted = false;
66
- _this.speakerVolume = 100;
67
- _this.motionServiceExternallySupplied = false;
68
- _this.occupancyServiceExternallySupplied = false;
69
- _this.streamCount = Math.max(1, options.cameraStreamCount || 1);
70
- _this.delegate = options.delegate;
71
- _this.streamingOptions = options.streamingOptions;
72
- _this.recording = options.recording;
73
- _this.sensorOptions = options.sensors;
74
- _this.legacyMode = legacyMode; // legacy mode will prevent from Microphone and Speaker services to get created to avoid collisions
75
- return _this;
53
+ class CameraController extends events_1.EventEmitter {
54
+ static STREAM_MANAGEMENT = "streamManagement"; // key to index all RTPStreamManagement services
55
+ stateChangeDelegate;
56
+ streamCount;
57
+ delegate;
58
+ streamingOptions;
59
+ /**
60
+ * **Temporary** storage for {@link CameraRecordingOptions} and {@link CameraRecordingDelegate}.
61
+ * This property is reset to `undefined` after the CameraController was fully initialized.
62
+ * You can still access those values via the {@link CameraController.recordingManagement}.
63
+ */
64
+ recording;
65
+ /**
66
+ * Temporary storage for the sensor option.
67
+ */
68
+ sensorOptions;
69
+ legacyMode = false;
70
+ /**
71
+ * @private
72
+ */
73
+ streamManagements = [];
74
+ /**
75
+ * The {@link RecordingManagement} which is responsible for handling HomeKit Secure Video.
76
+ * This property is only present if recording was configured.
77
+ */
78
+ recordingManagement;
79
+ microphoneService;
80
+ speakerService;
81
+ microphoneMuted = false;
82
+ microphoneVolume = 100;
83
+ speakerMuted = false;
84
+ speakerVolume = 100;
85
+ motionService;
86
+ motionServiceExternallySupplied = false;
87
+ occupancyService;
88
+ occupancyServiceExternallySupplied = false;
89
+ constructor(options, legacyMode = false) {
90
+ super();
91
+ this.streamCount = Math.max(1, options.cameraStreamCount || 1);
92
+ this.delegate = options.delegate;
93
+ this.streamingOptions = options.streamingOptions;
94
+ this.recording = options.recording;
95
+ this.sensorOptions = options.sensors;
96
+ this.legacyMode = legacyMode; // legacy mode will prevent from Microphone and Speaker services to get created to avoid collisions
76
97
  }
77
98
  /**
78
99
  * @private
79
100
  */
80
- CameraController.prototype.controllerId = function () {
101
+ controllerId() {
81
102
  return "camera" /* DefaultControllerType.CAMERA */;
82
- };
103
+ }
83
104
  // ----------------------------------- STREAM API ------------------------------------
84
105
  /**
85
106
  * Call this method if you want to forcefully suspend an ongoing streaming session.
@@ -87,63 +108,60 @@ var CameraController = /** @class */ (function (_super) {
87
108
  *
88
109
  * @param sessionId - id of the current ongoing streaming session
89
110
  */
90
- CameraController.prototype.forceStopStreamingSession = function (sessionId) {
91
- this.streamManagements.forEach(function (management) {
111
+ forceStopStreamingSession(sessionId) {
112
+ this.streamManagements.forEach(management => {
92
113
  if (management.sessionIdentifier === sessionId) {
93
114
  management.forceStop();
94
115
  }
95
116
  });
96
- };
97
- CameraController.generateSynchronisationSource = function () {
98
- var ssrc = crypto_1.default.randomBytes(4); // range [-2.14748e+09 - 2.14748e+09]
117
+ }
118
+ static generateSynchronisationSource() {
119
+ const ssrc = crypto_1.default.randomBytes(4); // range [-2.14748e+09 - 2.14748e+09]
99
120
  ssrc[0] = 0;
100
121
  return ssrc.readInt32BE(0);
101
- };
122
+ }
102
123
  // ----------------------------- MICROPHONE/SPEAKER API ------------------------------
103
- CameraController.prototype.setMicrophoneMuted = function (muted) {
104
- if (muted === void 0) { muted = true; }
124
+ setMicrophoneMuted(muted = true) {
105
125
  if (!this.microphoneService) {
106
126
  return;
107
127
  }
108
128
  this.microphoneMuted = muted;
109
129
  this.microphoneService.updateCharacteristic(Characteristic_1.Characteristic.Mute, muted);
110
- };
111
- CameraController.prototype.setMicrophoneVolume = function (volume) {
130
+ }
131
+ setMicrophoneVolume(volume) {
112
132
  if (!this.microphoneService) {
113
133
  return;
114
134
  }
115
135
  this.microphoneVolume = volume;
116
136
  this.microphoneService.updateCharacteristic(Characteristic_1.Characteristic.Volume, volume);
117
- };
118
- CameraController.prototype.setSpeakerMuted = function (muted) {
119
- if (muted === void 0) { muted = true; }
137
+ }
138
+ setSpeakerMuted(muted = true) {
120
139
  if (!this.speakerService) {
121
140
  return;
122
141
  }
123
142
  this.speakerMuted = muted;
124
143
  this.speakerService.updateCharacteristic(Characteristic_1.Characteristic.Mute, muted);
125
- };
126
- CameraController.prototype.setSpeakerVolume = function (volume) {
144
+ }
145
+ setSpeakerVolume(volume) {
127
146
  if (!this.speakerService) {
128
147
  return;
129
148
  }
130
149
  this.speakerVolume = volume;
131
150
  this.speakerService.updateCharacteristic(Characteristic_1.Characteristic.Volume, volume);
132
- };
133
- CameraController.prototype.emitMicrophoneChange = function () {
151
+ }
152
+ emitMicrophoneChange() {
134
153
  this.emit("microphone-change" /* CameraControllerEvents.MICROPHONE_PROPERTIES_CHANGED */, this.microphoneMuted, this.microphoneVolume);
135
- };
136
- CameraController.prototype.emitSpeakerChange = function () {
154
+ }
155
+ emitSpeakerChange() {
137
156
  this.emit("speaker-change" /* CameraControllerEvents.SPEAKER_PROPERTIES_CHANGED */, this.speakerMuted, this.speakerVolume);
138
- };
157
+ }
139
158
  // -----------------------------------------------------------------------------------
140
159
  /**
141
160
  * @private
142
161
  */
143
- CameraController.prototype.constructServices = function () {
144
- var _a, _b, _c, _d;
145
- for (var i = 0; i < this.streamCount; i++) {
146
- var rtp = new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, undefined, this.rtpStreamManagementDisabledThroughOperatingMode.bind(this));
162
+ constructServices() {
163
+ for (let i = 0; i < this.streamCount; i++) {
164
+ const rtp = new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, undefined, this.rtpStreamManagementDisabledThroughOperatingMode.bind(this));
147
165
  this.streamManagements.push(rtp);
148
166
  }
149
167
  if (!this.legacyMode && this.streamingOptions.audio) {
@@ -159,7 +177,7 @@ var CameraController = /** @class */ (function (_super) {
159
177
  if (this.recording) {
160
178
  this.recordingManagement = new camera_1.RecordingManagement(this.recording.options, this.recording.delegate, this.retrieveEventTriggerOptions());
161
179
  }
162
- if ((_a = this.sensorOptions) === null || _a === void 0 ? void 0 : _a.motion) {
180
+ if (this.sensorOptions?.motion) {
163
181
  if (typeof this.sensorOptions.motion === "boolean") {
164
182
  this.motionService = new Service_1.Service.MotionSensor("", "");
165
183
  }
@@ -168,9 +186,9 @@ var CameraController = /** @class */ (function (_super) {
168
186
  this.motionServiceExternallySupplied = true;
169
187
  }
170
188
  this.motionService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
171
- (_b = this.recordingManagement) === null || _b === void 0 ? void 0 : _b.recordingManagementService.addLinkedService(this.motionService);
189
+ this.recordingManagement?.recordingManagementService.addLinkedService(this.motionService);
172
190
  }
173
- if ((_c = this.sensorOptions) === null || _c === void 0 ? void 0 : _c.occupancy) {
191
+ if (this.sensorOptions?.occupancy) {
174
192
  if (typeof this.sensorOptions.occupancy === "boolean") {
175
193
  this.occupancyService = new Service_1.Service.OccupancySensor("", "");
176
194
  }
@@ -179,9 +197,9 @@ var CameraController = /** @class */ (function (_super) {
179
197
  this.occupancyServiceExternallySupplied = true;
180
198
  }
181
199
  this.occupancyService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
182
- (_d = this.recordingManagement) === null || _d === void 0 ? void 0 : _d.recordingManagementService.addLinkedService(this.occupancyService);
200
+ this.recordingManagement?.recordingManagementService.addLinkedService(this.occupancyService);
183
201
  }
184
- var serviceMap = {
202
+ const serviceMap = {
185
203
  microphone: this.microphoneService,
186
204
  speaker: this.speakerService,
187
205
  motionService: !this.motionServiceExternallySupplied ? this.motionService : undefined,
@@ -192,35 +210,34 @@ var CameraController = /** @class */ (function (_super) {
192
210
  serviceMap.cameraOperatingMode = this.recordingManagement.operatingModeService;
193
211
  serviceMap.dataStreamTransportManagement = this.recordingManagement.dataStreamManagement.getService();
194
212
  }
195
- this.streamManagements.forEach(function (management, index) {
213
+ this.streamManagements.forEach((management, index) => {
196
214
  serviceMap[CameraController.STREAM_MANAGEMENT + index] = management.getService();
197
215
  });
198
216
  this.recording = undefined;
199
217
  this.sensorOptions = undefined;
200
218
  return serviceMap;
201
- };
219
+ }
202
220
  /**
203
221
  * @private
204
222
  */
205
- CameraController.prototype.initWithServices = function (serviceMap) {
206
- var result = this._initWithServices(serviceMap);
223
+ initWithServices(serviceMap) {
224
+ const result = this._initWithServices(serviceMap);
207
225
  if (result.updated) { // serviceMap must only be returned if anything actually changed
208
226
  return result.serviceMap;
209
227
  }
210
- };
211
- CameraController.prototype._initWithServices = function (serviceMap) {
212
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
213
- var modifiedServiceMap = false;
228
+ }
229
+ _initWithServices(serviceMap) {
230
+ let modifiedServiceMap = false;
214
231
  // eslint-disable-next-line no-constant-condition
215
- for (var i = 0; true; i++) {
216
- var streamManagementService = serviceMap[CameraController.STREAM_MANAGEMENT + i];
232
+ for (let i = 0; true; i++) {
233
+ const streamManagementService = serviceMap[CameraController.STREAM_MANAGEMENT + i];
217
234
  if (i < this.streamCount) {
218
- var operatingModeClosure = this.rtpStreamManagementDisabledThroughOperatingMode.bind(this);
235
+ const operatingModeClosure = this.rtpStreamManagementDisabledThroughOperatingMode.bind(this);
219
236
  if (streamManagementService) { // normal init
220
237
  this.streamManagements.push(new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, streamManagementService, operatingModeClosure));
221
238
  }
222
239
  else { // stream count got bigger, we need to create a new service
223
- var management = new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, undefined, operatingModeClosure);
240
+ const management = new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, undefined, operatingModeClosure);
224
241
  this.streamManagements.push(management);
225
242
  serviceMap[CameraController.STREAM_MANAGEMENT + i] = management.getService();
226
243
  modifiedServiceMap = true;
@@ -255,7 +272,7 @@ var CameraController = /** @class */ (function (_super) {
255
272
  modifiedServiceMap = true;
256
273
  }
257
274
  // SPEAKER
258
- if (!this.legacyMode && ((_a = this.streamingOptions.audio) === null || _a === void 0 ? void 0 : _a.twoWayAudio)) { // speaker should be present
275
+ if (!this.legacyMode && this.streamingOptions.audio?.twoWayAudio) { // speaker should be present
259
276
  if (serviceMap.speaker) {
260
277
  this.speakerService = serviceMap.speaker;
261
278
  }
@@ -274,7 +291,7 @@ var CameraController = /** @class */ (function (_super) {
274
291
  }
275
292
  // RECORDING
276
293
  if (this.recording) {
277
- var eventTriggers = this.retrieveEventTriggerOptions();
294
+ const eventTriggers = this.retrieveEventTriggerOptions();
278
295
  // RECORDING MANAGEMENT
279
296
  if (serviceMap.cameraEventRecordingManagement && serviceMap.cameraOperatingMode && serviceMap.dataStreamTransportManagement) {
280
297
  this.recordingManagement = new camera_1.RecordingManagement(this.recording.options, this.recording.delegate, eventTriggers, {
@@ -306,7 +323,7 @@ var CameraController = /** @class */ (function (_super) {
306
323
  }
307
324
  }
308
325
  // MOTION SENSOR
309
- if ((_b = this.sensorOptions) === null || _b === void 0 ? void 0 : _b.motion) {
326
+ if (this.sensorOptions?.motion) {
310
327
  if (typeof this.sensorOptions.motion === "boolean") {
311
328
  if (serviceMap.motionService) {
312
329
  this.motionService = serviceMap.motionService;
@@ -321,23 +338,23 @@ var CameraController = /** @class */ (function (_super) {
321
338
  this.motionService = this.sensorOptions.motion;
322
339
  this.motionServiceExternallySupplied = true;
323
340
  if (serviceMap.motionService) { // motion service previously supplied as bool option
324
- (_c = this.recordingManagement) === null || _c === void 0 ? void 0 : _c.recordingManagementService.removeLinkedService(serviceMap.motionService);
341
+ this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.motionService);
325
342
  delete serviceMap.motionService;
326
343
  modifiedServiceMap = true;
327
344
  }
328
345
  }
329
346
  this.motionService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
330
- (_d = this.recordingManagement) === null || _d === void 0 ? void 0 : _d.recordingManagementService.addLinkedService(this.motionService);
347
+ this.recordingManagement?.recordingManagementService.addLinkedService(this.motionService);
331
348
  }
332
349
  else {
333
350
  if (serviceMap.motionService) {
334
- (_e = this.recordingManagement) === null || _e === void 0 ? void 0 : _e.recordingManagementService.removeLinkedService(serviceMap.motionService);
351
+ this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.motionService);
335
352
  delete serviceMap.motionService;
336
353
  modifiedServiceMap = true;
337
354
  }
338
355
  }
339
356
  // OCCUPANCY SENSOR
340
- if ((_f = this.sensorOptions) === null || _f === void 0 ? void 0 : _f.occupancy) {
357
+ if (this.sensorOptions?.occupancy) {
341
358
  if (typeof this.sensorOptions.occupancy === "boolean") {
342
359
  if (serviceMap.occupancyService) {
343
360
  this.occupancyService = serviceMap.occupancyService;
@@ -352,17 +369,17 @@ var CameraController = /** @class */ (function (_super) {
352
369
  this.occupancyService = this.sensorOptions.occupancy;
353
370
  this.occupancyServiceExternallySupplied = true;
354
371
  if (serviceMap.occupancyService) { // occupancy service previously supplied as bool option
355
- (_g = this.recordingManagement) === null || _g === void 0 ? void 0 : _g.recordingManagementService.removeLinkedService(serviceMap.occupancyService);
372
+ this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.occupancyService);
356
373
  delete serviceMap.occupancyService;
357
374
  modifiedServiceMap = true;
358
375
  }
359
376
  }
360
377
  this.occupancyService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
361
- (_h = this.recordingManagement) === null || _h === void 0 ? void 0 : _h.recordingManagementService.addLinkedService(this.occupancyService);
378
+ this.recordingManagement?.recordingManagementService.addLinkedService(this.occupancyService);
362
379
  }
363
380
  else {
364
381
  if (serviceMap.occupancyService) {
365
- (_j = this.recordingManagement) === null || _j === void 0 ? void 0 : _j.recordingManagementService.removeLinkedService(serviceMap.occupancyService);
382
+ this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.occupancyService);
366
383
  delete serviceMap.occupancyService;
367
384
  modifiedServiceMap = true;
368
385
  }
@@ -376,256 +393,182 @@ var CameraController = /** @class */ (function (_super) {
376
393
  serviceMap: serviceMap,
377
394
  updated: modifiedServiceMap,
378
395
  };
379
- };
396
+ }
380
397
  // overwritten in DoorbellController (to avoid cyclic dependencies, I hate typescript for that)
381
- CameraController.prototype.migrateFromDoorbell = function (serviceMap) {
398
+ migrateFromDoorbell(serviceMap) {
382
399
  if (serviceMap.doorbell) { // See NOTICE in DoorbellController
383
400
  delete serviceMap.doorbell;
384
401
  return true;
385
402
  }
386
403
  return false;
387
- };
388
- CameraController.prototype.retrieveEventTriggerOptions = function () {
389
- var e_1, _a;
390
- var _b;
404
+ }
405
+ retrieveEventTriggerOptions() {
391
406
  if (!this.recording) {
392
407
  return new Set();
393
408
  }
394
- var triggerOptions = new Set();
409
+ const triggerOptions = new Set();
395
410
  if (this.recording.options.overrideEventTriggerOptions) {
396
- try {
397
- for (var _c = tslib_1.__values(this.recording.options.overrideEventTriggerOptions), _d = _c.next(); !_d.done; _d = _c.next()) {
398
- var option = _d.value;
399
- triggerOptions.add(option);
400
- }
401
- }
402
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
403
- finally {
404
- try {
405
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
406
- }
407
- finally { if (e_1) throw e_1.error; }
411
+ for (const option of this.recording.options.overrideEventTriggerOptions) {
412
+ triggerOptions.add(option);
408
413
  }
409
414
  }
410
- if ((_b = this.sensorOptions) === null || _b === void 0 ? void 0 : _b.motion) {
415
+ if (this.sensorOptions?.motion) {
411
416
  triggerOptions.add(1 /* EventTriggerOption.MOTION */);
412
417
  }
413
418
  // this method is overwritten by the `DoorbellController` to automatically configure EventTriggerOption.DOORBELL
414
419
  return triggerOptions;
415
- };
420
+ }
416
421
  /**
417
422
  * @private
418
423
  */
419
- CameraController.prototype.configureServices = function () {
420
- var _this = this;
421
- var _a, _b;
424
+ configureServices() {
422
425
  if (this.microphoneService) {
423
426
  this.microphoneService.getCharacteristic(Characteristic_1.Characteristic.Mute)
424
- .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
425
- callback(undefined, _this.microphoneMuted);
427
+ .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
428
+ callback(undefined, this.microphoneMuted);
426
429
  })
427
- .on("set" /* CharacteristicEventTypes.SET */, function (value, callback) {
428
- _this.microphoneMuted = value;
430
+ .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
431
+ this.microphoneMuted = value;
429
432
  callback();
430
- _this.emitMicrophoneChange();
433
+ this.emitMicrophoneChange();
431
434
  });
432
435
  this.microphoneService.getCharacteristic(Characteristic_1.Characteristic.Volume)
433
- .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
434
- callback(undefined, _this.microphoneVolume);
436
+ .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
437
+ callback(undefined, this.microphoneVolume);
435
438
  })
436
- .on("set" /* CharacteristicEventTypes.SET */, function (value, callback) {
437
- _this.microphoneVolume = value;
439
+ .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
440
+ this.microphoneVolume = value;
438
441
  callback();
439
- _this.emitMicrophoneChange();
442
+ this.emitMicrophoneChange();
440
443
  });
441
444
  }
442
445
  if (this.speakerService) {
443
446
  this.speakerService.getCharacteristic(Characteristic_1.Characteristic.Mute)
444
- .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
445
- callback(undefined, _this.speakerMuted);
447
+ .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
448
+ callback(undefined, this.speakerMuted);
446
449
  })
447
- .on("set" /* CharacteristicEventTypes.SET */, function (value, callback) {
448
- _this.speakerMuted = value;
450
+ .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
451
+ this.speakerMuted = value;
449
452
  callback();
450
- _this.emitSpeakerChange();
453
+ this.emitSpeakerChange();
451
454
  });
452
455
  this.speakerService.getCharacteristic(Characteristic_1.Characteristic.Volume)
453
- .on("get" /* CharacteristicEventTypes.GET */, function (callback) {
454
- callback(undefined, _this.speakerVolume);
456
+ .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
457
+ callback(undefined, this.speakerVolume);
455
458
  })
456
- .on("set" /* CharacteristicEventTypes.SET */, function (value, callback) {
457
- _this.speakerVolume = value;
459
+ .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
460
+ this.speakerVolume = value;
458
461
  callback();
459
- _this.emitSpeakerChange();
462
+ this.emitSpeakerChange();
460
463
  });
461
464
  }
462
465
  // make the sensor services available to the RecordingManagement.
463
466
  if (this.motionService) {
464
- (_a = this.recordingManagement) === null || _a === void 0 ? void 0 : _a.sensorServices.push(this.motionService);
467
+ this.recordingManagement?.sensorServices.push(this.motionService);
465
468
  }
466
469
  if (this.occupancyService) {
467
- (_b = this.recordingManagement) === null || _b === void 0 ? void 0 : _b.sensorServices.push(this.occupancyService);
470
+ this.recordingManagement?.sensorServices.push(this.occupancyService);
468
471
  }
469
- };
470
- CameraController.prototype.rtpStreamManagementDisabledThroughOperatingMode = function () {
472
+ }
473
+ rtpStreamManagementDisabledThroughOperatingMode() {
471
474
  return this.recordingManagement
472
475
  ? !this.recordingManagement.operatingModeService.getCharacteristic(Characteristic_1.Characteristic.HomeKitCameraActive).value
473
476
  : false;
474
- };
477
+ }
475
478
  /**
476
479
  * @private
477
480
  */
478
- CameraController.prototype.handleControllerRemoved = function () {
479
- var e_2, _a;
480
- var _b;
481
+ handleControllerRemoved() {
481
482
  this.handleFactoryReset();
482
- try {
483
- for (var _c = tslib_1.__values(this.streamManagements), _d = _c.next(); !_d.done; _d = _c.next()) {
484
- var management = _d.value;
485
- management.destroy();
486
- }
487
- }
488
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
489
- finally {
490
- try {
491
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
492
- }
493
- finally { if (e_2) throw e_2.error; }
483
+ for (const management of this.streamManagements) {
484
+ management.destroy();
494
485
  }
495
486
  this.streamManagements.splice(0, this.streamManagements.length);
496
487
  this.microphoneService = undefined;
497
488
  this.speakerService = undefined;
498
- (_b = this.recordingManagement) === null || _b === void 0 ? void 0 : _b.destroy();
489
+ this.recordingManagement?.destroy();
499
490
  this.recordingManagement = undefined;
500
491
  this.removeAllListeners();
501
- };
492
+ }
502
493
  /**
503
494
  * @private
504
495
  */
505
- CameraController.prototype.handleFactoryReset = function () {
506
- var _a;
507
- this.streamManagements.forEach(function (management) { return management.handleFactoryReset(); });
508
- (_a = this.recordingManagement) === null || _a === void 0 ? void 0 : _a.handleFactoryReset();
496
+ handleFactoryReset() {
497
+ this.streamManagements.forEach(management => management.handleFactoryReset());
498
+ this.recordingManagement?.handleFactoryReset();
509
499
  this.microphoneMuted = false;
510
500
  this.microphoneVolume = 100;
511
501
  this.speakerMuted = false;
512
502
  this.speakerVolume = 100;
513
- };
503
+ }
514
504
  /**
515
505
  * @private
516
506
  */
517
- CameraController.prototype.serialize = function () {
518
- var e_3, _a;
519
- var _b;
520
- var streamManagementStates = [];
521
- try {
522
- for (var _c = tslib_1.__values(this.streamManagements), _d = _c.next(); !_d.done; _d = _c.next()) {
523
- var management = _d.value;
524
- var serializedState = management.serialize();
525
- if (serializedState) {
526
- streamManagementStates.push(serializedState);
527
- }
507
+ serialize() {
508
+ const streamManagementStates = [];
509
+ for (const management of this.streamManagements) {
510
+ const serializedState = management.serialize();
511
+ if (serializedState) {
512
+ streamManagementStates.push(serializedState);
528
513
  }
529
514
  }
530
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
531
- finally {
532
- try {
533
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
534
- }
535
- finally { if (e_3) throw e_3.error; }
536
- }
537
515
  return {
538
516
  streamManagements: streamManagementStates,
539
- recordingManagement: (_b = this.recordingManagement) === null || _b === void 0 ? void 0 : _b.serialize(),
517
+ recordingManagement: this.recordingManagement?.serialize(),
540
518
  };
541
- };
519
+ }
542
520
  /**
543
521
  * @private
544
522
  */
545
- CameraController.prototype.deserialize = function (serialized) {
546
- var e_4, _a, e_5, _b;
547
- var _c;
548
- try {
549
- for (var _d = tslib_1.__values(serialized.streamManagements), _e = _d.next(); !_e.done; _e = _d.next()) {
550
- var streamManagementState = _e.value;
551
- var streamManagement = this.streamManagements[streamManagementState.id];
552
- if (streamManagement) {
553
- streamManagement.deserialize(streamManagementState);
554
- }
555
- }
556
- }
557
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
558
- finally {
559
- try {
560
- if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
523
+ deserialize(serialized) {
524
+ for (const streamManagementState of serialized.streamManagements) {
525
+ const streamManagement = this.streamManagements[streamManagementState.id];
526
+ if (streamManagement) {
527
+ streamManagement.deserialize(streamManagementState);
561
528
  }
562
- finally { if (e_4) throw e_4.error; }
563
529
  }
564
530
  if (serialized.recordingManagement) {
565
531
  if (this.recordingManagement) {
566
532
  this.recordingManagement.deserialize(serialized.recordingManagement);
567
533
  }
568
534
  else {
569
- try {
570
- // Active characteristic cannot be controlled if removing HSV, ensure they are all active!
571
- for (var _f = tslib_1.__values(this.streamManagements), _g = _f.next(); !_g.done; _g = _f.next()) {
572
- var streamManagement = _g.value;
573
- streamManagement.service.updateCharacteristic(Characteristic_1.Characteristic.Active, true);
574
- }
575
- }
576
- catch (e_5_1) { e_5 = { error: e_5_1 }; }
577
- finally {
578
- try {
579
- if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
580
- }
581
- finally { if (e_5) throw e_5.error; }
535
+ // Active characteristic cannot be controlled if removing HSV, ensure they are all active!
536
+ for (const streamManagement of this.streamManagements) {
537
+ streamManagement.service.updateCharacteristic(Characteristic_1.Characteristic.Active, true);
582
538
  }
583
- (_c = this.stateChangeDelegate) === null || _c === void 0 ? void 0 : _c.call(this);
539
+ this.stateChangeDelegate?.();
584
540
  }
585
541
  }
586
- };
542
+ }
587
543
  /**
588
544
  * @private
589
545
  */
590
- CameraController.prototype.setupStateChangeDelegate = function (delegate) {
591
- var e_6, _a;
592
- var _b;
546
+ setupStateChangeDelegate(delegate) {
593
547
  this.stateChangeDelegate = delegate;
594
- try {
595
- for (var _c = tslib_1.__values(this.streamManagements), _d = _c.next(); !_d.done; _d = _c.next()) {
596
- var streamManagement = _d.value;
597
- streamManagement.setupStateChangeDelegate(delegate);
598
- }
599
- }
600
- catch (e_6_1) { e_6 = { error: e_6_1 }; }
601
- finally {
602
- try {
603
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
604
- }
605
- finally { if (e_6) throw e_6.error; }
548
+ for (const streamManagement of this.streamManagements) {
549
+ streamManagement.setupStateChangeDelegate(delegate);
606
550
  }
607
- (_b = this.recordingManagement) === null || _b === void 0 ? void 0 : _b.setupStateChangeDelegate(delegate);
608
- };
551
+ this.recordingManagement?.setupStateChangeDelegate(delegate);
552
+ }
609
553
  /**
610
554
  * @private
611
555
  */
612
- CameraController.prototype.handleSnapshotRequest = function (height, width, accessoryName, reason) {
613
- var _this = this;
556
+ handleSnapshotRequest(height, width, accessoryName, reason) {
614
557
  // first step is to verify that the reason is applicable to our current policy
615
- var streamingDisabled = this.streamManagements
616
- .map(function (management) { return !management.getService().getCharacteristic(Characteristic_1.Characteristic.Active).value; })
617
- .reduce(function (previousValue, currentValue) { return previousValue && currentValue; });
558
+ const streamingDisabled = this.streamManagements
559
+ .map(management => !management.getService().getCharacteristic(Characteristic_1.Characteristic.Active).value)
560
+ .reduce((previousValue, currentValue) => previousValue && currentValue);
618
561
  if (streamingDisabled) {
619
562
  debug("[%s] Rejecting snapshot as streaming is disabled.", accessoryName);
620
563
  return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
621
564
  }
622
565
  if (this.recordingManagement) {
623
- var operatingModeService = this.recordingManagement.operatingModeService;
566
+ const operatingModeService = this.recordingManagement.operatingModeService;
624
567
  if (!operatingModeService.getCharacteristic(Characteristic_1.Characteristic.HomeKitCameraActive).value) {
625
568
  debug("[%s] Rejecting snapshot as HomeKit camera is disabled.", accessoryName);
626
569
  return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
627
570
  }
628
- var eventSnapshotsActive = operatingModeService
571
+ const eventSnapshotsActive = operatingModeService
629
572
  .getCharacteristic(Characteristic_1.Characteristic.EventSnapshotsActive)
630
573
  .value;
631
574
  if (!eventSnapshotsActive) {
@@ -638,7 +581,7 @@ var CameraController = /** @class */ (function (_super) {
638
581
  return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
639
582
  }
640
583
  }
641
- var periodicSnapshotsActive = operatingModeService
584
+ const periodicSnapshotsActive = operatingModeService
642
585
  .getCharacteristic(Characteristic_1.Characteristic.PeriodicSnapshotsActive)
643
586
  .value;
644
587
  if (!periodicSnapshotsActive) {
@@ -653,24 +596,24 @@ var CameraController = /** @class */ (function (_super) {
653
596
  }
654
597
  }
655
598
  // now do the actual snapshot request.
656
- return new Promise(function (resolve, reject) {
599
+ return new Promise((resolve, reject) => {
657
600
  // TODO test and make timeouts configurable!
658
- var timeout = setTimeout(function () {
659
- console.warn("[".concat(accessoryName, "] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info."));
660
- timeout = setTimeout(function () {
601
+ let timeout = setTimeout(() => {
602
+ console.warn(`[${accessoryName}] The image snapshot handler for the given accessory is slow to respond! See https://homebridge.io/w/JtMGR for more info.`);
603
+ timeout = setTimeout(() => {
661
604
  timeout = undefined;
662
- console.warn("[".concat(accessoryName, "] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info."));
605
+ console.warn(`[${accessoryName}] The image snapshot handler for the given accessory didn't respond at all! See https://homebridge.io/w/JtMGR for more info.`);
663
606
  reject(-70408 /* HAPStatus.OPERATION_TIMED_OUT */);
664
607
  }, 17000);
665
608
  timeout.unref();
666
- }, 5000);
609
+ }, 8000);
667
610
  timeout.unref();
668
611
  try {
669
- _this.delegate.handleSnapshotRequest({
612
+ this.delegate.handleSnapshotRequest({
670
613
  height: height,
671
614
  width: width,
672
615
  reason: reason,
673
- }, function (error, buffer) {
616
+ }, (error, buffer) => {
674
617
  if (!timeout) {
675
618
  return;
676
619
  }
@@ -689,7 +632,7 @@ var CameraController = /** @class */ (function (_super) {
689
632
  return;
690
633
  }
691
634
  if (!buffer || buffer.length === 0) {
692
- console.warn("[".concat(accessoryName, "] Snapshot request handler provided empty image buffer!"));
635
+ console.warn(`[${accessoryName}] Snapshot request handler provided empty image buffer!`);
693
636
  reject(-70402 /* HAPStatus.SERVICE_COMMUNICATION_FAILURE */);
694
637
  }
695
638
  else {
@@ -705,21 +648,11 @@ var CameraController = /** @class */ (function (_super) {
705
648
  clearTimeout(timeout);
706
649
  timeout = undefined;
707
650
  }
708
- console.warn("[".concat(accessoryName, "] Unhandled error thrown inside snapshot request handler: ").concat(error.stack));
651
+ console.warn(`[${accessoryName}] Unhandled error thrown inside snapshot request handler: ${error.stack}`);
709
652
  reject(error instanceof hapStatusError_1.HapStatusError ? error.hapStatus : -70402 /* HAPStatus.SERVICE_COMMUNICATION_FAILURE */);
710
653
  }
711
654
  });
712
- };
713
- /**
714
- * @private
715
- */
716
- CameraController.prototype.handleCloseConnection = function (sessionID) {
717
- if (this.delegate instanceof camera_1.LegacyCameraSourceAdapter) {
718
- this.delegate.forwardCloseConnection(sessionID);
719
- }
720
- };
721
- CameraController.STREAM_MANAGEMENT = "streamManagement"; // key to index all RTPStreamManagement services
722
- return CameraController;
723
- }(events_1.EventEmitter));
655
+ }
656
+ }
724
657
  exports.CameraController = CameraController;
725
658
  //# sourceMappingURL=CameraController.js.map