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,9 +1,3 @@
1
- import { verifiedH264Encoder } from "./media-policy.js";
2
- import { SecureVideoController } from "@homebridge/hap-nodejs";
3
- import { MultiTierRtpDelegate } from "./hevc/multi-tier-rtp.js";
4
- import { WebRtcSessionManager } from "./hevc/webrtc-session.js";
5
- import { CameraSourceAdapter } from "../source-adapter.js";
6
- import { h264AudioPlan } from "./media-policy.js";
7
1
  import { Accessory, AccessoryInfo, CameraController, Characteristic, Service, uuid, } from "@homebridge/hap-nodejs";
8
2
  import { HomeKitCameraStreamingDelegate } from "./homekit-camera-stream.delegate.js";
9
3
  import { HomeKitCameraRecordingDelegate, } from "./homekit-camera-recording.delegate.js";
@@ -13,7 +7,7 @@ import { ScryptedStorage } from "../scrypted/scrypted-storage.js";
13
7
  import { getHaEntitySearchText } from "../../utils/ha-entity-names.js";
14
8
  import { HAP_FIRMWARE_REVISION, HAP_SOFTWARE_REVISION, } from "../../utils/hap-firmware.js";
15
9
  import { CameraUiStorage } from "../cameraui/cameraui-storage.js";
16
- import { detectPrimaryNetworkInterface, } from "./ffmpeg-helper.js";
10
+ import { detectPrimaryNetworkInterface, probeCameraSource, supportsFdkAac, } from "./ffmpeg-helper.js";
17
11
  import { NestCameraAdapter } from "../nest/nest-camera-adapter.js";
18
12
  import { resolveHaCameraEntityId } from "../cameraui/ha-camera-entity.js";
19
13
  import { FfmpegMotionDetector } from "../motion/ffmpeg-motion-detector.js";
