matter-all-in-one-addon 2.3.1 → 2.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (457) hide show
  1. package/README.md +16 -8
  2. package/dist/camera/ai/camera-ai-detector.d.ts +0 -2
  3. package/dist/camera/ai/camera-ai-detector.js +52 -57
  4. package/dist/camera/ai/camera-ai-detector.js.map +1 -1
  5. package/dist/camera/browser-preview.d.ts +9 -0
  6. package/dist/camera/browser-preview.js +135 -0
  7. package/dist/camera/browser-preview.js.map +1 -0
  8. package/dist/camera/camera-source-resolver.js +5 -3
  9. package/dist/camera/camera-source-resolver.js.map +1 -1
  10. package/dist/camera/camera-types.d.ts +0 -2
  11. package/dist/camera/cameraui/cameraui-client.js +91 -30
  12. package/dist/camera/cameraui/cameraui-client.js.map +1 -1
  13. package/dist/camera/cameraui/cameraui-homekit-bridge.js +13 -4
  14. package/dist/camera/cameraui/cameraui-homekit-bridge.js.map +1 -1
  15. package/dist/camera/cameraui/cameraui-storage.js.map +1 -1
  16. package/dist/camera/cameraui/cameraui-types.d.ts +6 -2
  17. package/dist/camera/cameraui/ha-camera-entity.js +5 -2
  18. package/dist/camera/cameraui/ha-camera-entity.js.map +1 -1
  19. package/dist/camera/homekit/ffmpeg-helper.js +17 -35
  20. package/dist/camera/homekit/ffmpeg-helper.js.map +1 -1
  21. package/dist/camera/homekit/hevc/fmp4-hevc.js +3 -1
  22. package/dist/camera/homekit/hevc/fmp4-hevc.js.map +1 -1
  23. package/dist/camera/homekit/hevc/hevc-recording.d.ts +0 -2
  24. package/dist/camera/homekit/hevc/hevc-recording.js +28 -63
  25. package/dist/camera/homekit/hevc/hevc-recording.js.map +1 -1
  26. package/dist/camera/homekit/hevc/multi-tier-rtp.d.ts +1 -15
  27. package/dist/camera/homekit/hevc/multi-tier-rtp.js +70 -228
  28. package/dist/camera/homekit/hevc/multi-tier-rtp.js.map +1 -1
  29. package/dist/camera/homekit/hevc/sframe-rtp.d.ts +0 -2
  30. package/dist/camera/homekit/hevc/sframe-rtp.js +0 -25
  31. package/dist/camera/homekit/hevc/sframe-rtp.js.map +1 -1
  32. package/dist/camera/homekit/hevc/sframe.d.ts +1 -11
  33. package/dist/camera/homekit/hevc/sframe.js +18 -133
  34. package/dist/camera/homekit/hevc/sframe.js.map +1 -1
  35. package/dist/camera/homekit/hevc/types.js +81 -9
  36. package/dist/camera/homekit/hevc/types.js.map +1 -1
  37. package/dist/camera/homekit/hevc/webrtc-session.d.ts +3 -17
  38. package/dist/camera/homekit/hevc/webrtc-session.js +55 -229
  39. package/dist/camera/homekit/hevc/webrtc-session.js.map +1 -1
  40. package/dist/camera/homekit/homekit-camera-recording.delegate.d.ts +0 -1
  41. package/dist/camera/homekit/homekit-camera-recording.delegate.js +115 -43
  42. package/dist/camera/homekit/homekit-camera-recording.delegate.js.map +1 -1
  43. package/dist/camera/homekit/homekit-camera-stream.delegate.d.ts +4 -7
  44. package/dist/camera/homekit/homekit-camera-stream.delegate.js +388 -201
  45. package/dist/camera/homekit/homekit-camera-stream.delegate.js.map +1 -1
  46. package/dist/camera/homekit/homekit-camera.accessory.d.ts +7 -34
  47. package/dist/camera/homekit/homekit-camera.accessory.js +207 -169
  48. package/dist/camera/homekit/homekit-camera.accessory.js.map +1 -1
  49. package/dist/camera/homekit/live-view-telemetry.d.ts +0 -4
  50. package/dist/camera/homekit/live-view-telemetry.js.map +1 -1
  51. package/dist/camera/homekit/tuya-hap-talkback.d.ts +41 -0
  52. package/dist/camera/homekit/tuya-hap-talkback.js +326 -0
  53. package/dist/camera/homekit/tuya-hap-talkback.js.map +1 -0
  54. package/dist/camera/matter/camera-endpoint.builder.js +9 -7
  55. package/dist/camera/matter/camera-endpoint.builder.js.map +1 -1
  56. package/dist/camera/matter/camera-session-manager.d.ts +1 -0
  57. package/dist/camera/matter/camera-session-manager.js +2 -0
  58. package/dist/camera/matter/camera-session-manager.js.map +1 -1
  59. package/dist/camera/matter/camera-webrtc-adapter.js +32 -15
  60. package/dist/camera/matter/camera-webrtc-adapter.js.map +1 -1
  61. package/dist/camera/motion/ffmpeg-motion-detector.js +28 -14
  62. package/dist/camera/motion/ffmpeg-motion-detector.js.map +1 -1
  63. package/dist/camera/nest/nest-camera-adapter.js +9 -5
  64. package/dist/camera/nest/nest-camera-adapter.js.map +1 -1
  65. package/dist/camera/ptz/ptz-capabilities.js +3 -1
  66. package/dist/camera/ptz/ptz-capabilities.js.map +1 -1
  67. package/dist/camera/ptz/ptz-legacy-discovery.js.map +1 -1
  68. package/dist/camera/ptz/ptz-mqtt-publisher.js +50 -12
  69. package/dist/camera/ptz/ptz-mqtt-publisher.js.map +1 -1
  70. package/dist/camera/ptz/ptz-zones-manager.js +6 -1
  71. package/dist/camera/ptz/ptz-zones-manager.js.map +1 -1
  72. package/dist/camera/scrypted/scrypted-camera-card.js +3 -1
  73. package/dist/camera/scrypted/scrypted-camera-card.js.map +1 -1
  74. package/dist/camera/scrypted/scrypted-camera-discovery-adapter.js +7 -5
  75. package/dist/camera/scrypted/scrypted-camera-discovery-adapter.js.map +1 -1
  76. package/dist/camera/scrypted/scrypted-client-discovery-adapter.js.map +1 -1
  77. package/dist/camera/scrypted/scrypted-client.js +6 -5
  78. package/dist/camera/scrypted/scrypted-client.js.map +1 -1
  79. package/dist/camera/scrypted/scrypted-discovery-provider.js.map +1 -1
  80. package/dist/camera/scrypted/scrypted-homekit-bridge.js +6 -4
  81. package/dist/camera/scrypted/scrypted-homekit-bridge.js.map +1 -1
  82. package/dist/camera/scrypted/scrypted-reconnect-manager.js.map +1 -1
  83. package/dist/camera/scrypted/scrypted-runtime-facade.js +2 -2
  84. package/dist/camera/scrypted/scrypted-runtime-facade.js.map +1 -1
  85. package/dist/camera/scrypted/scrypted-runtime-ingest.js +3 -1
  86. package/dist/camera/scrypted/scrypted-runtime-ingest.js.map +1 -1
  87. package/dist/camera/scrypted/scrypted-storage.js +12 -6
  88. package/dist/camera/scrypted/scrypted-storage.js.map +1 -1
  89. package/dist/camera/scrypted/scrypted-stream-validator.js +25 -7
  90. package/dist/camera/scrypted/scrypted-stream-validator.js.map +1 -1
  91. package/dist/camera/tuya-webrtc-session.d.ts +53 -0
  92. package/dist/camera/tuya-webrtc-session.js +261 -0
  93. package/dist/camera/tuya-webrtc-session.js.map +1 -0
  94. package/dist/converters/sensor.converter.js +4 -1
  95. package/dist/converters/sensor.converter.js.map +1 -1
  96. package/dist/device-profiles.js +3 -1
  97. package/dist/device-profiles.js.map +1 -1
  98. package/dist/entities/air_quality.entity.js +3 -1
  99. package/dist/entities/air_quality.entity.js.map +1 -1
  100. package/dist/entities/base.entity.js +45 -17
  101. package/dist/entities/base.entity.js.map +1 -1
  102. package/dist/entities/camera.entity.d.ts +1 -0
  103. package/dist/entities/camera.entity.js +24 -2
  104. package/dist/entities/camera.entity.js.map +1 -1
  105. package/dist/entities/composite-device.entity.js +37 -13
  106. package/dist/entities/composite-device.entity.js.map +1 -1
  107. package/dist/entities/energy_tariff.entity.js.map +1 -1
  108. package/dist/entities/pet_feeder.entity.d.ts +1 -0
  109. package/dist/entities/pet_feeder.entity.js +12 -0
  110. package/dist/entities/pet_feeder.entity.js.map +1 -1
  111. package/dist/entities/vacuum.entity.js +16 -5
  112. package/dist/entities/vacuum.entity.js.map +1 -1
  113. package/dist/frontend/assets/index-1k-iTL-m.js +26 -0
  114. package/dist/frontend/assets/{index-NrzHqycm.css → index-CJdlkpIy.css} +1 -1
  115. package/dist/frontend/index.html +2 -2
  116. package/dist/hap/hap-generic-accessory.d.ts +4 -0
  117. package/dist/hap/hap-generic-accessory.js +512 -122
  118. package/dist/hap/hap-generic-accessory.js.map +1 -1
  119. package/dist/homeAssistant.d.ts +1 -0
  120. package/dist/homeAssistant.js +23 -5
  121. package/dist/homeAssistant.js.map +1 -1
  122. package/dist/index.js +3 -1
  123. package/dist/index.js.map +1 -1
  124. package/dist/mqtt/mqtt-client.js.map +1 -1
  125. package/dist/mqtt/mqtt.entity.js +41 -17
  126. package/dist/mqtt/mqtt.entity.js.map +1 -1
  127. package/dist/platform.d.ts +1 -0
  128. package/dist/platform.js +83 -13
  129. package/dist/platform.js.map +1 -1
  130. package/dist/utils/atomic-json-store.js +5 -1
  131. package/dist/utils/atomic-json-store.js.map +1 -1
  132. package/dist/utils/ha-state.js +3 -1
  133. package/dist/utils/ha-state.js.map +1 -1
  134. package/dist/utils/light-color.js +3 -5
  135. package/dist/utils/light-color.js.map +1 -1
  136. package/dist/utils/matter-command-response.js.map +1 -1
  137. package/dist/utils/matter-firmware.js +1 -2
  138. package/dist/utils/matter-firmware.js.map +1 -1
  139. package/dist/utils/matter-protocol.d.ts +1 -0
  140. package/dist/utils/matter-protocol.js +30 -0
  141. package/dist/utils/matter-protocol.js.map +1 -0
  142. package/package.json +27 -19
  143. package/dist/camera/camera-entity-control.d.ts +0 -12
  144. package/dist/camera/camera-entity-control.js +0 -24
  145. package/dist/camera/camera-entity-control.js.map +0 -1
  146. package/dist/camera/homekit/hevc/bootstrap.d.ts +0 -9
  147. package/dist/camera/homekit/hevc/bootstrap.js +0 -47
  148. package/dist/camera/homekit/hevc/bootstrap.js.map +0 -1
  149. package/dist/camera/homekit/hevc/recording-output.d.ts +0 -2
  150. package/dist/camera/homekit/hevc/recording-output.js +0 -33
  151. package/dist/camera/homekit/hevc/recording-output.js.map +0 -1
  152. package/dist/camera/homekit/media-policy.d.ts +0 -25
  153. package/dist/camera/homekit/media-policy.js +0 -102
  154. package/dist/camera/homekit/media-policy.js.map +0 -1
  155. package/dist/camera/homekit/route-address.d.ts +0 -2
  156. package/dist/camera/homekit/route-address.js +0 -27
  157. package/dist/camera/homekit/route-address.js.map +0 -1
  158. package/dist/camera/homekit/rtp-relay.d.ts +0 -21
  159. package/dist/camera/homekit/rtp-relay.js +0 -112
  160. package/dist/camera/homekit/rtp-relay.js.map +0 -1
  161. package/dist/camera/homekit/startup-timing.d.ts +0 -8
  162. package/dist/camera/homekit/startup-timing.js +0 -14
  163. package/dist/camera/homekit/startup-timing.js.map +0 -1
  164. package/dist/camera/source-adapter.d.ts +0 -132
  165. package/dist/camera/source-adapter.js +0 -282
  166. package/dist/camera/source-adapter.js.map +0 -1
  167. package/dist/frontend/assets/index-Bka3TVAQ.js +0 -21
  168. package/vendor/hap-nodejs/LICENSE +0 -176
  169. package/vendor/hap-nodejs/MIAO.md +0 -5
  170. package/vendor/hap-nodejs/PATCH.md +0 -37
  171. package/vendor/hap-nodejs/README.md +0 -86
  172. package/vendor/hap-nodejs/dist/accessories/AirConditioner_accessory.d.ts +0 -2
  173. package/vendor/hap-nodejs/dist/accessories/AirConditioner_accessory.d.ts.map +0 -1
  174. package/vendor/hap-nodejs/dist/accessories/AirConditioner_accessory.js +0 -128
  175. package/vendor/hap-nodejs/dist/accessories/AirConditioner_accessory.js.map +0 -1
  176. package/vendor/hap-nodejs/dist/accessories/AppleTVRemote_accessory.d.ts +0 -2
  177. package/vendor/hap-nodejs/dist/accessories/AppleTVRemote_accessory.d.ts.map +0 -1
  178. package/vendor/hap-nodejs/dist/accessories/AppleTVRemote_accessory.js +0 -159
  179. package/vendor/hap-nodejs/dist/accessories/AppleTVRemote_accessory.js.map +0 -1
  180. package/vendor/hap-nodejs/dist/accessories/Camera_accessory.d.ts +0 -2
  181. package/vendor/hap-nodejs/dist/accessories/Camera_accessory.d.ts.map +0 -1
  182. package/vendor/hap-nodejs/dist/accessories/Camera_accessory.js +0 -545
  183. package/vendor/hap-nodejs/dist/accessories/Camera_accessory.js.map +0 -1
  184. package/vendor/hap-nodejs/dist/accessories/Fan_accessory.d.ts +0 -2
  185. package/vendor/hap-nodejs/dist/accessories/Fan_accessory.d.ts.map +0 -1
  186. package/vendor/hap-nodejs/dist/accessories/Fan_accessory.js +0 -74
  187. package/vendor/hap-nodejs/dist/accessories/Fan_accessory.js.map +0 -1
  188. package/vendor/hap-nodejs/dist/accessories/GarageDoorOpener_accessory.d.ts +0 -2
  189. package/vendor/hap-nodejs/dist/accessories/GarageDoorOpener_accessory.d.ts.map +0 -1
  190. package/vendor/hap-nodejs/dist/accessories/GarageDoorOpener_accessory.js +0 -78
  191. package/vendor/hap-nodejs/dist/accessories/GarageDoorOpener_accessory.js.map +0 -1
  192. package/vendor/hap-nodejs/dist/accessories/Light-AdaptiveLighting_accessory.d.ts +0 -2
  193. package/vendor/hap-nodejs/dist/accessories/Light-AdaptiveLighting_accessory.d.ts.map +0 -1
  194. package/vendor/hap-nodejs/dist/accessories/Light-AdaptiveLighting_accessory.js +0 -106
  195. package/vendor/hap-nodejs/dist/accessories/Light-AdaptiveLighting_accessory.js.map +0 -1
  196. package/vendor/hap-nodejs/dist/accessories/Light_accessory.d.ts +0 -2
  197. package/vendor/hap-nodejs/dist/accessories/Light_accessory.d.ts.map +0 -1
  198. package/vendor/hap-nodejs/dist/accessories/Light_accessory.js +0 -145
  199. package/vendor/hap-nodejs/dist/accessories/Light_accessory.js.map +0 -1
  200. package/vendor/hap-nodejs/dist/accessories/Lock_accessory.d.ts +0 -2
  201. package/vendor/hap-nodejs/dist/accessories/Lock_accessory.d.ts.map +0 -1
  202. package/vendor/hap-nodejs/dist/accessories/Lock_accessory.js +0 -76
  203. package/vendor/hap-nodejs/dist/accessories/Lock_accessory.js.map +0 -1
  204. package/vendor/hap-nodejs/dist/accessories/MotionSensor_accessory.d.ts +0 -2
  205. package/vendor/hap-nodejs/dist/accessories/MotionSensor_accessory.d.ts.map +0 -1
  206. package/vendor/hap-nodejs/dist/accessories/MotionSensor_accessory.js +0 -45
  207. package/vendor/hap-nodejs/dist/accessories/MotionSensor_accessory.js.map +0 -1
  208. package/vendor/hap-nodejs/dist/accessories/Outlet_accessory.d.ts +0 -2
  209. package/vendor/hap-nodejs/dist/accessories/Outlet_accessory.d.ts.map +0 -1
  210. package/vendor/hap-nodejs/dist/accessories/Outlet_accessory.js +0 -79
  211. package/vendor/hap-nodejs/dist/accessories/Outlet_accessory.js.map +0 -1
  212. package/vendor/hap-nodejs/dist/accessories/SmartSpeaker_accessory.d.ts +0 -2
  213. package/vendor/hap-nodejs/dist/accessories/SmartSpeaker_accessory.d.ts.map +0 -1
  214. package/vendor/hap-nodejs/dist/accessories/SmartSpeaker_accessory.js +0 -44
  215. package/vendor/hap-nodejs/dist/accessories/SmartSpeaker_accessory.js.map +0 -1
  216. package/vendor/hap-nodejs/dist/accessories/Sprinkler_accessory.d.ts +0 -2
  217. package/vendor/hap-nodejs/dist/accessories/Sprinkler_accessory.d.ts.map +0 -1
  218. package/vendor/hap-nodejs/dist/accessories/Sprinkler_accessory.js +0 -128
  219. package/vendor/hap-nodejs/dist/accessories/Sprinkler_accessory.js.map +0 -1
  220. package/vendor/hap-nodejs/dist/accessories/TV_accessory.d.ts +0 -2
  221. package/vendor/hap-nodejs/dist/accessories/TV_accessory.d.ts.map +0 -1
  222. package/vendor/hap-nodejs/dist/accessories/TV_accessory.js +0 -101
  223. package/vendor/hap-nodejs/dist/accessories/TV_accessory.js.map +0 -1
  224. package/vendor/hap-nodejs/dist/accessories/TemperatureSensor_accessory.d.ts +0 -2
  225. package/vendor/hap-nodejs/dist/accessories/TemperatureSensor_accessory.d.ts.map +0 -1
  226. package/vendor/hap-nodejs/dist/accessories/TemperatureSensor_accessory.js +0 -44
  227. package/vendor/hap-nodejs/dist/accessories/TemperatureSensor_accessory.js.map +0 -1
  228. package/vendor/hap-nodejs/dist/accessories/Wi-FiRouter_accessory.d.ts +0 -3
  229. package/vendor/hap-nodejs/dist/accessories/Wi-FiRouter_accessory.d.ts.map +0 -1
  230. package/vendor/hap-nodejs/dist/accessories/Wi-FiRouter_accessory.js +0 -17
  231. package/vendor/hap-nodejs/dist/accessories/Wi-FiRouter_accessory.js.map +0 -1
  232. package/vendor/hap-nodejs/dist/accessories/Wi-FiSatellite_accessory.d.ts +0 -3
  233. package/vendor/hap-nodejs/dist/accessories/Wi-FiSatellite_accessory.d.ts.map +0 -1
  234. package/vendor/hap-nodejs/dist/accessories/Wi-FiSatellite_accessory.js +0 -19
  235. package/vendor/hap-nodejs/dist/accessories/Wi-FiSatellite_accessory.js.map +0 -1
  236. package/vendor/hap-nodejs/dist/accessories/gstreamer-audioProducer.d.ts +0 -25
  237. package/vendor/hap-nodejs/dist/accessories/gstreamer-audioProducer.d.ts.map +0 -1
  238. package/vendor/hap-nodejs/dist/accessories/gstreamer-audioProducer.js +0 -145
  239. package/vendor/hap-nodejs/dist/accessories/gstreamer-audioProducer.js.map +0 -1
  240. package/vendor/hap-nodejs/dist/accessories/types.d.ts +0 -78
  241. package/vendor/hap-nodejs/dist/accessories/types.d.ts.map +0 -1
  242. package/vendor/hap-nodejs/dist/accessories/types.js +0 -88
  243. package/vendor/hap-nodejs/dist/accessories/types.js.map +0 -1
  244. package/vendor/hap-nodejs/dist/index.d.ts +0 -50
  245. package/vendor/hap-nodejs/dist/index.d.ts.map +0 -1
  246. package/vendor/hap-nodejs/dist/index.js +0 -54
  247. package/vendor/hap-nodejs/dist/index.js.map +0 -1
  248. package/vendor/hap-nodejs/dist/internal-types.d.ts +0 -76
  249. package/vendor/hap-nodejs/dist/internal-types.d.ts.map +0 -1
  250. package/vendor/hap-nodejs/dist/internal-types.js +0 -80
  251. package/vendor/hap-nodejs/dist/internal-types.js.map +0 -1
  252. package/vendor/hap-nodejs/dist/lib/Accessory.d.ts +0 -521
  253. package/vendor/hap-nodejs/dist/lib/Accessory.d.ts.map +0 -1
  254. package/vendor/hap-nodejs/dist/lib/Accessory.js +0 -1762
  255. package/vendor/hap-nodejs/dist/lib/Accessory.js.map +0 -1
  256. package/vendor/hap-nodejs/dist/lib/Advertiser.d.ts +0 -190
  257. package/vendor/hap-nodejs/dist/lib/Advertiser.d.ts.map +0 -1
  258. package/vendor/hap-nodejs/dist/lib/Advertiser.js +0 -592
  259. package/vendor/hap-nodejs/dist/lib/Advertiser.js.map +0 -1
  260. package/vendor/hap-nodejs/dist/lib/Bridge.d.ts +0 -12
  261. package/vendor/hap-nodejs/dist/lib/Bridge.d.ts.map +0 -1
  262. package/vendor/hap-nodejs/dist/lib/Bridge.js +0 -19
  263. package/vendor/hap-nodejs/dist/lib/Bridge.js.map +0 -1
  264. package/vendor/hap-nodejs/dist/lib/Characteristic.d.ts +0 -1768
  265. package/vendor/hap-nodejs/dist/lib/Characteristic.d.ts.map +0 -1
  266. package/vendor/hap-nodejs/dist/lib/Characteristic.js +0 -2532
  267. package/vendor/hap-nodejs/dist/lib/Characteristic.js.map +0 -1
  268. package/vendor/hap-nodejs/dist/lib/HAPServer.d.ts +0 -299
  269. package/vendor/hap-nodejs/dist/lib/HAPServer.d.ts.map +0 -1
  270. package/vendor/hap-nodejs/dist/lib/HAPServer.js +0 -968
  271. package/vendor/hap-nodejs/dist/lib/HAPServer.js.map +0 -1
  272. package/vendor/hap-nodejs/dist/lib/Service.d.ts +0 -598
  273. package/vendor/hap-nodejs/dist/lib/Service.d.ts.map +0 -1
  274. package/vendor/hap-nodejs/dist/lib/Service.js +0 -797
  275. package/vendor/hap-nodejs/dist/lib/Service.js.map +0 -1
  276. package/vendor/hap-nodejs/dist/lib/camera/CMAFIngest.d.ts +0 -102
  277. package/vendor/hap-nodejs/dist/lib/camera/CMAFIngest.d.ts.map +0 -1
  278. package/vendor/hap-nodejs/dist/lib/camera/CMAFIngest.js +0 -317
  279. package/vendor/hap-nodejs/dist/lib/camera/CMAFIngest.js.map +0 -1
  280. package/vendor/hap-nodejs/dist/lib/camera/HDSSnapshotTransport.d.ts +0 -38
  281. package/vendor/hap-nodejs/dist/lib/camera/HDSSnapshotTransport.d.ts.map +0 -1
  282. package/vendor/hap-nodejs/dist/lib/camera/HDSSnapshotTransport.js +0 -174
  283. package/vendor/hap-nodejs/dist/lib/camera/HDSSnapshotTransport.js.map +0 -1
  284. package/vendor/hap-nodejs/dist/lib/camera/RTPProxy.d.ts +0 -59
  285. package/vendor/hap-nodejs/dist/lib/camera/RTPProxy.d.ts.map +0 -1
  286. package/vendor/hap-nodejs/dist/lib/camera/RTPProxy.js +0 -267
  287. package/vendor/hap-nodejs/dist/lib/camera/RTPProxy.js.map +0 -1
  288. package/vendor/hap-nodejs/dist/lib/camera/RTPStreamManagement.d.ts +0 -379
  289. package/vendor/hap-nodejs/dist/lib/camera/RTPStreamManagement.d.ts.map +0 -1
  290. package/vendor/hap-nodejs/dist/lib/camera/RTPStreamManagement.js +0 -1021
  291. package/vendor/hap-nodejs/dist/lib/camera/RTPStreamManagement.js.map +0 -1
  292. package/vendor/hap-nodejs/dist/lib/camera/RecordingManagement.d.ts +0 -325
  293. package/vendor/hap-nodejs/dist/lib/camera/RecordingManagement.d.ts.map +0 -1
  294. package/vendor/hap-nodejs/dist/lib/camera/RecordingManagement.js +0 -800
  295. package/vendor/hap-nodejs/dist/lib/camera/RecordingManagement.js.map +0 -1
  296. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoCredentials.d.ts +0 -20
  297. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoCredentials.d.ts.map +0 -1
  298. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoCredentials.js +0 -48
  299. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoCredentials.js.map +0 -1
  300. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoTypes.d.ts +0 -618
  301. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoTypes.d.ts.map +0 -1
  302. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoTypes.js +0 -911
  303. package/vendor/hap-nodejs/dist/lib/camera/SecureVideoTypes.js.map +0 -1
  304. package/vendor/hap-nodejs/dist/lib/camera/index.d.ts +0 -8
  305. package/vendor/hap-nodejs/dist/lib/camera/index.d.ts.map +0 -1
  306. package/vendor/hap-nodejs/dist/lib/camera/index.js +0 -11
  307. package/vendor/hap-nodejs/dist/lib/camera/index.js.map +0 -1
  308. package/vendor/hap-nodejs/dist/lib/controller/AdaptiveLightingController.d.ts +0 -452
  309. package/vendor/hap-nodejs/dist/lib/controller/AdaptiveLightingController.d.ts.map +0 -1
  310. package/vendor/hap-nodejs/dist/lib/controller/AdaptiveLightingController.js +0 -868
  311. package/vendor/hap-nodejs/dist/lib/controller/AdaptiveLightingController.js.map +0 -1
  312. package/vendor/hap-nodejs/dist/lib/controller/CameraController.d.ts +0 -410
  313. package/vendor/hap-nodejs/dist/lib/controller/CameraController.d.ts.map +0 -1
  314. package/vendor/hap-nodejs/dist/lib/controller/CameraController.js +0 -658
  315. package/vendor/hap-nodejs/dist/lib/controller/CameraController.js.map +0 -1
  316. package/vendor/hap-nodejs/dist/lib/controller/Controller.d.ts +0 -197
  317. package/vendor/hap-nodejs/dist/lib/controller/Controller.d.ts.map +0 -1
  318. package/vendor/hap-nodejs/dist/lib/controller/Controller.js +0 -32
  319. package/vendor/hap-nodejs/dist/lib/controller/Controller.js.map +0 -1
  320. package/vendor/hap-nodejs/dist/lib/controller/DoorbellController.d.ts +0 -59
  321. package/vendor/hap-nodejs/dist/lib/controller/DoorbellController.d.ts.map +0 -1
  322. package/vendor/hap-nodejs/dist/lib/controller/DoorbellController.js +0 -102
  323. package/vendor/hap-nodejs/dist/lib/controller/DoorbellController.js.map +0 -1
  324. package/vendor/hap-nodejs/dist/lib/controller/RemoteController.d.ts +0 -434
  325. package/vendor/hap-nodejs/dist/lib/controller/RemoteController.d.ts.map +0 -1
  326. package/vendor/hap-nodejs/dist/lib/controller/RemoteController.js +0 -1178
  327. package/vendor/hap-nodejs/dist/lib/controller/RemoteController.js.map +0 -1
  328. package/vendor/hap-nodejs/dist/lib/controller/SecureVideoController.d.ts +0 -380
  329. package/vendor/hap-nodejs/dist/lib/controller/SecureVideoController.d.ts.map +0 -1
  330. package/vendor/hap-nodejs/dist/lib/controller/SecureVideoController.js +0 -947
  331. package/vendor/hap-nodejs/dist/lib/controller/SecureVideoController.js.map +0 -1
  332. package/vendor/hap-nodejs/dist/lib/controller/index.d.ts +0 -7
  333. package/vendor/hap-nodejs/dist/lib/controller/index.d.ts.map +0 -1
  334. package/vendor/hap-nodejs/dist/lib/controller/index.js +0 -10
  335. package/vendor/hap-nodejs/dist/lib/controller/index.js.map +0 -1
  336. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamManagement.d.ts +0 -73
  337. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamManagement.d.ts.map +0 -1
  338. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamManagement.js +0 -205
  339. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamManagement.js.map +0 -1
  340. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamParser.d.ts +0 -186
  341. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamParser.d.ts.map +0 -1
  342. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamParser.js +0 -880
  343. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamParser.js.map +0 -1
  344. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamServer.d.ts +0 -351
  345. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamServer.d.ts.map +0 -1
  346. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamServer.js +0 -878
  347. package/vendor/hap-nodejs/dist/lib/datastream/DataStreamServer.js.map +0 -1
  348. package/vendor/hap-nodejs/dist/lib/datastream/index.d.ts +0 -4
  349. package/vendor/hap-nodejs/dist/lib/datastream/index.d.ts.map +0 -1
  350. package/vendor/hap-nodejs/dist/lib/datastream/index.js +0 -7
  351. package/vendor/hap-nodejs/dist/lib/datastream/index.js.map +0 -1
  352. package/vendor/hap-nodejs/dist/lib/definitions/CharacteristicDefinitions.d.ts +0 -2245
  353. package/vendor/hap-nodejs/dist/lib/definitions/CharacteristicDefinitions.d.ts.map +0 -1
  354. package/vendor/hap-nodejs/dist/lib/definitions/CharacteristicDefinitions.js +0 -4957
  355. package/vendor/hap-nodejs/dist/lib/definitions/CharacteristicDefinitions.js.map +0 -1
  356. package/vendor/hap-nodejs/dist/lib/definitions/ServiceDefinitions.d.ts +0 -584
  357. package/vendor/hap-nodejs/dist/lib/definitions/ServiceDefinitions.d.ts.map +0 -1
  358. package/vendor/hap-nodejs/dist/lib/definitions/ServiceDefinitions.js +0 -1518
  359. package/vendor/hap-nodejs/dist/lib/definitions/ServiceDefinitions.js.map +0 -1
  360. package/vendor/hap-nodejs/dist/lib/definitions/generate-definitions.d.ts +0 -34
  361. package/vendor/hap-nodejs/dist/lib/definitions/generate-definitions.d.ts.map +0 -1
  362. package/vendor/hap-nodejs/dist/lib/definitions/generate-definitions.js +0 -624
  363. package/vendor/hap-nodejs/dist/lib/definitions/generate-definitions.js.map +0 -1
  364. package/vendor/hap-nodejs/dist/lib/definitions/generator-configuration.d.ts +0 -22
  365. package/vendor/hap-nodejs/dist/lib/definitions/generator-configuration.d.ts.map +0 -1
  366. package/vendor/hap-nodejs/dist/lib/definitions/generator-configuration.js +0 -734
  367. package/vendor/hap-nodejs/dist/lib/definitions/generator-configuration.js.map +0 -1
  368. package/vendor/hap-nodejs/dist/lib/definitions/index.d.ts +0 -3
  369. package/vendor/hap-nodejs/dist/lib/definitions/index.d.ts.map +0 -1
  370. package/vendor/hap-nodejs/dist/lib/definitions/index.js +0 -6
  371. package/vendor/hap-nodejs/dist/lib/definitions/index.js.map +0 -1
  372. package/vendor/hap-nodejs/dist/lib/gen/HomeKit.d.ts +0 -8
  373. package/vendor/hap-nodejs/dist/lib/gen/HomeKit.d.ts.map +0 -1
  374. package/vendor/hap-nodejs/dist/lib/gen/HomeKit.js +0 -9
  375. package/vendor/hap-nodejs/dist/lib/gen/HomeKit.js.map +0 -1
  376. package/vendor/hap-nodejs/dist/lib/model/AccessoryInfo.d.ts +0 -91
  377. package/vendor/hap-nodejs/dist/lib/model/AccessoryInfo.d.ts.map +0 -1
  378. package/vendor/hap-nodejs/dist/lib/model/AccessoryInfo.js +0 -311
  379. package/vendor/hap-nodejs/dist/lib/model/AccessoryInfo.js.map +0 -1
  380. package/vendor/hap-nodejs/dist/lib/model/ControllerStorage.d.ts +0 -46
  381. package/vendor/hap-nodejs/dist/lib/model/ControllerStorage.d.ts.map +0 -1
  382. package/vendor/hap-nodejs/dist/lib/model/ControllerStorage.js +0 -277
  383. package/vendor/hap-nodejs/dist/lib/model/ControllerStorage.js.map +0 -1
  384. package/vendor/hap-nodejs/dist/lib/model/HAPFileStorage.d.ts +0 -75
  385. package/vendor/hap-nodejs/dist/lib/model/HAPFileStorage.d.ts.map +0 -1
  386. package/vendor/hap-nodejs/dist/lib/model/HAPFileStorage.js +0 -190
  387. package/vendor/hap-nodejs/dist/lib/model/HAPFileStorage.js.map +0 -1
  388. package/vendor/hap-nodejs/dist/lib/model/HAPStorage.d.ts +0 -26
  389. package/vendor/hap-nodejs/dist/lib/model/HAPStorage.d.ts.map +0 -1
  390. package/vendor/hap-nodejs/dist/lib/model/HAPStorage.js +0 -79
  391. package/vendor/hap-nodejs/dist/lib/model/HAPStorage.js.map +0 -1
  392. package/vendor/hap-nodejs/dist/lib/model/IdentifierCache.d.ts +0 -33
  393. package/vendor/hap-nodejs/dist/lib/model/IdentifierCache.d.ts.map +0 -1
  394. package/vendor/hap-nodejs/dist/lib/model/IdentifierCache.js +0 -114
  395. package/vendor/hap-nodejs/dist/lib/model/IdentifierCache.js.map +0 -1
  396. package/vendor/hap-nodejs/dist/lib/tv/AccessControlManagement.d.ts +0 -83
  397. package/vendor/hap-nodejs/dist/lib/tv/AccessControlManagement.d.ts.map +0 -1
  398. package/vendor/hap-nodejs/dist/lib/tv/AccessControlManagement.js +0 -127
  399. package/vendor/hap-nodejs/dist/lib/tv/AccessControlManagement.js.map +0 -1
  400. package/vendor/hap-nodejs/dist/lib/util/checkName.d.ts +0 -8
  401. package/vendor/hap-nodejs/dist/lib/util/checkName.d.ts.map +0 -1
  402. package/vendor/hap-nodejs/dist/lib/util/checkName.js +0 -28
  403. package/vendor/hap-nodejs/dist/lib/util/checkName.js.map +0 -1
  404. package/vendor/hap-nodejs/dist/lib/util/clone.d.ts +0 -7
  405. package/vendor/hap-nodejs/dist/lib/util/clone.d.ts.map +0 -1
  406. package/vendor/hap-nodejs/dist/lib/util/clone.js +0 -22
  407. package/vendor/hap-nodejs/dist/lib/util/clone.js.map +0 -1
  408. package/vendor/hap-nodejs/dist/lib/util/color-utils.d.ts +0 -18
  409. package/vendor/hap-nodejs/dist/lib/util/color-utils.d.ts.map +0 -1
  410. package/vendor/hap-nodejs/dist/lib/util/color-utils.js +0 -442
  411. package/vendor/hap-nodejs/dist/lib/util/color-utils.js.map +0 -1
  412. package/vendor/hap-nodejs/dist/lib/util/eventedhttp.d.ts +0 -251
  413. package/vendor/hap-nodejs/dist/lib/util/eventedhttp.d.ts.map +0 -1
  414. package/vendor/hap-nodejs/dist/lib/util/eventedhttp.js +0 -714
  415. package/vendor/hap-nodejs/dist/lib/util/eventedhttp.js.map +0 -1
  416. package/vendor/hap-nodejs/dist/lib/util/hapCrypto.d.ts +0 -50
  417. package/vendor/hap-nodejs/dist/lib/util/hapCrypto.d.ts.map +0 -1
  418. package/vendor/hap-nodejs/dist/lib/util/hapCrypto.js +0 -185
  419. package/vendor/hap-nodejs/dist/lib/util/hapCrypto.js.map +0 -1
  420. package/vendor/hap-nodejs/dist/lib/util/hapStatusError.d.ts +0 -16
  421. package/vendor/hap-nodejs/dist/lib/util/hapStatusError.d.ts.map +0 -1
  422. package/vendor/hap-nodejs/dist/lib/util/hapStatusError.js +0 -29
  423. package/vendor/hap-nodejs/dist/lib/util/hapStatusError.js.map +0 -1
  424. package/vendor/hap-nodejs/dist/lib/util/net-utils.d.ts +0 -21
  425. package/vendor/hap-nodejs/dist/lib/util/net-utils.d.ts.map +0 -1
  426. package/vendor/hap-nodejs/dist/lib/util/net-utils.js +0 -79
  427. package/vendor/hap-nodejs/dist/lib/util/net-utils.js.map +0 -1
  428. package/vendor/hap-nodejs/dist/lib/util/once.d.ts +0 -7
  429. package/vendor/hap-nodejs/dist/lib/util/once.d.ts.map +0 -1
  430. package/vendor/hap-nodejs/dist/lib/util/once.js +0 -22
  431. package/vendor/hap-nodejs/dist/lib/util/once.js.map +0 -1
  432. package/vendor/hap-nodejs/dist/lib/util/promise-utils.d.ts +0 -14
  433. package/vendor/hap-nodejs/dist/lib/util/promise-utils.d.ts.map +0 -1
  434. package/vendor/hap-nodejs/dist/lib/util/promise-utils.js +0 -29
  435. package/vendor/hap-nodejs/dist/lib/util/promise-utils.js.map +0 -1
  436. package/vendor/hap-nodejs/dist/lib/util/request-util.d.ts +0 -36
  437. package/vendor/hap-nodejs/dist/lib/util/request-util.d.ts.map +0 -1
  438. package/vendor/hap-nodejs/dist/lib/util/request-util.js +0 -108
  439. package/vendor/hap-nodejs/dist/lib/util/request-util.js.map +0 -1
  440. package/vendor/hap-nodejs/dist/lib/util/time.d.ts +0 -9
  441. package/vendor/hap-nodejs/dist/lib/util/time.d.ts.map +0 -1
  442. package/vendor/hap-nodejs/dist/lib/util/time.js +0 -23
  443. package/vendor/hap-nodejs/dist/lib/util/time.js.map +0 -1
  444. package/vendor/hap-nodejs/dist/lib/util/tlv.d.ts +0 -90
  445. package/vendor/hap-nodejs/dist/lib/util/tlv.d.ts.map +0 -1
  446. package/vendor/hap-nodejs/dist/lib/util/tlv.js +0 -318
  447. package/vendor/hap-nodejs/dist/lib/util/tlv.js.map +0 -1
  448. package/vendor/hap-nodejs/dist/lib/util/uuid.d.ts +0 -23
  449. package/vendor/hap-nodejs/dist/lib/util/uuid.d.ts.map +0 -1
  450. package/vendor/hap-nodejs/dist/lib/util/uuid.js +0 -78
  451. package/vendor/hap-nodejs/dist/lib/util/uuid.js.map +0 -1
  452. package/vendor/hap-nodejs/dist/types.d.ts +0 -276
  453. package/vendor/hap-nodejs/dist/types.d.ts.map +0 -1
  454. package/vendor/hap-nodejs/dist/types.js +0 -11
  455. package/vendor/hap-nodejs/dist/types.js.map +0 -1
  456. package/vendor/hap-nodejs/package.json +0 -53
  457. package/vendor/hap-nodejs/src/lib/util/hapCrypto.ts +0 -208
