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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/build/lib/HAPHostNode.js +185 -148
  2. package/build/lib/HAPServiceNode.js +200 -177
  3. package/build/lib/HAPServiceNode2.js +208 -177
  4. package/build/lib/NRCHKBError.js +23 -2
  5. package/build/lib/PairingQRCode.js +62 -0
  6. package/build/lib/Storage.js +152 -90
  7. package/build/lib/api.js +654 -291
  8. package/build/lib/camera/CameraControl.js +125 -0
  9. package/build/lib/camera/CameraDelegate.js +507 -0
  10. package/build/lib/camera/MP4StreamingServer.js +159 -0
  11. package/build/lib/hap/HAPCharacteristic.js +25 -4
  12. package/build/lib/hap/HAPService.js +25 -4
  13. package/build/lib/hap/eve-app/EveCharacteristics.js +124 -81
  14. package/build/lib/hap/eve-app/EveServices.js +50 -17
  15. package/build/lib/hap/hap-nodejs.js +32 -0
  16. package/build/lib/migration/HomeKitService2Migration.js +34 -0
  17. package/build/lib/migration/NodeMigration.js +75 -0
  18. package/build/lib/types/AccessoryInformationType.js +15 -1
  19. package/build/lib/types/CameraConfigType.js +15 -1
  20. package/build/lib/types/CustomCharacteristicType.js +15 -1
  21. package/build/lib/types/HAPHostConfigType.js +15 -1
  22. package/build/lib/types/HAPHostNodeType.js +15 -1
  23. package/build/lib/types/HAPService2ConfigType.js +15 -1
  24. package/build/lib/types/HAPService2NodeType.js +15 -1
  25. package/build/lib/types/HAPServiceConfigType.js +15 -1
  26. package/build/lib/types/HAPServiceNodeType.js +15 -1
  27. package/build/lib/types/HAPStatusConfigType.js +15 -1
  28. package/build/lib/types/HAPStatusNodeType.js +15 -1
  29. package/build/lib/types/HostType.js +28 -7
  30. package/build/lib/types/NodeType.js +15 -1
  31. package/build/lib/types/PublishTimersType.js +15 -1
  32. package/build/lib/types/UniFiControllerConfigType.js +16 -0
  33. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.js +28 -7
  34. package/build/lib/types/hap-nodejs/HapCategories.js +64 -43
  35. package/build/lib/types/storage/SerializedHostType.js +15 -1
  36. package/build/lib/types/storage/StorageType.js +34 -10
  37. package/build/lib/unifi/ProtectDiscovery.js +80 -0
  38. package/build/lib/utils/AccessoryUtils.js +152 -110
  39. package/build/lib/utils/BridgeUtils.js +95 -39
  40. package/build/lib/utils/CharacteristicUtils.js +5 -49
  41. package/build/lib/utils/CharacteristicUtils2.js +5 -49
  42. package/build/lib/utils/CharacteristicUtilsBase.js +81 -0
  43. package/build/lib/utils/NodeStatusUtils.js +89 -40
  44. package/build/lib/utils/ServiceUtils.js +433 -371
  45. package/build/lib/utils/ServiceUtils2.js +519 -305
  46. package/build/lib/utils/index.js +11 -12
  47. package/build/nodes/bridge.html +206 -168
  48. package/build/nodes/bridge.js +27 -9
  49. package/build/nodes/locales/en-US/node-red-contrib-homekit-bridged.json +22 -0
  50. package/build/nodes/nrchkb.html +1753 -117
  51. package/build/nodes/nrchkb.js +66 -88
  52. package/build/nodes/plugin-instance.html +509 -0
  53. package/build/nodes/plugin-instance.js +46 -0
  54. package/build/nodes/service.html +557 -306
  55. package/build/nodes/service.js +5 -6
  56. package/build/nodes/service2.html +1735 -455
  57. package/build/nodes/service2.js +5 -8
  58. package/build/nodes/standalone.html +208 -176
  59. package/build/nodes/standalone.js +27 -9
  60. package/build/nodes/status.html +51 -18
  61. package/build/nodes/status.js +47 -41
  62. package/build/nodes/unifi-controller.html +92 -0
  63. package/build/nodes/unifi-controller.js +20 -0
  64. package/build/plugins/embedded/homebridge-camera-ffmpeg/index.js +479 -0
  65. package/build/plugins/embedded/homebridge-unifi-protect/index.js +521 -0
  66. package/build/plugins/embedded/index.js +58 -0
  67. package/build/plugins/nrchkb-homekit-plugins.js +17 -0
  68. package/build/plugins/registry/index.js +203 -0
  69. package/build/plugins/registry/types.js +16 -0
  70. package/build/scripts/migrate-homekit-service-flows.js +47 -0
  71. package/examples/demo/01 - ALL Demos single import.json +1885 -2139
  72. package/examples/demo/02 - Air Purifier.json +12 -61
  73. package/examples/demo/03 - Air Quality sensor with Battery.json +8 -36
  74. package/examples/demo/04 - Dimmable Bulb.json +4 -21
  75. package/examples/demo/05 - Color Bulb (HSV).json +5 -26
  76. package/examples/demo/06 - Fan (simple, 3 speeds).json +6 -31
  77. package/examples/demo/07 - Fan (with speed, oscillate, rotation direction).json +4 -21
  78. package/examples/demo/08 - CO2 detector.json +8 -39
  79. package/examples/demo/09 - CO (carbon monoxide) example.json +9 -44
  80. package/examples/demo/10 - Door window contact sensor.json +8 -39
  81. package/examples/demos (advanced)/01 - Television with inputs and speaker.json +19 -85
  82. package/examples/switch/01 - Plain Switch.json +179 -199
  83. package/package.json +48 -34
  84. package/build/lib/HAPHostNode.d.ts +0 -1
  85. package/build/lib/HAPServiceNode.d.ts +0 -1
  86. package/build/lib/HAPServiceNode2.d.ts +0 -1
  87. package/build/lib/NRCHKBError.d.ts +0 -3
  88. package/build/lib/Storage.d.ts +0 -30
  89. package/build/lib/api.d.ts +0 -1
  90. package/build/lib/hap/HAPCharacteristic.d.ts +0 -9
  91. package/build/lib/hap/HAPService.d.ts +0 -6
  92. package/build/lib/hap/eve-app/EveCharacteristics.d.ts +0 -20
  93. package/build/lib/hap/eve-app/EveServices.d.ts +0 -5
  94. package/build/lib/types/AccessoryInformationType.d.ts +0 -11
  95. package/build/lib/types/CameraConfigType.d.ts +0 -24
  96. package/build/lib/types/CustomCharacteristicType.d.ts +0 -6
  97. package/build/lib/types/HAPHostConfigType.d.ts +0 -22
  98. package/build/lib/types/HAPHostNodeType.d.ts +0 -14
  99. package/build/lib/types/HAPService2ConfigType.d.ts +0 -6
  100. package/build/lib/types/HAPService2NodeType.d.ts +0 -7
  101. package/build/lib/types/HAPServiceConfigType.d.ts +0 -26
  102. package/build/lib/types/HAPServiceNodeType.d.ts +0 -38
  103. package/build/lib/types/HAPStatusConfigType.d.ts +0 -5
  104. package/build/lib/types/HAPStatusNodeType.d.ts +0 -12
  105. package/build/lib/types/HostType.d.ts +0 -5
  106. package/build/lib/types/NodeType.d.ts +0 -3
  107. package/build/lib/types/PublishTimersType.d.ts +0 -4
  108. package/build/lib/types/hap-nodejs/HapAdaptiveLightingControllerMode.d.ts +0 -5
  109. package/build/lib/types/hap-nodejs/HapCategories.d.ts +0 -41
  110. package/build/lib/types/storage/SerializedHostType.d.ts +0 -5
  111. package/build/lib/types/storage/StorageType.d.ts +0 -8
  112. package/build/lib/utils/AccessoryUtils.d.ts +0 -1
  113. package/build/lib/utils/BridgeUtils.d.ts +0 -1
  114. package/build/lib/utils/CharacteristicUtils.d.ts +0 -1
  115. package/build/lib/utils/CharacteristicUtils2.d.ts +0 -1
  116. package/build/lib/utils/NodeStatusUtils.d.ts +0 -17
  117. package/build/lib/utils/ServiceUtils.d.ts +0 -1
  118. package/build/lib/utils/ServiceUtils2.d.ts +0 -1
  119. package/build/lib/utils/index.d.ts +0 -1
  120. package/build/nodes/bridge.d.ts +0 -1
  121. package/build/nodes/nrchkb.d.ts +0 -1
  122. package/build/nodes/service.d.ts +0 -1
  123. package/build/nodes/service2.d.ts +0 -1
  124. package/build/nodes/standalone.d.ts +0 -1
  125. package/build/nodes/status.d.ts +0 -1