@@ -44,8 +38,6 @@ export class HomeKitCameraAccessory {
44
38
  streamSource;
45
39
  accessory;
46
40
  controller;
47
- secureRtp;
48
- secureWebRtc;
49
41
  delegate;
50
42
  recordingDelegate;
51
43
  motionService;
@@ -101,6 +93,10 @@ export class HomeKitCameraAccessory {
101
93
  Boolean(this.record.serialNumber?.startsWith("CUI-"));
102
94
  const hasIntegratedCameraMotion = Boolean(this.streamSource.metadata?.hasCameraMotion);
103
95
  const isC120 = this.isTapoC120();
96
+ if (isC120 &&
97
+ (!this.capabilities.maxFps || this.capabilities.maxFps <= 0)) {
98
+ this.capabilities.maxFps = 15;
99
+ }
104
100
  const isC402 = this.isTapoC402();
105
101
  if (this.linkedMotionEntityId ||
106
102
  isScrypted ||
@@ -195,18 +191,40 @@ export class HomeKitCameraAccessory {
195
191
  catch { }
196
192
  }
197
193
  const isStreamingUsable = Boolean(this.streamSource.url) ||
194
+ this.isTapoC402() ||
195
+ this.isTapoC120() ||
198
196
  Boolean(this.streamSource.metadata?.isCameraUi) ||
199
197
  Boolean(this.streamSource.metadata?.isHaProxyStream);
200
- this.record.hksvEnabled ??= isStreamingUsable;
198
+ this.record.hksvEnabled = isStreamingUsable;
201
199
  this.record.hksvCapable = isStreamingUsable;
202
200
  this.record.hksvState = isStreamingUsable ? "waiting_hub" : "not_capable";
201
+ const isTapoC402 = this.isTapoC402();
203
202
  const configuredMode = this.record.exportMode || "auto";
204
- const codec = this.capabilities.videoCodec;
205
- const effectiveMode = configuredMode === "disabled"
206
- ? "disabled"
207
- : codec === "hevc" || codec === "h265"
208
- ? "passthrough_hevc"
209
- : "passthrough_h264";
203
+ let effectiveMode = "passthrough_h264";
204
+ if (configuredMode === "disabled") {
205
+ effectiveMode = "disabled";
206
+ }
207
+ else if (isTapoC402) {
208
+ effectiveMode = "passthrough_h264";
209
+ if (configuredMode === "passthrough_hevc") {
210
+ this.platform?.log?.warn?.(`[HomeKitCamera][${this.entityId}] Tapo C402 cannot be configured for HEVC/HKSV3. Forcing passthrough_h264 on classic CameraController.`);
211
+ }
212
+ }
213
+ else if (configuredMode === "passthrough_hevc") {
214
+ effectiveMode = "passthrough_hevc";
215
+ }
216
+ else if (configuredMode === "passthrough_h264") {
217
+ effectiveMode = "passthrough_h264";
218
+ }
219
+ else {
220
+ const rawCodec = (this.capabilities.videoCodec ||
221
+ this.streamSource.metadata?.videoCodec ||
222
+ "").toLowerCase();
223
+ const isHevc = rawCodec.includes("hevc") ||
224
+ rawCodec.includes("265") ||
225
+ rawCodec.includes("hvc1");
226
+ effectiveMode = isHevc ? "passthrough_hevc" : "passthrough_h264";
227
+ }
210
228
  if (effectiveMode === "disabled") {
211
229
  this.record.activeController = undefined;
212
230
  this.platform?.log?.notice?.(`[HomeKitCamera][${this.entityId}] Apple Home export disabled by configuration`);
@@ -218,82 +236,7 @@ export class HomeKitCameraAccessory {
218
236
  this.capabilities.requiresTranscoding = false;
219
237
  this.capabilities.strategy = "passthrough_hevc";
220
238
  }
221
- if (effectiveMode === "passthrough_hevc")
222
- this.configureSecureCameraController();
223
- else
224
- this.configureClassicCameraController();
225
- }
226
- configureSecureCameraController() {
227
- const c = this.capabilities;
228
- const width = c.measuredVideo?.width || c.resolution.width, height = c.measuredVideo?.height || c.resolution.height, fps = c.measuredVideo?.fps || c.maxFps;
229
- if (!(width > 0 && height > 0 && fps > 0))
230
- throw new Error("Secure Video needs known source dimensions and FPS");
231
- const videoTiers = [
232
- {
233
- identifier: 1,
234
- quality: 2,
235
- width,
236
- height,
237
- frameRate: fps,
238
- targetAverageBitrate: c.measuredVideo?.bitrateKbps || 1800,
239
- peakBitrate: c.measuredVideo?.bitrateKbps || 2000,
240
- },
241
- ];
242
- const audioTier = {
243
- identifier: 1,
244
- targetAverageBitrate: 24000,
245
- sampleRate: 4,
246
- bitDepth: 2,
247
- packetTime: 20,
248
- channels: 1,
249
- };
250
- this.recordingDelegate = new HevcRecordingDelegate(this.platform, this.entityId, this.record, c, this.streamSource);
251
- this.secureRtp = new MultiTierRtpDelegate(this.platform, this.entityId, c, this.streamSource, { videoTiers, audioTier, videoPayloadType: 99, audioPayloadType: 110 });
252
- this.secureWebRtc = new WebRtcSessionManager(this.platform, this.entityId, c, this.streamSource, videoTiers);
253
- const snapshotDelegate = new HomeKitCameraStreamingDelegate(this.platform, this.entityId, c, this.streamSource, this.record);
254
- this.delegate = snapshotDelegate;
255
- this.controller = new SecureVideoController({
256
- sensor: { uuid: this.record.uuid, width, height, type: 1, intent: 1 },
257
- video: { codec: 2, payloadType: 99, tiers: videoTiers },
258
- ...(c.hasAudio
259
- ? { audio: { payloadType: 110, tier: audioTier, twoWayAudio: false } }
260
- : {}),
261
- rtp: { delegate: this.secureRtp },
262
- webrtc: { delegate: this.secureWebRtc, maxSessions: 6 },
263
- recording: {
264
- delegate: this.recordingDelegate,
265
- options: {
266
- prebufferLength: 8000,
267
- mediaContainerConfiguration: { type: 0, fragmentLength: 4000 },
268
- video: {
269
- type: 0,
270
- parameters: { profiles: [1], levels: [0, 1, 2] },
271
- resolutions: [[width, height, fps]],
272
- },
273
- audio: { codecs: { type: 0, audioChannels: 1, samplerate: [5] } },
274
- },
275
- },
276
- ...(this.motionService ? { motionService: this.motionService } : {}),
277
- snapshot: (request) => new Promise((resolve, reject) => snapshotDelegate.handleSnapshotRequest({
278
- width: request?.width || width,
279
- height: request?.height || height,
280
- }, (error, data) => (error ? reject(error) : resolve(data)))),
281
- });
282
- for (const delegate of [this.secureRtp, this.secureWebRtc]) {
283
- delegate.on("session-start", () => this.recordingDelegate?.pausePrebuffer());
284
- delegate.on("recording-data", (chunk) => {
285
- const recording = this.recordingDelegate;
286
- if (recording && "ingestLiveViewRecordingChunk" in recording)
287
- recording.ingestLiveViewRecordingChunk(chunk);
288
- });
289
- delegate.on("session-end", () => {
290
- if (!this.secureRtp?.hasActiveReader &&
291
- !this.secureWebRtc?.hasActiveReader)
292
- this.recordingDelegate?.resumePrebuffer();
293
- });
294
- }
295
- this.accessory.configureController(this.controller);
296
- this.record.activeController = "SecureVideoController";
239
+ this.configureClassicCameraController();
297
240
  }
298
241
  configureClassicCameraController() {
299
242
  this.record.activeController = "CameraController";
@@ -334,6 +277,45 @@ export class HomeKitCameraAccessory {
334
277
  this.accessory.configureController(this.controller);
335
278
  this.platform?.log?.notice?.(`[HomeKitCamera][${this.entityId}] Configured classic CameraController (${isHevc ? "HEVC/HKSV3 passthrough" : "H.264 passthrough"})`);
336
279
  }
280
+ previewBusy = false;
281
+ async acquireBrowserPreview(stop) {
282
+ if (this.previewBusy || this.delegate?.hasActiveSessions())
283
+ throw new Error("Casa está usando la cámara");
284
+ this.previewBusy = true;
285
+ let released = false;
286
+ const release = () => {
287
+ if (released)
288
+ return;
289
+ released = true;
290
+ this.previewBusy = false;
291
+ this.delegate?.off("session-start", stop);
292
+ if (!this.delegate?.hasActiveSessions()) {
293
+ this.recordingDelegate?.resumePrebuffer();
294
+ this.localMotionDetector?.resume(this.platform?.log, "Preview terminada");
295
+ }
296
+ };
297
+ this.delegate?.once("session-start", stop);
298
+ this.recordingDelegate?.pausePrebuffer();
299
+ this.localMotionDetector?.pause(this.platform?.log, "Preview temporal");
300
+ try {
301
+ await new Promise((resolve) => setImmediate(resolve));
302
+ const sourceId = this.streamSource.metadata?.sourceCameraEntityId || this.entityId;
303
+ const url = this.streamSource.metadata?.isOmniTuyaDirect
304
+ ? await this.platform?.ha?.requestOmniTuyaCameraStream?.(sourceId)
305
+ : this.streamSource.url;
306
+ this.recordingDelegate?.pausePrebuffer();
307
+ this.localMotionDetector?.pause(this.platform?.log, "Preview temporal");
308
+ if (!url ||
309
+ !/^rtsps?:\/\//i.test(url) ||
310
+ this.delegate?.hasActiveSessions())
311
+ throw new Error("Fuente ocupada o no compatible");
312
+ return { url, release };
313
+ }
314
+ catch (error) {
315
+ release();
316
+ throw error;
317
+ }
318
+ }
337
319
  configureAccessoryInformation() {
338
320
  const mfr = "Matter All-In-One Chrisalvir";
339
321
  const model = (this.record.model || "Network Camera")
@@ -349,21 +331,35 @@ export class HomeKitCameraAccessory {
349
331
  }
350
332
  buildControllerOptions() {
351
333
  const isStreamingUsable = Boolean(this.streamSource.url) ||
334
+ this.isTapoC402() ||
335
+ this.isTapoC120() ||
352
336
  Boolean(this.streamSource.metadata?.isCameraUi) ||
353
337
  Boolean(this.streamSource.metadata?.isHaProxyStream);
354
338
  // Do not negotiate AAC-ELD unless this exact FFmpeg binary can encode it.
355
339
  // The native FFmpeg `aac` encoder only emits AAC-LC; advertising AAC-ELD
356
340
  // and then sending AAC-LC makes HomeKit reject the audio RTP stream.
357
- const audioPlan = h264AudioPlan(this.capabilities);
358
- const audioCodecs = audioPlan.codec === "unavailable"
359
- ? []
360
- : [
361
- {
362
- type: audioPlan.codec === "opus"
363
- ? "OPUS" /* AudioStreamingCodecType.OPUS */ : "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */,
364
- samplerate: 24 /* AudioStreamingSamplerate.KHZ_24 */,
365
- },
366
- ];
341
+ const audioCodecs = [
342
+ ...(supportsFdkAac()
343
+ ? [
344
+ {
345
+ type: "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */,
346
+ samplerate: 16 /* AudioStreamingSamplerate.KHZ_16 */,
347
+ },
348
+ {
349
+ type: "AAC-eld" /* AudioStreamingCodecType.AAC_ELD */,
350
+ samplerate: 24 /* AudioStreamingSamplerate.KHZ_24 */,
351
+ },
352
+ ]
353
+ : []),
354
+ {
355
+ type: "OPUS" /* AudioStreamingCodecType.OPUS */,
356
+ samplerate: 16 /* AudioStreamingSamplerate.KHZ_16 */,
357
+ },
358
+ {
359
+ type: "OPUS" /* AudioStreamingCodecType.OPUS */,
360
+ samplerate: 24 /* AudioStreamingSamplerate.KHZ_24 */,
361
+ },
362
+ ];
367
363
  const options = {
368
364
  cameraStreamCount: 2,
369
365
  delegate: this.delegate,
@@ -384,9 +380,13 @@ export class HomeKitCameraAccessory {
384
380
  // startup URL may have expired before its audio SDP can be measured.
385
381
  // Offer the standard audio codecs for Omni and validate the fresh URL
386
382
  // immediately before spawning FFmpeg in the streaming delegate.
387
- audio: audioCodecs.length > 0
383
+ audio: this.capabilities.hasAudio ||
384
+ this.streamSource.metadata?.isOmniTuyaDirect
388
385
  ? {
389
386
  codecs: audioCodecs,
387
+ twoWayAudio: this.streamSource.metadata?.omniTwoWayAudio === true ||
388
+ this.streamSource.metadata?.isOmniTuyaDirect === true ||
389
+ /(?:\bomni\b|\btuya\b|comedero|feeder|acf100)/i.test(`${this.entityId} ${String(this.record?.name || "")} ${String(this.record?.model || "")}`),
390
390
  }
391
391
  : undefined,
392
392
  },
@@ -395,7 +395,7 @@ export class HomeKitCameraAccessory {
395
395
  if (isStreamingUsable && this.recordingDelegate) {
396
396
  options.recording = {
397
397
  options: {
398
- prebufferLength: 8000,
398
+ prebufferLength: 4000,
399
399
  overrideEventTriggerOptions: [1 /* EventTriggerOption.MOTION */],
400
400
  mediaContainerConfiguration: {
401
401
  type: 0 /* MediaContainerType.FRAGMENTED_MP4 */,
@@ -421,7 +421,10 @@ export class HomeKitCameraAccessory {
421
421
  codecs: {
422
422
  type: 0 /* AudioRecordingCodecType.AAC_LC */,
423
423
  audioChannels: 1,
424
- samplerate: [5 /* AudioRecordingSamplerate.KHZ_48 */],
424
+ samplerate: [
425
+ 1 /* AudioRecordingSamplerate.KHZ_16 */,
426
+ 3 /* AudioRecordingSamplerate.KHZ_32 */,
427
+ ],
425
428
  },
426
429
  },
427
430
  },
@@ -431,7 +434,41 @@ export class HomeKitCameraAccessory {
431
434
  return options;
432
435
  }
433
436
  buildRecordingResolutions() {
434
- return this.buildDeclaredResolutions();
437
+ const isC120 = this.isTapoC120();
438
+ const source = this.capabilities.resolution || {
439
+ width: 1920,
440
+ height: 1080,
441
+ };
442
+ const width = isC120 ? 1920 : source.width || 1920;
443
+ const height = isC120 ? 1080 : source.height || 1080;
444
+ const measured = this.capabilities.measuredVideo?.fps;
445
+ const detectedFps = (measured && measured > 0 ? Math.round(measured) : undefined) ??
446
+ this.capabilities.maxFps ??
447
+ this.record?.fps ??
448
+ (isC120 ? 15 : 30);
449
+ const cameraMax = Math.max(10, Math.min(detectedFps, 60));
450
+ const dynamicFps = cameraMax;
451
+ const candidates = [
452
+ [width, height, dynamicFps],
453
+ ...(width >= 3840
454
+ ? [[2560, 1440, dynamicFps]]
455
+ : []),
456
+ ...(width > 1920 && width < 3840
457
+ ? [[2560, 1440, dynamicFps]]
458
+ : []),
459
+ [1920, 1080, dynamicFps],
460
+ [1280, 720, dynamicFps],
461
+ ];
462
+ const seen = new Set();
463
+ const res = [];
464
+ for (const [w, h, f] of candidates) {
465
+ const key = `${w}x${h}`;
466
+ if (!seen.has(key)) {
467
+ seen.add(key);
468
+ res.push([w, h, f]);
469
+ }
470
+ }
471
+ return res;
435
472
  }
436
473
  nativeH264Profile() {
437
474
  const profile = (this.capabilities.videoProfile || "").toLowerCase();
@@ -444,22 +481,53 @@ export class HomeKitCameraAccessory {
444
481
  return 2 /* H264Profile.HIGH */;
445
482
  }
446
483
  buildDeclaredResolutions() {
447
- const c = this.capabilities;
448
- const width = c.measuredVideo?.width || c.resolution.width;
449
- const height = c.measuredVideo?.height || c.resolution.height;
450
- const fps = c.measuredVideo?.fps || c.maxFps;
451
- if (!(width > 0 && height > 0 && fps > 0))
452
- throw new Error("Camera geometry is unknown");
453
- if ((width > 1920 ||
454
- height > 1080 ||
455
- this.streamSource.sourceType === "ha_proxy" ||
456
- this.streamSource.sourceType === "mjpeg") &&
457
- !verifiedH264Encoder())
458
- throw new Error("Classic HAP normalization encoder unavailable");
459
- const ratio = Math.min(1, 1920 / width, 1080 / height);
460
- const w = Math.floor((width * ratio) / 2) * 2, h = Math.floor((height * ratio) / 2) * 2;
461
- // Passthrough supplies the measured geometry, independent of UI model aliases.
462
- return [[w, h, Math.floor(fps)]];
484
+ const isC120 = this.isTapoC120();
485
+ const source = this.capabilities.resolution || {
486
+ width: 1920,
487
+ height: 1080,
488
+ };
489
+ const width = source.width || 1920;
490
+ const height = source.height || 1080;
491
+ const cameraMax = isC120 ? 20 : this.capabilities.maxFps || 30;
492
+ const sourceFps = Math.max(15, Math.min(this.capabilities.maxFps || cameraMax, isC120 ? 20 : 60));
493
+ const dynamicFps = Math.min(sourceFps, cameraMax);
494
+ // Tapo C120: Advertises native ladder matching stream capabilities.
495
+ // Uses real measured/configured FPS dynamically (typically 15-20fps).
496
+ if (isC120) {
497
+ const measured = this.capabilities.measuredVideo?.fps;
498
+ const detectedFps = (measured && measured > 0 ? Math.round(measured) : undefined) ??
499
+ this.capabilities.maxFps ??
500
+ this.record?.fps ??
501
+ 15;
502
+ const dynamicC120Fps = Math.max(10, Math.min(detectedFps, 30));
503
+ const resList = [];
504
+ if (width > 1920) {
505
+ resList.push([2560, 1440, dynamicC120Fps]);
506
+ }
507
+ resList.push([1920, 1080, dynamicC120Fps], [1280, 720, dynamicC120Fps], [640, 360, dynamicC120Fps], [480, 270, dynamicC120Fps], [320, 180, dynamicC120Fps]);
508
+ return resList;
509
+ }
510
+ const ladder = [
511
+ [width, height, dynamicFps],
512
+ ...(width > 1920
513
+ ? [[2560, 1440, dynamicFps]]
514
+ : []),
515
+ [1920, 1080, dynamicFps],
516
+ [1280, 720, dynamicFps],
517
+ [640, 360, Math.min(dynamicFps, 30)],
518
+ [480, 270, Math.min(dynamicFps, 30)],
519
+ [320, 180, Math.min(dynamicFps, 30)],
520
+ ];
521
+ const seen = new Set();
522
+ const unique = [];
523
+ for (const res of ladder) {
524
+ const key = `${res[0]}x${res[1]}`;
525
+ if (!seen.has(key)) {
526
+ seen.add(key);
527
+ unique.push(res);
528
+ }
529
+ }
530
+ return unique;
463
531
  }
464
532
  /**
465
533
  * Construye los niveles H.264 declarados en SupportedVideoStreamConfiguration.
@@ -470,23 +538,6 @@ export class HomeKitCameraAccessory {
470
538
  }
471
539
  /** Read-only description of Live View capabilities advertised by this accessory. */
472
540
  getLiveViewCapabilitiesDiagnostic() {
473
- if (this.record.activeController === "SecureVideoController")
474
- return {
475
- codec: "hevc",
476
- profiles: this.capabilities.videoProfile
477
- ? [this.capabilities.videoProfile]
478
- : [],
479
- levels: this.capabilities.measuredVideo?.level
480
- ? [this.capabilities.measuredVideo.level]
481
- : [],
482
- resolutions: [
483
- [
484
- this.capabilities.resolution.width,
485
- this.capabilities.resolution.height,
486
- this.capabilities.maxFps,
487
- ],
488
- ],
489
- };
490
541
  return {
491
542
  codec: "h264",
492
543
  profiles: ["baseline", "main", "high"],
@@ -865,8 +916,6 @@ export class HomeKitCameraAccessory {
865
916
  this.platform?.log?.notice?.(`[HomeKitCamera][${this.entityId}] Camera un-paired from Apple Home`);
866
917
  this.recordingDelegate?.updateRecordingActive(false);
867
918
  this.delegate?.cleanupAllSessions();
868
- void this.secureRtp?.stopAll();
869
- void this.secureWebRtc?.closeAll();
870
919
  void this.platform?.saveHomeKitCameraRecords?.();
871
920
  this.notifyPairingStateChanged(false);
872
921
  });
@@ -890,6 +939,9 @@ export class HomeKitCameraAccessory {
890
939
  if (!this.streamSource.metadata?.isCameraUi &&
891
940
  !this.streamSource.metadata?.capabilitiesProbedBeforePublish) {
892
941
  void this.probeAndAdaptCapabilities();
942
+ setTimeout(() => {
943
+ void this.delegate?.handleSnapshotRequest({ width: 1280, height: 720 }, () => { });
944
+ }, 1500);
893
945
  }
894
946
  }
895
947
  /**
@@ -909,7 +961,10 @@ export class HomeKitCameraAccessory {
909
961
  cameraId: this.entityId,
910
962
  cameraName: this.record.name || this.entityId,
911
963
  rtspUrl: this.streamSource.url || "",
912
- fps: 1,
964
+ // A feeder animal can cross this close, narrow frame between 1 FPS
965
+ // samples. Two frames per second improves trigger coverage at the same
966
+ // small 160x90 analysis size without opening another RTSP reader.
967
+ fps: 2,
913
968
  reportAllFrameChanges: true,
914
969
  resolveRtspUrl: async () => await this.platform.ha.requestOmniTuyaCameraStream(sourceCameraEntityId),
915
970
  });
@@ -920,9 +975,7 @@ export class HomeKitCameraAccessory {
920
975
  this.localMotionDetector.start(this.platform?.log);
921
976
  }
922
977
  async probeAndAdaptCapabilities() {
923
- if (!this.streamSource.url ||
924
- this.isStreaming ||
925
- this.streamSource.metadata?.isOmniTuyaDirect)
978
+ if (!this.streamSource.url)
926
979
  return;
927
980
  try {
928
981
  // Omni Tuya URLs are single-session signed RTSP credentials. Probe a
@@ -933,15 +986,11 @@ export class HomeKitCameraAccessory {
933
986
  : this.streamSource.url;
934
987
  if (!probeUrl)
935
988
  return;
936
- const adapter = new CameraSourceAdapter(this.platform, this.entityId, this.streamSource, this.capabilities, this.record);
937
- const { probe } = await adapter.discover(probeUrl);
989
+ const probe = await probeCameraSource(probeUrl, {
990
+ timeoutMs: 4000,
991
+ });
938
992
  if (probe.valid && probe.videoCodec) {
939
- this.capabilities.audioProvenance = "PROBED";
940
993
  const codec = probe.videoCodec.toLowerCase();
941
- if (!["hevc", "h265", "h264"].includes(codec)) {
942
- this.capabilities.hasLiveStream = false;
943
- return;
944
- }
945
994
  const isHevc = codec.includes("hevc") || codec.includes("265");
946
995
  this.capabilities.videoCodec = isHevc ? "hevc" : "h264";
947
996
  this.capabilities.requiresTranscoding = false;
@@ -953,8 +1002,11 @@ export class HomeKitCameraAccessory {
953
1002
  }
954
1003
  if (probe.hasAudio && probe.audioCodec) {
955
1004
  const audioCodec = probe.audioCodec.toLowerCase();
956
- this.capabilities.audioCodec =
957
- audioCodec;
1005
+ this.capabilities.audioCodec = audioCodec.includes("aac")
1006
+ ? "aac_lc"
1007
+ : audioCodec.includes("opus")
1008
+ ? "opus"
1009
+ : "pcm";
958
1010
  this.capabilities.audioSampleRate = probe.audioSampleRate;
959
1011
  this.capabilities.audioChannels = probe.audioChannels;
960
1012
  }
@@ -983,7 +1035,6 @@ export class HomeKitCameraAccessory {
983
1035
  fps: probe.fps,
984
1036
  bitrateKbps: probe.bitrateKbps,
985
1037
  pixFmt: probe.pixFmt,
986
- metadataSource: "ffprobe",
987
1038
  };
988
1039
  this.platform?.log?.notice?.(`[HomeKitCamera][${this.entityId}] Probed capabilities: codec=${probe.videoCodec} ${probe.width}x${probe.height}@${probe.fps}fps hasAudio=${probe.hasAudio} -> strategy=${this.capabilities.strategy}`);
989
1040
  if (this.entityId.includes("cameraui")) {
@@ -1087,23 +1138,10 @@ export class HomeKitCameraAccessory {
1087
1138
  isPaired() {
1088
1139
  return this.getPairingState() === "paired";
1089
1140
  }
1090
- getLiveViewTelemetry() {
1091
- return {
1092
- ...(this.delegate?.getLiveViewTelemetry() || { active: [], recent: [] }),
1093
- secure: {
1094
- rtp: this.secureRtp?.getStartupDiagnostics(),
1095
- webRTC: this.secureWebRtc?.getStartupDiagnostics(),
1096
- },
1097
- };
1098
- }
1099
1141
  get isStreaming() {
1100
- return Boolean(this.delegate?.isStreaming ||
1101
- this.secureRtp?.isStreaming ||
1102
- this.secureWebRtc?.isStreaming);
1142
+ return this.delegate?.isStreaming ?? false;
1103
1143
  }
1104
1144
  async unpublish() {
1105
- await this.secureRtp?.stopAll();
1106
- await this.secureWebRtc?.closeAll();
1107
1145
  this.delegate?.cleanupAllSessions();
1108
1146
  this.recordingDelegate?.updateRecordingActive(false);
1109
1147
  this.localMotionDetector?.stop(this.platform?.log);