@@ -1,658 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CameraController = exports.CameraControllerEvents = exports.ResourceRequestReason = void 0;
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
- /**
15
- * @group Camera
16
- */
17
- var ResourceRequestReason;
18
- (function (ResourceRequestReason) {
19
- /**
20
- * The reason describes periodic resource requests.
21
- * In the example of camera image snapshots those are the typical preview images every 10 seconds.
22
- */
23
- ResourceRequestReason[ResourceRequestReason["PERIODIC"] = 0] = "PERIODIC";
24
- /**
25
- * The resource request is the result of some event.
26
- * In the example of camera image snapshots, requests are made due to e.g. a motion event or similar.
27
- */
28
- ResourceRequestReason[ResourceRequestReason["EVENT"] = 1] = "EVENT";
29
- })(ResourceRequestReason || (exports.ResourceRequestReason = ResourceRequestReason = {}));
30
- /**
31
- * @group Camera
32
- */
33
- var CameraControllerEvents;
34
- (function (CameraControllerEvents) {
35
- /**
36
- * Emitted when the mute state or the volume changed. The Apple Home App typically does not set those values
37
- * except the mute state. When you adjust the volume in the Camera view it will reset the muted state if it was set previously.
38
- * The value of volume has nothing to do with the volume slider in the Camera view of the Home app.
39
- */
40
- CameraControllerEvents["MICROPHONE_PROPERTIES_CHANGED"] = "microphone-change";
41
- /**
42
- * Emitted when the mute state or the volume changed. The Apple Home App typically does not set those values
43
- * except the mute state. When you unmute the device microphone it will reset the mute state if it was set previously.
44
- */
45
- CameraControllerEvents["SPEAKER_PROPERTIES_CHANGED"] = "speaker-change";
46
- })(CameraControllerEvents || (exports.CameraControllerEvents = CameraControllerEvents = {}));
47
- /**
48
- * Everything needed to expose a HomeKit Camera.
49
- *
50
- * @group Camera
51
- */
52
- // eslint-disable-next-line @typescript-eslint/no-unsafe-declaration-merging
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
97
- }
98
- /**
99
- * @private
100
- */
101
- controllerId() {
102
- return "camera" /* DefaultControllerType.CAMERA */;
103
- }
104
- // ----------------------------------- STREAM API ------------------------------------
105
- /**
106
- * Call this method if you want to forcefully suspend an ongoing streaming session.
107
- * This would be adequate if the rtp server or media encoding encountered an unexpected error.
108
- *
109
- * @param sessionId - id of the current ongoing streaming session
110
- */
111
- forceStopStreamingSession(sessionId) {
112
- this.streamManagements.forEach(management => {
113
- if (management.sessionIdentifier === sessionId) {
114
- management.forceStop();
115
- }
116
- });
117
- }
118
- static generateSynchronisationSource() {
119
- const ssrc = crypto_1.default.randomBytes(4); // range [-2.14748e+09 - 2.14748e+09]
120
- ssrc[0] = 0;
121
- return ssrc.readInt32BE(0);
122
- }
123
- // ----------------------------- MICROPHONE/SPEAKER API ------------------------------
124
- setMicrophoneMuted(muted = true) {
125
- if (!this.microphoneService) {
126
- return;
127
- }
128
- this.microphoneMuted = muted;
129
- this.microphoneService.updateCharacteristic(Characteristic_1.Characteristic.Mute, muted);
130
- }
131
- setMicrophoneVolume(volume) {
132
- if (!this.microphoneService) {
133
- return;
134
- }
135
- this.microphoneVolume = volume;
136
- this.microphoneService.updateCharacteristic(Characteristic_1.Characteristic.Volume, volume);
137
- }
138
- setSpeakerMuted(muted = true) {
139
- if (!this.speakerService) {
140
- return;
141
- }
142
- this.speakerMuted = muted;
143
- this.speakerService.updateCharacteristic(Characteristic_1.Characteristic.Mute, muted);
144
- }
145
- setSpeakerVolume(volume) {
146
- if (!this.speakerService) {
147
- return;
148
- }
149
- this.speakerVolume = volume;
150
- this.speakerService.updateCharacteristic(Characteristic_1.Characteristic.Volume, volume);
151
- }
152
- emitMicrophoneChange() {
153
- this.emit("microphone-change" /* CameraControllerEvents.MICROPHONE_PROPERTIES_CHANGED */, this.microphoneMuted, this.microphoneVolume);
154
- }
155
- emitSpeakerChange() {
156
- this.emit("speaker-change" /* CameraControllerEvents.SPEAKER_PROPERTIES_CHANGED */, this.speakerMuted, this.speakerVolume);
157
- }
158
- // -----------------------------------------------------------------------------------
159
- /**
160
- * @private
161
- */
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));
165
- this.streamManagements.push(rtp);
166
- }
167
- if (!this.legacyMode && this.streamingOptions.audio) {
168
- // In theory the Microphone Service is a necessity. In practice, it's not. lol.
169
- // So we just add it if the user wants to support audio
170
- this.microphoneService = new Service_1.Service.Microphone("", "");
171
- this.microphoneService.setCharacteristic(Characteristic_1.Characteristic.Volume, this.microphoneVolume);
172
- if (this.streamingOptions.audio.twoWayAudio) {
173
- this.speakerService = new Service_1.Service.Speaker("", "");
174
- this.speakerService.setCharacteristic(Characteristic_1.Characteristic.Volume, this.speakerVolume);
175
- }
176
- }
177
- if (this.recording) {
178
- this.recordingManagement = new camera_1.RecordingManagement(this.recording.options, this.recording.delegate, this.retrieveEventTriggerOptions());
179
- }
180
- if (this.sensorOptions?.motion) {
181
- if (typeof this.sensorOptions.motion === "boolean") {
182
- this.motionService = new Service_1.Service.MotionSensor("", "");
183
- }
184
- else {
185
- this.motionService = this.sensorOptions.motion;
186
- this.motionServiceExternallySupplied = true;
187
- }
188
- this.motionService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
189
- this.recordingManagement?.recordingManagementService.addLinkedService(this.motionService);
190
- }
191
- if (this.sensorOptions?.occupancy) {
192
- if (typeof this.sensorOptions.occupancy === "boolean") {
193
- this.occupancyService = new Service_1.Service.OccupancySensor("", "");
194
- }
195
- else {
196
- this.occupancyService = this.sensorOptions.occupancy;
197
- this.occupancyServiceExternallySupplied = true;
198
- }
199
- this.occupancyService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
200
- this.recordingManagement?.recordingManagementService.addLinkedService(this.occupancyService);
201
- }
202
- const serviceMap = {
203
- microphone: this.microphoneService,
204
- speaker: this.speakerService,
205
- motionService: !this.motionServiceExternallySupplied ? this.motionService : undefined,
206
- occupancyService: !this.occupancyServiceExternallySupplied ? this.occupancyService : undefined,
207
- };
208
- if (this.recordingManagement) {
209
- serviceMap.cameraEventRecordingManagement = this.recordingManagement.recordingManagementService;
210
- serviceMap.cameraOperatingMode = this.recordingManagement.operatingModeService;
211
- serviceMap.dataStreamTransportManagement = this.recordingManagement.dataStreamManagement.getService();
212
- }
213
- this.streamManagements.forEach((management, index) => {
214
- serviceMap[CameraController.STREAM_MANAGEMENT + index] = management.getService();
215
- });
216
- this.recording = undefined;
217
- this.sensorOptions = undefined;
218
- return serviceMap;
219
- }
220
- /**
221
- * @private
222
- */
223
- initWithServices(serviceMap) {
224
- const result = this._initWithServices(serviceMap);
225
- if (result.updated) { // serviceMap must only be returned if anything actually changed
226
- return result.serviceMap;
227
- }
228
- }
229
- _initWithServices(serviceMap) {
230
- let modifiedServiceMap = false;
231
- // eslint-disable-next-line no-constant-condition
232
- for (let i = 0; true; i++) {
233
- const streamManagementService = serviceMap[CameraController.STREAM_MANAGEMENT + i];
234
- if (i < this.streamCount) {
235
- const operatingModeClosure = this.rtpStreamManagementDisabledThroughOperatingMode.bind(this);
236
- if (streamManagementService) { // normal init
237
- this.streamManagements.push(new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, streamManagementService, operatingModeClosure));
238
- }
239
- else { // stream count got bigger, we need to create a new service
240
- const management = new camera_1.RTPStreamManagement(i, this.streamingOptions, this.delegate, undefined, operatingModeClosure);
241
- this.streamManagements.push(management);
242
- serviceMap[CameraController.STREAM_MANAGEMENT + i] = management.getService();
243
- modifiedServiceMap = true;
244
- }
245
- }
246
- else {
247
- if (streamManagementService) { // stream count got reduced, we need to remove old service
248
- delete serviceMap[CameraController.STREAM_MANAGEMENT + i];
249
- modifiedServiceMap = true;
250
- }
251
- else {
252
- break; // we finished counting, and we got no saved service; we are finished
253
- }
254
- }
255
- }
256
- // MICROPHONE
257
- if (!this.legacyMode && this.streamingOptions.audio) { // microphone should be present
258
- if (serviceMap.microphone) {
259
- this.microphoneService = serviceMap.microphone;
260
- }
261
- else {
262
- // microphone wasn't created yet => create a new one
263
- this.microphoneService = new Service_1.Service.Microphone("", "");
264
- this.microphoneService.setCharacteristic(Characteristic_1.Characteristic.Volume, this.microphoneVolume);
265
- serviceMap.microphone = this.microphoneService;
266
- modifiedServiceMap = true;
267
- }
268
- }
269
- else if (serviceMap.microphone) { // microphone service supplied, though settings seemed to have changed
270
- // we need to remove it
271
- delete serviceMap.microphone;
272
- modifiedServiceMap = true;
273
- }
274
- // SPEAKER
275
- if (!this.legacyMode && this.streamingOptions.audio?.twoWayAudio) { // speaker should be present
276
- if (serviceMap.speaker) {
277
- this.speakerService = serviceMap.speaker;
278
- }
279
- else {
280
- // speaker wasn't created yet => create a new one
281
- this.speakerService = new Service_1.Service.Speaker("", "");
282
- this.speakerService.setCharacteristic(Characteristic_1.Characteristic.Volume, this.speakerVolume);
283
- serviceMap.speaker = this.speakerService;
284
- modifiedServiceMap = true;
285
- }
286
- }
287
- else if (serviceMap.speaker) { // speaker service supplied, though settings seemed to have changed
288
- // we need to remove it
289
- delete serviceMap.speaker;
290
- modifiedServiceMap = true;
291
- }
292
- // RECORDING
293
- if (this.recording) {
294
- const eventTriggers = this.retrieveEventTriggerOptions();
295
- // RECORDING MANAGEMENT
296
- if (serviceMap.cameraEventRecordingManagement && serviceMap.cameraOperatingMode && serviceMap.dataStreamTransportManagement) {
297
- this.recordingManagement = new camera_1.RecordingManagement(this.recording.options, this.recording.delegate, eventTriggers, {
298
- recordingManagement: serviceMap.cameraEventRecordingManagement,
299
- operatingMode: serviceMap.cameraOperatingMode,
300
- dataStreamManagement: new datastream_1.DataStreamManagement(serviceMap.dataStreamTransportManagement),
301
- });
302
- }
303
- else {
304
- this.recordingManagement = new camera_1.RecordingManagement(this.recording.options, this.recording.delegate, eventTriggers);
305
- serviceMap.cameraEventRecordingManagement = this.recordingManagement.recordingManagementService;
306
- serviceMap.cameraOperatingMode = this.recordingManagement.operatingModeService;
307
- serviceMap.dataStreamTransportManagement = this.recordingManagement.dataStreamManagement.getService();
308
- modifiedServiceMap = true;
309
- }
310
- }
311
- else {
312
- if (serviceMap.cameraEventRecordingManagement) {
313
- delete serviceMap.cameraEventRecordingManagement;
314
- modifiedServiceMap = true;
315
- }
316
- if (serviceMap.cameraOperatingMode) {
317
- delete serviceMap.cameraOperatingMode;
318
- modifiedServiceMap = true;
319
- }
320
- if (serviceMap.dataStreamTransportManagement) {
321
- delete serviceMap.dataStreamTransportManagement;
322
- modifiedServiceMap = true;
323
- }
324
- }
325
- // MOTION SENSOR
326
- if (this.sensorOptions?.motion) {
327
- if (typeof this.sensorOptions.motion === "boolean") {
328
- if (serviceMap.motionService) {
329
- this.motionService = serviceMap.motionService;
330
- }
331
- else {
332
- // it could be the case that we previously had a manually supplied motion service
333
- // at this point we can't remove the iid from the list of linked services from the recording management!
334
- this.motionService = new Service_1.Service.MotionSensor("", "");
335
- }
336
- }
337
- else {
338
- this.motionService = this.sensorOptions.motion;
339
- this.motionServiceExternallySupplied = true;
340
- if (serviceMap.motionService) { // motion service previously supplied as bool option
341
- this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.motionService);
342
- delete serviceMap.motionService;
343
- modifiedServiceMap = true;
344
- }
345
- }
346
- this.motionService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
347
- this.recordingManagement?.recordingManagementService.addLinkedService(this.motionService);
348
- }
349
- else {
350
- if (serviceMap.motionService) {
351
- this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.motionService);
352
- delete serviceMap.motionService;
353
- modifiedServiceMap = true;
354
- }
355
- }
356
- // OCCUPANCY SENSOR
357
- if (this.sensorOptions?.occupancy) {
358
- if (typeof this.sensorOptions.occupancy === "boolean") {
359
- if (serviceMap.occupancyService) {
360
- this.occupancyService = serviceMap.occupancyService;
361
- }
362
- else {
363
- // it could be the case that we previously had a manually supplied occupancy service
364
- // at this point we can't remove the iid from the list of linked services from the recording management!
365
- this.occupancyService = new Service_1.Service.OccupancySensor("", "");
366
- }
367
- }
368
- else {
369
- this.occupancyService = this.sensorOptions.occupancy;
370
- this.occupancyServiceExternallySupplied = true;
371
- if (serviceMap.occupancyService) { // occupancy service previously supplied as bool option
372
- this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.occupancyService);
373
- delete serviceMap.occupancyService;
374
- modifiedServiceMap = true;
375
- }
376
- }
377
- this.occupancyService.setCharacteristic(Characteristic_1.Characteristic.StatusActive, true);
378
- this.recordingManagement?.recordingManagementService.addLinkedService(this.occupancyService);
379
- }
380
- else {
381
- if (serviceMap.occupancyService) {
382
- this.recordingManagement?.recordingManagementService.removeLinkedService(serviceMap.occupancyService);
383
- delete serviceMap.occupancyService;
384
- modifiedServiceMap = true;
385
- }
386
- }
387
- if (this.migrateFromDoorbell(serviceMap)) {
388
- modifiedServiceMap = true;
389
- }
390
- this.recording = undefined;
391
- this.sensorOptions = undefined;
392
- return {
393
- serviceMap: serviceMap,
394
- updated: modifiedServiceMap,
395
- };
396
- }
397
- // overwritten in DoorbellController (to avoid cyclic dependencies, I hate typescript for that)
398
- migrateFromDoorbell(serviceMap) {
399
- if (serviceMap.doorbell) { // See NOTICE in DoorbellController
400
- delete serviceMap.doorbell;
401
- return true;
402
- }
403
- return false;
404
- }
405
- retrieveEventTriggerOptions() {
406
- if (!this.recording) {
407
- return new Set();
408
- }
409
- const triggerOptions = new Set();
410
- if (this.recording.options.overrideEventTriggerOptions) {
411
- for (const option of this.recording.options.overrideEventTriggerOptions) {
412
- triggerOptions.add(option);
413
- }
414
- }
415
- if (this.sensorOptions?.motion) {
416
- triggerOptions.add(1 /* EventTriggerOption.MOTION */);
417
- }
418
- // this method is overwritten by the `DoorbellController` to automatically configure EventTriggerOption.DOORBELL
419
- return triggerOptions;
420
- }
421
- /**
422
- * @private
423
- */
424
- configureServices() {
425
- if (this.microphoneService) {
426
- this.microphoneService.getCharacteristic(Characteristic_1.Characteristic.Mute)
427
- .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
428
- callback(undefined, this.microphoneMuted);
429
- })
430
- .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
431
- this.microphoneMuted = value;
432
- callback();
433
- this.emitMicrophoneChange();
434
- });
435
- this.microphoneService.getCharacteristic(Characteristic_1.Characteristic.Volume)
436
- .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
437
- callback(undefined, this.microphoneVolume);
438
- })
439
- .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
440
- this.microphoneVolume = value;
441
- callback();
442
- this.emitMicrophoneChange();
443
- });
444
- }
445
- if (this.speakerService) {
446
- this.speakerService.getCharacteristic(Characteristic_1.Characteristic.Mute)
447
- .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
448
- callback(undefined, this.speakerMuted);
449
- })
450
- .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
451
- this.speakerMuted = value;
452
- callback();
453
- this.emitSpeakerChange();
454
- });
455
- this.speakerService.getCharacteristic(Characteristic_1.Characteristic.Volume)
456
- .on("get" /* CharacteristicEventTypes.GET */, (callback) => {
457
- callback(undefined, this.speakerVolume);
458
- })
459
- .on("set" /* CharacteristicEventTypes.SET */, (value, callback) => {
460
- this.speakerVolume = value;
461
- callback();
462
- this.emitSpeakerChange();
463
- });
464
- }
465
- // make the sensor services available to the RecordingManagement.
466
- if (this.motionService) {
467
- this.recordingManagement?.sensorServices.push(this.motionService);
468
- }
469
- if (this.occupancyService) {
470
- this.recordingManagement?.sensorServices.push(this.occupancyService);
471
- }
472
- }
473
- rtpStreamManagementDisabledThroughOperatingMode() {
474
- return this.recordingManagement
475
- ? !this.recordingManagement.operatingModeService.getCharacteristic(Characteristic_1.Characteristic.HomeKitCameraActive).value
476
- : false;
477
- }
478
- /**
479
- * @private
480
- */
481
- handleControllerRemoved() {
482
- this.handleFactoryReset();
483
- for (const management of this.streamManagements) {
484
- management.destroy();
485
- }
486
- this.streamManagements.splice(0, this.streamManagements.length);
487
- this.microphoneService = undefined;
488
- this.speakerService = undefined;
489
- this.recordingManagement?.destroy();
490
- this.recordingManagement = undefined;
491
- this.removeAllListeners();
492
- }
493
- /**
494
- * @private
495
- */
496
- handleFactoryReset() {
497
- this.streamManagements.forEach(management => management.handleFactoryReset());
498
- this.recordingManagement?.handleFactoryReset();
499
- this.microphoneMuted = false;
500
- this.microphoneVolume = 100;
501
- this.speakerMuted = false;
502
- this.speakerVolume = 100;
503
- }
504
- /**
505
- * @private
506
- */
507
- serialize() {
508
- const streamManagementStates = [];
509
- for (const management of this.streamManagements) {
510
- const serializedState = management.serialize();
511
- if (serializedState) {
512
- streamManagementStates.push(serializedState);
513
- }
514
- }
515
- return {
516
- streamManagements: streamManagementStates,
517
- recordingManagement: this.recordingManagement?.serialize(),
518
- };
519
- }
520
- /**
521
- * @private
522
- */
523
- deserialize(serialized) {
524
- for (const streamManagementState of serialized.streamManagements) {
525
- const streamManagement = this.streamManagements[streamManagementState.id];
526
- if (streamManagement) {
527
- streamManagement.deserialize(streamManagementState);
528
- }
529
- }
530
- if (serialized.recordingManagement) {
531
- if (this.recordingManagement) {
532
- this.recordingManagement.deserialize(serialized.recordingManagement);
533
- }
534
- else {
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);
538
- }
539
- this.stateChangeDelegate?.();
540
- }
541
- }
542
- }
543
- /**
544
- * @private
545
- */
546
- setupStateChangeDelegate(delegate) {
547
- this.stateChangeDelegate = delegate;
548
- for (const streamManagement of this.streamManagements) {
549
- streamManagement.setupStateChangeDelegate(delegate);
550
- }
551
- this.recordingManagement?.setupStateChangeDelegate(delegate);
552
- }
553
- /**
554
- * @private
555
- */
556
- handleSnapshotRequest(height, width, accessoryName, reason) {
557
- // first step is to verify that the reason is applicable to our current policy
558
- const streamingDisabled = this.streamManagements
559
- .map(management => !management.getService().getCharacteristic(Characteristic_1.Characteristic.Active).value)
560
- .reduce((previousValue, currentValue) => previousValue && currentValue);
561
- if (streamingDisabled) {
562
- debug("[%s] Rejecting snapshot as streaming is disabled.", accessoryName);
563
- return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
564
- }
565
- if (this.recordingManagement) {
566
- const operatingModeService = this.recordingManagement.operatingModeService;
567
- if (!operatingModeService.getCharacteristic(Characteristic_1.Characteristic.HomeKitCameraActive).value) {
568
- debug("[%s] Rejecting snapshot as HomeKit camera is disabled.", accessoryName);
569
- return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
570
- }
571
- const eventSnapshotsActive = operatingModeService
572
- .getCharacteristic(Characteristic_1.Characteristic.EventSnapshotsActive)
573
- .value;
574
- if (!eventSnapshotsActive) {
575
- if (reason == null) {
576
- debug("[%s] Rejecting snapshot as reason is required due to disabled event snapshots.", accessoryName);
577
- return Promise.reject(-70401 /* HAPStatus.INSUFFICIENT_PRIVILEGES */);
578
- }
579
- else if (reason === 1 /* ResourceRequestReason.EVENT */) {
580
- debug("[%s] Rejecting snapshot as even snapshots are disabled.", accessoryName);
581
- return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
582
- }
583
- }
584
- const periodicSnapshotsActive = operatingModeService
585
- .getCharacteristic(Characteristic_1.Characteristic.PeriodicSnapshotsActive)
586
- .value;
587
- if (!periodicSnapshotsActive) {
588
- if (reason == null) {
589
- debug("[%s] Rejecting snapshot as reason is required due to disabled periodic snapshots.", accessoryName);
590
- return Promise.reject(-70401 /* HAPStatus.INSUFFICIENT_PRIVILEGES */);
591
- }
592
- else if (reason === 0 /* ResourceRequestReason.PERIODIC */) {
593
- debug("[%s] Rejecting snapshot as periodic snapshots are disabled.", accessoryName);
594
- return Promise.reject(-70412 /* HAPStatus.NOT_ALLOWED_IN_CURRENT_STATE */);
595
- }
596
- }
597
- }
598
- // now do the actual snapshot request.
599
- return new Promise((resolve, reject) => {
600
- // TODO test and make timeouts configurable!
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(() => {
604
- timeout = undefined;
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.`);
606
- reject(-70408 /* HAPStatus.OPERATION_TIMED_OUT */);
607
- }, 17000);
608
- timeout.unref();
609
- }, 8000);
610
- timeout.unref();
611
- try {
612
- this.delegate.handleSnapshotRequest({
613
- height: height,
614
- width: width,
615
- reason: reason,
616
- }, (error, buffer) => {
617
- if (!timeout) {
618
- return;
619
- }
620
- else {
621
- clearTimeout(timeout);
622
- timeout = undefined;
623
- }
624
- if (error) {
625
- if (typeof error === "number") {
626
- reject(error);
627
- }
628
- else {
629
- debug("[%s] Error getting snapshot: %s", accessoryName, error.stack);
630
- reject(-70402 /* HAPStatus.SERVICE_COMMUNICATION_FAILURE */);
631
- }
632
- return;
633
- }
634
- if (!buffer || buffer.length === 0) {
635
- console.warn(`[${accessoryName}] Snapshot request handler provided empty image buffer!`);
636
- reject(-70402 /* HAPStatus.SERVICE_COMMUNICATION_FAILURE */);
637
- }
638
- else {
639
- resolve(buffer);
640
- }
641
- });
642
- }
643
- catch (error) {
644
- if (!timeout) {
645
- return;
646
- }
647
- else {
648
- clearTimeout(timeout);
649
- timeout = undefined;
650
- }
651
- console.warn(`[${accessoryName}] Unhandled error thrown inside snapshot request handler: ${error.stack}`);
652
- reject(error instanceof hapStatusError_1.HapStatusError ? error.hapStatus : -70402 /* HAPStatus.SERVICE_COMMUNICATION_FAILURE */);
653
- }
654
- });
655
- }
656
- }
657
- exports.CameraController = CameraController;
658
- //# sourceMappingURL=CameraController.js.map