@@ -1,6 +0,0 @@
1
- import { CharacteristicProps } from '@homebridge/hap-nodejs';
2
- type CustomCharacteristicType = CharacteristicProps & {
3
- UUID?: string;
4
- name?: string;
5
- };
6
- export default CustomCharacteristicType;
@@ -1,22 +0,0 @@
1
- import { MDNSAdvertiser } from '@homebridge/hap-nodejs';
2
- import { NodeDef } from 'node-red';
3
- import { SemVer } from 'semver';
4
- import HapCategories from './hap-nodejs/HapCategories';
5
- type HAPHostConfigType = NodeDef & {
6
- bridgeName: string;
7
- pinCode: string;
8
- port?: number;
9
- allowInsecureRequest: boolean;
10
- manufacturer: string;
11
- model: string;
12
- serialNo: string;
13
- firmwareRev: SemVer;
14
- hardwareRev: SemVer;
15
- softwareRev: SemVer;
16
- bind?: string;
17
- bindType?: 'json' | 'str';
18
- allowMessagePassthrough: boolean;
19
- accessoryCategory: HapCategories;
20
- advertiser: MDNSAdvertiser;
21
- };
22
- export default HAPHostConfigType;
@@ -1,14 +0,0 @@
1
- import { Accessory, Categories } from '@homebridge/hap-nodejs';
2
- import HAPHostConfigType from './HAPHostConfigType';
3
- import HostType from './HostType';
4
- import NodeType from './NodeType';
5
- type HAPHostNodeType = NodeType & {
6
- config: HAPHostConfigType;
7
- accessoryCategory: Categories;
8
- published: boolean;
9
- bridgeUsername: string;
10
- publish: () => boolean;
11
- hostType: HostType;
12
- host: Accessory;
13
- };
14
- export default HAPHostNodeType;
@@ -1,6 +0,0 @@
1
- import { NodeDef } from 'node-red';
2
- import HAPServiceConfigType from './HAPServiceConfigType';
3
- type HAPService2ConfigType = NodeDef & HAPServiceConfigType & {
4
- useEventCallback: boolean;
5
- };
6
- export default HAPService2ConfigType;
@@ -1,7 +0,0 @@
1
- import HAPService2ConfigType from './HAPService2ConfigType';
2
- import HAPServiceNodeType from './HAPServiceNodeType';
3
- import NodeType from './NodeType';
4
- type HAPService2NodeType = NodeType & HAPServiceNodeType & {
5
- config: HAPService2ConfigType;
6
- };
7
- export default HAPService2NodeType;
@@ -1,26 +0,0 @@
1
- import { AdaptiveLightingControllerMode } from '@homebridge/hap-nodejs/dist/lib/controller/AdaptiveLightingController';
2
- import { NodeDef } from 'node-red';
3
- import CameraConfigType from './CameraConfigType';
4
- type HAPServiceConfigType = NodeDef & {
5
- isParent: boolean;
6
- hostType: number;
7
- bridge: string;
8
- accessoryId: string;
9
- parentService: string;
10
- name: string;
11
- serviceName: string;
12
- topic: string;
13
- filter: boolean;
14
- manufacturer: string;
15
- model: string;
16
- serialNo: string;
17
- firmwareRev?: string;
18
- hardwareRev?: string;
19
- softwareRev?: string;
20
- characteristicProperties: string;
21
- waitForSetupMsg: boolean;
22
- adaptiveLightingOptionsEnable?: boolean;
23
- adaptiveLightingOptionsMode?: AdaptiveLightingControllerMode;
24
- adaptiveLightingOptionsCustomTemperatureAdjustment?: number;
25
- } & CameraConfigType;
26
- export default HAPServiceConfigType;
@@ -1,38 +0,0 @@
1
- import { Accessory, AdaptiveLightingController, Characteristic, CharacteristicChange, CharacteristicGetCallback, CharacteristicProps, CharacteristicSetCallback, CharacteristicValue, Service } from '@homebridge/hap-nodejs';
2
- import { CharacteristicContext } from '@homebridge/hap-nodejs/dist/lib/Characteristic';
3
- import { HAPConnection } from '@homebridge/hap-nodejs/dist/lib/util/eventedhttp';
4
- import { NodeAPI } from 'node-red';
5
- import { NodeStatusUtils } from '../utils/NodeStatusUtils';
6
- import HAPHostNodeType from './HAPHostNodeType';
7
- import HAPService2NodeType from './HAPService2NodeType';
8
- import HAPServiceConfigType from './HAPServiceConfigType';
9
- import NodeType from './NodeType';
10
- import PublishTimersType from './PublishTimersType';
11
- type HAPServiceNodeType = NodeType & {
12
- config: HAPServiceConfigType;
13
- RED: NodeAPI;
14
- setupDone: boolean;
15
- configured: boolean;
16
- handleWaitForSetup: (msg: any) => any;
17
- onIdentify: (paired: boolean, callback: () => any) => void;
18
- hostNode: HAPHostNodeType;
19
- childNodes?: (HAPService2NodeType | HAPServiceNodeType)[];
20
- service: Service;
21
- parentService: Service;
22
- parentNode?: HAPService2NodeType | HAPServiceNodeType;
23
- accessory: Accessory;
24
- characteristicProperties: {
25
- [key: string]: CharacteristicProps;
26
- };
27
- supported: string[];
28
- publishTimers: PublishTimersType;
29
- topic_in: string;
30
- onCharacteristicGet: (this: Characteristic, callback: CharacteristicGetCallback, context: CharacteristicContext, connection?: HAPConnection) => void;
31
- onCharacteristicSet: (this: Characteristic, value: CharacteristicValue, callback: CharacteristicSetCallback, context: CharacteristicContext, connection?: HAPConnection) => void;
32
- onCharacteristicChange: (this: Characteristic, change: CharacteristicChange) => void;
33
- uniqueIdentifier: string;
34
- reachable?: boolean;
35
- nodeStatusUtils: NodeStatusUtils;
36
- adaptiveLightingController?: AdaptiveLightingController;
37
- };
38
- export default HAPServiceNodeType;
@@ -1,5 +0,0 @@
1
- import { NodeDef } from 'node-red';
2
- type HAPStatusConfigType = NodeDef & {
3
- serviceNodeId: string;
4
- };
5
- export default HAPStatusConfigType;
@@ -1,12 +0,0 @@
1
- import { NodeAPI } from 'node-red';
2
- import { NodeStatusUtils } from '../utils/NodeStatusUtils';
3
- import HAPServiceNodeType from './HAPServiceNodeType';
4
- import HAPStatusConfigType from './HAPStatusConfigType';
5
- import NodeType from './NodeType';
6
- type HAPStatusNodeType = NodeType & {
7
- config: HAPStatusConfigType;
8
- RED: NodeAPI;
9
- serviceNode?: HAPServiceNodeType;
10
- nodeStatusUtils: NodeStatusUtils;
11
- };
12
- export default HAPStatusNodeType;
@@ -1,5 +0,0 @@
1
- declare enum HostType {
2
- BRIDGE = 0,
3
- STANDALONE = 1
4
- }
5
- export default HostType;
@@ -1,3 +0,0 @@
1
- import { Node } from 'node-red';
2
- type NodeType = Node;
3
- export default NodeType;
@@ -1,4 +0,0 @@
1
- type PublishTimersType = {
2
- [key: string]: NodeJS.Timeout;
3
- };
4
- export default PublishTimersType;
@@ -1,5 +0,0 @@
1
- declare enum HapAdaptiveLightingControllerMode {
2
- AUTOMATIC = 1,
3
- MANUAL = 2
4
- }
5
- export default HapAdaptiveLightingControllerMode;
@@ -1,41 +0,0 @@
1
- declare enum HapCategories {
2
- OTHER = 1,
3
- BRIDGE = 2,
4
- FAN = 3,
5
- GARAGE_DOOR_OPENER = 4,
6
- LIGHTBULB = 5,
7
- DOOR_LOCK = 6,
8
- OUTLET = 7,
9
- SWITCH = 8,
10
- THERMOSTAT = 9,
11
- SENSOR = 10,
12
- ALARM_SYSTEM = 11,
13
- SECURITY_SYSTEM = 11,
14
- DOOR = 12,
15
- WINDOW = 13,
16
- WINDOW_COVERING = 14,
17
- PROGRAMMABLE_SWITCH = 15,
18
- RANGE_EXTENDER = 16,
19
- CAMERA = 17,
20
- IP_CAMERA = 17,
21
- VIDEO_DOORBELL = 18,
22
- AIR_PURIFIER = 19,
23
- AIR_HEATER = 20,
24
- AIR_CONDITIONER = 21,
25
- AIR_HUMIDIFIER = 22,
26
- AIR_DEHUMIDIFIER = 23,
27
- APPLE_TV = 24,
28
- HOMEPOD = 25,
29
- SPEAKER = 26,
30
- AIRPORT = 27,
31
- SPRINKLER = 28,
32
- FAUCET = 29,
33
- SHOWER_HEAD = 30,
34
- TELEVISION = 31,
35
- TARGET_CONTROLLER = 32,
36
- ROUTER = 33,
37
- AUDIO_RECEIVER = 34,
38
- TV_SET_TOP_BOX = 35,
39
- TV_STREAMING_STICK = 36
40
- }
41
- export default HapCategories;
@@ -1,5 +0,0 @@
1
- import { SerializedAccessory } from '@homebridge/hap-nodejs';
2
- type SerializedHostType = {
3
- _isBridge: boolean;
4
- } & SerializedAccessory;
5
- export { SerializedHostType };
@@ -1,8 +0,0 @@
1
- declare enum StorageType {
2
- SERVICE = "service",
3
- ACCESSORY = "accessory",
4
- HOST = "host",
5
- CUSTOM_CHARACTERISTICS = "customCharacteristics",
6
- OTHER = "other"
7
- }
8
- export { StorageType };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,17 +0,0 @@
1
- import { NodeStatus } from '@node-red/registry';
2
- import NodeType from '../types/NodeType';
3
- type StatusType = 'NO_RESPONSE' | 'MSG';
4
- type NodeStatusWithType = NodeStatus & {
5
- type?: StatusType;
6
- };
7
- type Status = string | NodeStatusWithType;
8
- export declare class NodeStatusUtils {
9
- private node;
10
- protected lastStatusId?: number;
11
- protected lastStatusType?: StatusType;
12
- constructor(node: Pick<NodeType, 'status'>);
13
- setStatus(status: Status, timeout?: number): number;
14
- clearStatusByType(type: StatusType): void;
15
- clearStatus(statusId?: number, timeout?: number): void;
16
- }
17
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};