zigbee-herdsman 5.0.3 → 6.0.0
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.
- package/.github/dependabot.yml +3 -0
- package/.github/workflows/ci.yml +1 -0
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +26 -0
- package/biome.json +1 -1
- package/dist/adapter/deconz/adapter/deconzAdapter.js +1 -1
- package/dist/adapter/deconz/adapter/deconzAdapter.js.map +1 -1
- package/dist/adapter/ember/ezsp/buffalo.d.ts +0 -2
- package/dist/adapter/ember/ezsp/buffalo.d.ts.map +1 -1
- package/dist/adapter/ember/ezsp/buffalo.js +0 -4
- package/dist/adapter/ember/ezsp/buffalo.js.map +1 -1
- package/dist/adapter/ember/uart/ash.d.ts.map +1 -1
- package/dist/adapter/ember/uart/ash.js +0 -2
- package/dist/adapter/ember/uart/ash.js.map +1 -1
- package/dist/buffalo/buffalo.d.ts +5 -0
- package/dist/buffalo/buffalo.d.ts.map +1 -1
- package/dist/buffalo/buffalo.js +7 -0
- package/dist/buffalo/buffalo.js.map +1 -1
- package/dist/controller/controller.d.ts.map +1 -1
- package/dist/controller/controller.js +1 -1
- package/dist/controller/controller.js.map +1 -1
- package/dist/controller/events.d.ts +1 -0
- package/dist/controller/events.d.ts.map +1 -1
- package/dist/controller/tstype.d.ts +17 -0
- package/dist/controller/tstype.d.ts.map +1 -1
- package/dist/zspec/zcl/buffaloZcl.d.ts +32 -17
- package/dist/zspec/zcl/buffaloZcl.d.ts.map +1 -1
- package/dist/zspec/zcl/buffaloZcl.js +257 -121
- package/dist/zspec/zcl/buffaloZcl.js.map +1 -1
- package/dist/zspec/zcl/definition/cluster.d.ts.map +1 -1
- package/dist/zspec/zcl/definition/cluster.js +154 -24
- package/dist/zspec/zcl/definition/cluster.js.map +1 -1
- package/dist/zspec/zcl/definition/clusters-typegen.d.ts +2 -0
- package/dist/zspec/zcl/definition/clusters-typegen.d.ts.map +1 -0
- package/dist/zspec/zcl/definition/clusters-typegen.js +300 -0
- package/dist/zspec/zcl/definition/clusters-typegen.js.map +1 -0
- package/dist/zspec/zcl/definition/clusters-types.d.ts +7205 -0
- package/dist/zspec/zcl/definition/clusters-types.d.ts.map +1 -0
- package/dist/zspec/zcl/definition/clusters-types.js +3 -0
- package/dist/zspec/zcl/definition/clusters-types.js.map +1 -0
- package/dist/zspec/zcl/definition/enums.d.ts +4 -6
- package/dist/zspec/zcl/definition/enums.d.ts.map +1 -1
- package/dist/zspec/zcl/definition/enums.js +3 -5
- package/dist/zspec/zcl/definition/enums.js.map +1 -1
- package/dist/zspec/zcl/definition/foundation.d.ts.map +1 -1
- package/dist/zspec/zcl/definition/foundation.js +43 -15
- package/dist/zspec/zcl/definition/foundation.js.map +1 -1
- package/dist/zspec/zcl/definition/tstype.d.ts +105 -11
- package/dist/zspec/zcl/definition/tstype.d.ts.map +1 -1
- package/dist/zspec/zcl/zclFrame.d.ts.map +1 -1
- package/dist/zspec/zcl/zclFrame.js +32 -20
- package/dist/zspec/zcl/zclFrame.js.map +1 -1
- package/dist/zspec/zdo/buffaloZdo.d.ts +0 -6
- package/dist/zspec/zdo/buffaloZdo.d.ts.map +1 -1
- package/dist/zspec/zdo/buffaloZdo.js +0 -8
- package/dist/zspec/zdo/buffaloZdo.js.map +1 -1
- package/package.json +3 -3
- package/src/adapter/deconz/adapter/deconzAdapter.ts +1 -1
- package/src/adapter/ember/ezsp/buffalo.ts +0 -5
- package/src/adapter/ember/uart/ash.ts +0 -2
- package/src/buffalo/buffalo.ts +8 -0
- package/src/controller/controller.ts +2 -1
- package/src/controller/events.ts +1 -0
- package/src/controller/greenPower.ts +4 -4
- package/src/controller/tstype.ts +17 -16
- package/src/zspec/zcl/buffaloZcl.ts +323 -238
- package/src/zspec/zcl/definition/cluster.ts +154 -24
- package/src/zspec/zcl/definition/clusters-typegen.ts +511 -0
- package/src/zspec/zcl/definition/clusters-types.ts +7282 -0
- package/src/zspec/zcl/definition/enums.ts +3 -5
- package/src/zspec/zcl/definition/foundation.ts +43 -15
- package/src/zspec/zcl/definition/tstype.ts +118 -7
- package/src/zspec/zcl/zclFrame.ts +37 -19
- package/src/zspec/zdo/buffaloZdo.ts +0 -9
- package/test/controller.test.ts +65 -803
- package/test/greenpower.test.ts +0 -12
- package/test/zcl.test.ts +13 -11
- package/test/zspec/zcl/buffalo.test.ts +216 -74
- package/test/zspec/zcl/frame.test.ts +62 -28
package/test/controller.test.ts
CHANGED
|
@@ -2456,77 +2456,8 @@ describe("Controller", () => {
|
|
|
2456
2456
|
const expected = {
|
|
2457
2457
|
cluster: "msOccupancySensing",
|
|
2458
2458
|
type: "attributeReport",
|
|
2459
|
-
device:
|
|
2460
|
-
|
|
2461
|
-
_events: {},
|
|
2462
|
-
_eventsCount: 0,
|
|
2463
|
-
_ieeeAddr: "0x129",
|
|
2464
|
-
_pendingRequestTimeout: 0,
|
|
2465
|
-
_networkAddress: 129,
|
|
2466
|
-
_lastSeen: Date.now(),
|
|
2467
|
-
_linkquality: 50,
|
|
2468
|
-
_skipDefaultResponse: false,
|
|
2469
|
-
_customClusters: {},
|
|
2470
|
-
_endpoints: [
|
|
2471
|
-
{
|
|
2472
|
-
ID: 1,
|
|
2473
|
-
_events: {},
|
|
2474
|
-
_eventsCount: 0,
|
|
2475
|
-
inputClusters: [0, 1],
|
|
2476
|
-
outputClusters: [2],
|
|
2477
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2478
|
-
_binds: [],
|
|
2479
|
-
_configuredReportings: [],
|
|
2480
|
-
meta: {},
|
|
2481
|
-
deviceNetworkAddress: 129,
|
|
2482
|
-
deviceIeeeAddress: "0x129",
|
|
2483
|
-
deviceID: 5,
|
|
2484
|
-
profileID: 99,
|
|
2485
|
-
clusters: {
|
|
2486
|
-
msOccupancySensing: {
|
|
2487
|
-
attributes: {
|
|
2488
|
-
occupancy: 1,
|
|
2489
|
-
},
|
|
2490
|
-
},
|
|
2491
|
-
},
|
|
2492
|
-
},
|
|
2493
|
-
],
|
|
2494
|
-
_type: "Router",
|
|
2495
|
-
_manufacturerID: 1212,
|
|
2496
|
-
_manufacturerName: "KoenAndCo",
|
|
2497
|
-
meta: {},
|
|
2498
|
-
_powerSource: "Mains (single phase)",
|
|
2499
|
-
_modelID: "myModelID",
|
|
2500
|
-
_applicationVersion: 2,
|
|
2501
|
-
_stackVersion: 101,
|
|
2502
|
-
_zclVersion: 1,
|
|
2503
|
-
_hardwareVersion: 3,
|
|
2504
|
-
_dateCode: "201901",
|
|
2505
|
-
_softwareBuildID: "1.01",
|
|
2506
|
-
_interviewState: InterviewState.Successful,
|
|
2507
|
-
},
|
|
2508
|
-
endpoint: {
|
|
2509
|
-
ID: 1,
|
|
2510
|
-
_events: {},
|
|
2511
|
-
_eventsCount: 0,
|
|
2512
|
-
deviceID: 5,
|
|
2513
|
-
inputClusters: [0, 1],
|
|
2514
|
-
outputClusters: [2],
|
|
2515
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2516
|
-
deviceNetworkAddress: 129,
|
|
2517
|
-
deviceIeeeAddress: "0x129",
|
|
2518
|
-
_binds: [],
|
|
2519
|
-
_configuredReportings: [],
|
|
2520
|
-
profileID: 99,
|
|
2521
|
-
meta: {},
|
|
2522
|
-
clusters: {
|
|
2523
|
-
msOccupancySensing: {
|
|
2524
|
-
attributes: {
|
|
2525
|
-
occupancy: 1,
|
|
2526
|
-
},
|
|
2527
|
-
},
|
|
2528
|
-
},
|
|
2529
|
-
},
|
|
2459
|
+
device: expect.any(Device),
|
|
2460
|
+
endpoint: expect.any(Endpoint),
|
|
2530
2461
|
data: {
|
|
2531
2462
|
occupancy: 1,
|
|
2532
2463
|
},
|
|
@@ -2541,9 +2472,11 @@ describe("Controller", () => {
|
|
|
2541
2472
|
frameType: 0,
|
|
2542
2473
|
manufacturerSpecific: false,
|
|
2543
2474
|
},
|
|
2475
|
+
manufacturerCode: undefined,
|
|
2476
|
+
rawData: expect.any(Buffer),
|
|
2544
2477
|
},
|
|
2545
2478
|
};
|
|
2546
|
-
expect(
|
|
2479
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
2547
2480
|
expect(controller.getDeviceByIeeeAddr("0x129")!.linkquality).toEqual(50);
|
|
2548
2481
|
});
|
|
2549
2482
|
|
|
@@ -2571,74 +2504,16 @@ describe("Controller", () => {
|
|
|
2571
2504
|
const expected = {
|
|
2572
2505
|
cluster: "genAlarms",
|
|
2573
2506
|
type: "raw",
|
|
2574
|
-
device:
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
_eventsCount: 0,
|
|
2578
|
-
_pendingRequestTimeout: 0,
|
|
2579
|
-
_ieeeAddr: "0x129",
|
|
2580
|
-
_networkAddress: 129,
|
|
2581
|
-
_lastSeen: Date.now(),
|
|
2582
|
-
_linkquality: 50,
|
|
2583
|
-
_skipDefaultResponse: false,
|
|
2584
|
-
_customClusters: {},
|
|
2585
|
-
_endpoints: [
|
|
2586
|
-
{
|
|
2587
|
-
ID: 1,
|
|
2588
|
-
_events: {},
|
|
2589
|
-
_eventsCount: 0,
|
|
2590
|
-
clusters: {},
|
|
2591
|
-
inputClusters: [0, 1],
|
|
2592
|
-
outputClusters: [2],
|
|
2593
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2594
|
-
deviceNetworkAddress: 129,
|
|
2595
|
-
deviceIeeeAddress: "0x129",
|
|
2596
|
-
_binds: [],
|
|
2597
|
-
_configuredReportings: [],
|
|
2598
|
-
meta: {},
|
|
2599
|
-
deviceID: 5,
|
|
2600
|
-
profileID: 99,
|
|
2601
|
-
},
|
|
2602
|
-
],
|
|
2603
|
-
_type: "Router",
|
|
2604
|
-
_manufacturerID: 1212,
|
|
2605
|
-
_manufacturerName: "KoenAndCo",
|
|
2606
|
-
meta: {},
|
|
2607
|
-
_powerSource: "Mains (single phase)",
|
|
2608
|
-
_modelID: "myModelID",
|
|
2609
|
-
_applicationVersion: 2,
|
|
2610
|
-
_stackVersion: 101,
|
|
2611
|
-
_zclVersion: 1,
|
|
2612
|
-
_hardwareVersion: 3,
|
|
2613
|
-
_dateCode: "201901",
|
|
2614
|
-
_softwareBuildID: "1.01",
|
|
2615
|
-
_interviewState: InterviewState.Successful,
|
|
2616
|
-
},
|
|
2617
|
-
endpoint: {
|
|
2618
|
-
_events: {},
|
|
2619
|
-
_eventsCount: 0,
|
|
2620
|
-
clusters: {},
|
|
2621
|
-
ID: 1,
|
|
2622
|
-
deviceID: 5,
|
|
2623
|
-
inputClusters: [0, 1],
|
|
2624
|
-
outputClusters: [2],
|
|
2625
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2626
|
-
deviceNetworkAddress: 129,
|
|
2627
|
-
deviceIeeeAddress: "0x129",
|
|
2628
|
-
_binds: [],
|
|
2629
|
-
_configuredReportings: [],
|
|
2630
|
-
profileID: 99,
|
|
2631
|
-
meta: {},
|
|
2632
|
-
},
|
|
2633
|
-
data: {
|
|
2634
|
-
data: [0, 1],
|
|
2635
|
-
type: "Buffer",
|
|
2636
|
-
},
|
|
2507
|
+
device: expect.any(Device),
|
|
2508
|
+
endpoint: expect.any(Endpoint),
|
|
2509
|
+
data: Buffer.from([0, 1]),
|
|
2637
2510
|
linkquality: 50,
|
|
2638
2511
|
groupID: 1,
|
|
2639
|
-
meta: {
|
|
2512
|
+
meta: {
|
|
2513
|
+
rawData: expect.any(Buffer),
|
|
2514
|
+
},
|
|
2640
2515
|
};
|
|
2641
|
-
expect(
|
|
2516
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
2642
2517
|
});
|
|
2643
2518
|
|
|
2644
2519
|
it("Receive raw data from unknown cluster", async () => {
|
|
@@ -2658,74 +2533,16 @@ describe("Controller", () => {
|
|
|
2658
2533
|
const expected = {
|
|
2659
2534
|
cluster: 99999999,
|
|
2660
2535
|
type: "raw",
|
|
2661
|
-
device:
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
_pendingRequestTimeout: 0,
|
|
2665
|
-
_networkAddress: 129,
|
|
2666
|
-
_lastSeen: Date.now(),
|
|
2667
|
-
_linkquality: 50,
|
|
2668
|
-
_skipDefaultResponse: false,
|
|
2669
|
-
_customClusters: {},
|
|
2670
|
-
_endpoints: [
|
|
2671
|
-
{
|
|
2672
|
-
ID: 1,
|
|
2673
|
-
_events: {},
|
|
2674
|
-
_eventsCount: 0,
|
|
2675
|
-
clusters: {},
|
|
2676
|
-
inputClusters: [0, 1],
|
|
2677
|
-
outputClusters: [2],
|
|
2678
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2679
|
-
deviceNetworkAddress: 129,
|
|
2680
|
-
deviceIeeeAddress: "0x129",
|
|
2681
|
-
_binds: [],
|
|
2682
|
-
_configuredReportings: [],
|
|
2683
|
-
meta: {},
|
|
2684
|
-
deviceID: 5,
|
|
2685
|
-
profileID: 99,
|
|
2686
|
-
},
|
|
2687
|
-
],
|
|
2688
|
-
_events: {},
|
|
2689
|
-
_eventsCount: 0,
|
|
2690
|
-
_type: "Router",
|
|
2691
|
-
_manufacturerID: 1212,
|
|
2692
|
-
_manufacturerName: "KoenAndCo",
|
|
2693
|
-
meta: {},
|
|
2694
|
-
_powerSource: "Mains (single phase)",
|
|
2695
|
-
_modelID: "myModelID",
|
|
2696
|
-
_applicationVersion: 2,
|
|
2697
|
-
_stackVersion: 101,
|
|
2698
|
-
_zclVersion: 1,
|
|
2699
|
-
_hardwareVersion: 3,
|
|
2700
|
-
_dateCode: "201901",
|
|
2701
|
-
_softwareBuildID: "1.01",
|
|
2702
|
-
_interviewState: InterviewState.Successful,
|
|
2703
|
-
},
|
|
2704
|
-
endpoint: {
|
|
2705
|
-
_events: {},
|
|
2706
|
-
_eventsCount: 0,
|
|
2707
|
-
clusters: {},
|
|
2708
|
-
ID: 1,
|
|
2709
|
-
deviceID: 5,
|
|
2710
|
-
inputClusters: [0, 1],
|
|
2711
|
-
outputClusters: [2],
|
|
2712
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2713
|
-
deviceNetworkAddress: 129,
|
|
2714
|
-
deviceIeeeAddress: "0x129",
|
|
2715
|
-
_binds: [],
|
|
2716
|
-
_configuredReportings: [],
|
|
2717
|
-
profileID: 99,
|
|
2718
|
-
meta: {},
|
|
2719
|
-
},
|
|
2720
|
-
data: {
|
|
2721
|
-
data: [0, 1, 2, 3],
|
|
2722
|
-
type: "Buffer",
|
|
2723
|
-
},
|
|
2536
|
+
device: expect.any(Device),
|
|
2537
|
+
endpoint: expect.any(Endpoint),
|
|
2538
|
+
data: Buffer.from([0, 1, 2, 3]),
|
|
2724
2539
|
linkquality: 50,
|
|
2725
2540
|
groupID: 1,
|
|
2726
|
-
meta: {
|
|
2541
|
+
meta: {
|
|
2542
|
+
rawData: Buffer.from([0, 1, 2, 3]),
|
|
2543
|
+
},
|
|
2727
2544
|
};
|
|
2728
|
-
expect(
|
|
2545
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
2729
2546
|
});
|
|
2730
2547
|
|
|
2731
2548
|
it("Receive zclData from unkonwn device shouldnt emit anything", async () => {
|
|
@@ -2767,90 +2584,9 @@ describe("Controller", () => {
|
|
|
2767
2584
|
const expected = {
|
|
2768
2585
|
cluster: "genBasic",
|
|
2769
2586
|
type: "readResponse",
|
|
2770
|
-
device:
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
_eventsCount: 0,
|
|
2774
|
-
_ieeeAddr: "0x129",
|
|
2775
|
-
_lastSeen: Date.now(),
|
|
2776
|
-
_pendingRequestTimeout: 0,
|
|
2777
|
-
_linkquality: 52,
|
|
2778
|
-
_skipDefaultResponse: false,
|
|
2779
|
-
_networkAddress: 129,
|
|
2780
|
-
_customClusters: {},
|
|
2781
|
-
_endpoints: [
|
|
2782
|
-
{
|
|
2783
|
-
clusters: {},
|
|
2784
|
-
ID: 1,
|
|
2785
|
-
_events: {},
|
|
2786
|
-
_eventsCount: 0,
|
|
2787
|
-
inputClusters: [0, 1],
|
|
2788
|
-
outputClusters: [2],
|
|
2789
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2790
|
-
deviceNetworkAddress: 129,
|
|
2791
|
-
deviceIeeeAddress: "0x129",
|
|
2792
|
-
_binds: [],
|
|
2793
|
-
_configuredReportings: [],
|
|
2794
|
-
deviceID: 5,
|
|
2795
|
-
profileID: 99,
|
|
2796
|
-
meta: {},
|
|
2797
|
-
},
|
|
2798
|
-
{
|
|
2799
|
-
ID: 3,
|
|
2800
|
-
_events: {},
|
|
2801
|
-
_eventsCount: 0,
|
|
2802
|
-
clusters: {
|
|
2803
|
-
genBasic: {
|
|
2804
|
-
attributes: {
|
|
2805
|
-
appVersion: 3,
|
|
2806
|
-
},
|
|
2807
|
-
},
|
|
2808
|
-
},
|
|
2809
|
-
inputClusters: [],
|
|
2810
|
-
outputClusters: [],
|
|
2811
|
-
pendingRequests: {id: 3, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2812
|
-
deviceNetworkAddress: 129,
|
|
2813
|
-
deviceIeeeAddress: "0x129",
|
|
2814
|
-
_binds: [],
|
|
2815
|
-
_configuredReportings: [],
|
|
2816
|
-
meta: {},
|
|
2817
|
-
},
|
|
2818
|
-
],
|
|
2819
|
-
_type: "Router",
|
|
2820
|
-
_manufacturerID: 1212,
|
|
2821
|
-
_manufacturerName: "KoenAndCo",
|
|
2822
|
-
meta: {},
|
|
2823
|
-
_powerSource: "Mains (single phase)",
|
|
2824
|
-
_modelID: "myModelID",
|
|
2825
|
-
_applicationVersion: 3,
|
|
2826
|
-
_stackVersion: 101,
|
|
2827
|
-
_zclVersion: 1,
|
|
2828
|
-
_hardwareVersion: 3,
|
|
2829
|
-
_dateCode: "201901",
|
|
2830
|
-
_softwareBuildID: "1.01",
|
|
2831
|
-
_interviewState: InterviewState.Successful,
|
|
2832
|
-
_lastDefaultResponseSequenceNumber: 1,
|
|
2833
|
-
},
|
|
2834
|
-
endpoint: {
|
|
2835
|
-
ID: 3,
|
|
2836
|
-
_events: {},
|
|
2837
|
-
_eventsCount: 0,
|
|
2838
|
-
inputClusters: [],
|
|
2839
|
-
outputClusters: [],
|
|
2840
|
-
pendingRequests: {id: 3, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2841
|
-
meta: {},
|
|
2842
|
-
deviceNetworkAddress: 129,
|
|
2843
|
-
deviceIeeeAddress: "0x129",
|
|
2844
|
-
_binds: [],
|
|
2845
|
-
_configuredReportings: [],
|
|
2846
|
-
clusters: {
|
|
2847
|
-
genBasic: {
|
|
2848
|
-
attributes: {
|
|
2849
|
-
appVersion: 3,
|
|
2850
|
-
},
|
|
2851
|
-
},
|
|
2852
|
-
},
|
|
2853
|
-
},
|
|
2587
|
+
device: expect.any(Device),
|
|
2588
|
+
endpoint: expect.any(Endpoint),
|
|
2589
|
+
groupID: undefined,
|
|
2854
2590
|
data: {
|
|
2855
2591
|
appVersion: 3,
|
|
2856
2592
|
},
|
|
@@ -2864,9 +2600,11 @@ describe("Controller", () => {
|
|
|
2864
2600
|
frameType: 0,
|
|
2865
2601
|
manufacturerSpecific: false,
|
|
2866
2602
|
},
|
|
2603
|
+
manufacturerCode: undefined,
|
|
2604
|
+
rawData: expect.any(Buffer),
|
|
2867
2605
|
},
|
|
2868
2606
|
};
|
|
2869
|
-
expect(
|
|
2607
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
2870
2608
|
expect(controller.getDeviceByIeeeAddr("0x129")!.endpoints.length).toBe(2);
|
|
2871
2609
|
});
|
|
2872
2610
|
|
|
@@ -2890,66 +2628,8 @@ describe("Controller", () => {
|
|
|
2890
2628
|
const expected = {
|
|
2891
2629
|
cluster: "genScenes",
|
|
2892
2630
|
type: "commandTradfriArrowSingle",
|
|
2893
|
-
device:
|
|
2894
|
-
|
|
2895
|
-
_events: {},
|
|
2896
|
-
_eventsCount: 0,
|
|
2897
|
-
_pendingRequestTimeout: 0,
|
|
2898
|
-
_lastSeen: Date.now(),
|
|
2899
|
-
_linkquality: 19,
|
|
2900
|
-
_skipDefaultResponse: false,
|
|
2901
|
-
_ieeeAddr: "0x129",
|
|
2902
|
-
_networkAddress: 129,
|
|
2903
|
-
_customClusters: {},
|
|
2904
|
-
_endpoints: [
|
|
2905
|
-
{
|
|
2906
|
-
ID: 1,
|
|
2907
|
-
_events: {},
|
|
2908
|
-
_eventsCount: 0,
|
|
2909
|
-
clusters: {},
|
|
2910
|
-
inputClusters: [0, 1],
|
|
2911
|
-
outputClusters: [2],
|
|
2912
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2913
|
-
deviceNetworkAddress: 129,
|
|
2914
|
-
deviceIeeeAddress: "0x129",
|
|
2915
|
-
_binds: [],
|
|
2916
|
-
_configuredReportings: [],
|
|
2917
|
-
meta: {},
|
|
2918
|
-
deviceID: 5,
|
|
2919
|
-
profileID: 99,
|
|
2920
|
-
},
|
|
2921
|
-
],
|
|
2922
|
-
_type: "Router",
|
|
2923
|
-
_manufacturerID: 1212,
|
|
2924
|
-
_manufacturerName: "KoenAndCo",
|
|
2925
|
-
meta: {},
|
|
2926
|
-
_powerSource: "Mains (single phase)",
|
|
2927
|
-
_modelID: "myModelID",
|
|
2928
|
-
_applicationVersion: 2,
|
|
2929
|
-
_stackVersion: 101,
|
|
2930
|
-
_zclVersion: 1,
|
|
2931
|
-
_hardwareVersion: 3,
|
|
2932
|
-
_dateCode: "201901",
|
|
2933
|
-
_softwareBuildID: "1.01",
|
|
2934
|
-
_interviewState: InterviewState.Successful,
|
|
2935
|
-
_lastDefaultResponseSequenceNumber: 29,
|
|
2936
|
-
},
|
|
2937
|
-
endpoint: {
|
|
2938
|
-
_events: {},
|
|
2939
|
-
_eventsCount: 0,
|
|
2940
|
-
ID: 1,
|
|
2941
|
-
clusters: {},
|
|
2942
|
-
inputClusters: [0, 1],
|
|
2943
|
-
outputClusters: [2],
|
|
2944
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
2945
|
-
deviceNetworkAddress: 129,
|
|
2946
|
-
deviceIeeeAddress: "0x129",
|
|
2947
|
-
_binds: [],
|
|
2948
|
-
_configuredReportings: [],
|
|
2949
|
-
deviceID: 5,
|
|
2950
|
-
profileID: 99,
|
|
2951
|
-
meta: {},
|
|
2952
|
-
},
|
|
2631
|
+
device: expect.any(Device),
|
|
2632
|
+
endpoint: expect.any(Endpoint),
|
|
2953
2633
|
data: {
|
|
2954
2634
|
value: 256,
|
|
2955
2635
|
value2: 13,
|
|
@@ -2966,9 +2646,10 @@ describe("Controller", () => {
|
|
|
2966
2646
|
frameType: 1,
|
|
2967
2647
|
manufacturerSpecific: true,
|
|
2968
2648
|
},
|
|
2649
|
+
rawData: expect.any(Buffer),
|
|
2969
2650
|
},
|
|
2970
2651
|
};
|
|
2971
|
-
expect(
|
|
2652
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
2972
2653
|
});
|
|
2973
2654
|
|
|
2974
2655
|
it("Receive cluster command from unknown cluster", async () => {
|
|
@@ -3282,16 +2963,10 @@ describe("Controller", () => {
|
|
|
3282
2963
|
},
|
|
3283
2964
|
payload: [{attrId: 28, attrData: 3, dataType: 48, status: 0}],
|
|
3284
2965
|
cluster: null,
|
|
3285
|
-
command: {
|
|
2966
|
+
command: expect.objectContaining({
|
|
3286
2967
|
ID: 1,
|
|
3287
2968
|
name: "readRsp",
|
|
3288
|
-
|
|
3289
|
-
{name: "attrId", type: 33},
|
|
3290
|
-
{name: "status", type: 32},
|
|
3291
|
-
{name: "dataType", type: 32, conditions: [{type: "statusEquals", value: 0}]},
|
|
3292
|
-
{name: "attrData", type: 1000, conditions: [{type: "statusEquals", value: 0}]},
|
|
3293
|
-
],
|
|
3294
|
-
},
|
|
2969
|
+
}),
|
|
3295
2970
|
});
|
|
3296
2971
|
});
|
|
3297
2972
|
|
|
@@ -3549,97 +3224,8 @@ describe("Controller", () => {
|
|
|
3549
3224
|
const expected = {
|
|
3550
3225
|
cluster: "genBasic",
|
|
3551
3226
|
type: "attributeReport",
|
|
3552
|
-
device:
|
|
3553
|
-
|
|
3554
|
-
_eventsCount: 0,
|
|
3555
|
-
_lastSeen: Date.now(),
|
|
3556
|
-
_linkquality: 50,
|
|
3557
|
-
_skipDefaultResponse: false,
|
|
3558
|
-
ID: 2,
|
|
3559
|
-
_ieeeAddr: "0x129",
|
|
3560
|
-
_networkAddress: 129,
|
|
3561
|
-
_customClusters: {},
|
|
3562
|
-
_endpoints: [
|
|
3563
|
-
{
|
|
3564
|
-
_events: {},
|
|
3565
|
-
_eventsCount: 0,
|
|
3566
|
-
ID: 1,
|
|
3567
|
-
clusters: {
|
|
3568
|
-
genBasic: {
|
|
3569
|
-
attributes: {
|
|
3570
|
-
"65281": {
|
|
3571
|
-
"1": 3285,
|
|
3572
|
-
"10": 0,
|
|
3573
|
-
"100": 0,
|
|
3574
|
-
"3": 33,
|
|
3575
|
-
"4": 5032,
|
|
3576
|
-
"5": 43,
|
|
3577
|
-
"6": 327680,
|
|
3578
|
-
"8": 516,
|
|
3579
|
-
},
|
|
3580
|
-
modelId: "lumi.sensor_wleak.aq1",
|
|
3581
|
-
},
|
|
3582
|
-
},
|
|
3583
|
-
},
|
|
3584
|
-
inputClusters: [0, 1],
|
|
3585
|
-
outputClusters: [2],
|
|
3586
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
3587
|
-
deviceNetworkAddress: 129,
|
|
3588
|
-
deviceIeeeAddress: "0x129",
|
|
3589
|
-
_binds: [],
|
|
3590
|
-
_configuredReportings: [],
|
|
3591
|
-
meta: {},
|
|
3592
|
-
deviceID: 5,
|
|
3593
|
-
profileID: 99,
|
|
3594
|
-
},
|
|
3595
|
-
],
|
|
3596
|
-
_type: "Router",
|
|
3597
|
-
_manufacturerID: 1212,
|
|
3598
|
-
_manufacturerName: "KoenAndCo",
|
|
3599
|
-
meta: {},
|
|
3600
|
-
_powerSource: "Mains (single phase)",
|
|
3601
|
-
_modelID: "lumi.sensor_wleak.aq1",
|
|
3602
|
-
_applicationVersion: 2,
|
|
3603
|
-
_stackVersion: 101,
|
|
3604
|
-
_zclVersion: 1,
|
|
3605
|
-
_hardwareVersion: 3,
|
|
3606
|
-
_dateCode: "201901",
|
|
3607
|
-
_pendingRequestTimeout: 0,
|
|
3608
|
-
_softwareBuildID: "1.01",
|
|
3609
|
-
_interviewState: InterviewState.Successful,
|
|
3610
|
-
},
|
|
3611
|
-
endpoint: {
|
|
3612
|
-
_events: {},
|
|
3613
|
-
_eventsCount: 0,
|
|
3614
|
-
ID: 1,
|
|
3615
|
-
deviceID: 5,
|
|
3616
|
-
inputClusters: [0, 1],
|
|
3617
|
-
outputClusters: [2],
|
|
3618
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
3619
|
-
deviceNetworkAddress: 129,
|
|
3620
|
-
deviceIeeeAddress: "0x129",
|
|
3621
|
-
_binds: [],
|
|
3622
|
-
_configuredReportings: [],
|
|
3623
|
-
profileID: 99,
|
|
3624
|
-
meta: {},
|
|
3625
|
-
clusters: {
|
|
3626
|
-
genBasic: {
|
|
3627
|
-
attributes: {
|
|
3628
|
-
"65281": {
|
|
3629
|
-
"1": 3285,
|
|
3630
|
-
"10": 0,
|
|
3631
|
-
"100": 0,
|
|
3632
|
-
"3": 33,
|
|
3633
|
-
"4": 5032,
|
|
3634
|
-
"5": 43,
|
|
3635
|
-
"6": 327680,
|
|
3636
|
-
"8": 516,
|
|
3637
|
-
},
|
|
3638
|
-
modelId: "lumi.sensor_wleak.aq1",
|
|
3639
|
-
},
|
|
3640
|
-
},
|
|
3641
|
-
},
|
|
3642
|
-
},
|
|
3227
|
+
device: expect.any(Device),
|
|
3228
|
+
endpoint: expect.any(Endpoint),
|
|
3643
3229
|
data: {
|
|
3644
3230
|
"65281": {
|
|
3645
3231
|
"1": 3285,
|
|
@@ -3665,9 +3251,10 @@ describe("Controller", () => {
|
|
|
3665
3251
|
frameType: 0,
|
|
3666
3252
|
manufacturerSpecific: true,
|
|
3667
3253
|
},
|
|
3254
|
+
rawData: null,
|
|
3668
3255
|
},
|
|
3669
3256
|
};
|
|
3670
|
-
expect(
|
|
3257
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
3671
3258
|
});
|
|
3672
3259
|
|
|
3673
3260
|
it("Should allow to specify custom attributes for existing cluster", async () => {
|
|
@@ -4813,14 +4400,10 @@ describe("Controller", () => {
|
|
|
4813
4400
|
},
|
|
4814
4401
|
payload: {payloadType: 0, queryJitter: 1},
|
|
4815
4402
|
cluster: expect.objectContaining({name: "genOta"}),
|
|
4816
|
-
command: {
|
|
4403
|
+
command: expect.objectContaining({
|
|
4817
4404
|
ID: 0,
|
|
4818
|
-
parameters: [
|
|
4819
|
-
{name: "payloadType", type: 32},
|
|
4820
|
-
{name: "queryJitter", type: 32},
|
|
4821
|
-
],
|
|
4822
4405
|
name: "imageNotify",
|
|
4823
|
-
},
|
|
4406
|
+
}),
|
|
4824
4407
|
};
|
|
4825
4408
|
expect(deepClone(mocksendZclFrameToEndpoint.mock.calls[0][3])).toStrictEqual(expected);
|
|
4826
4409
|
expect(mocksendZclFrameToEndpoint.mock.calls[0][4]).toBe(10000);
|
|
@@ -6002,65 +5585,8 @@ describe("Controller", () => {
|
|
|
6002
5585
|
|
|
6003
5586
|
const expected = {
|
|
6004
5587
|
type: "read",
|
|
6005
|
-
device:
|
|
6006
|
-
|
|
6007
|
-
_applicationVersion: 2,
|
|
6008
|
-
_dateCode: "201901",
|
|
6009
|
-
_pendingRequestTimeout: 0,
|
|
6010
|
-
_customClusters: {},
|
|
6011
|
-
_endpoints: [
|
|
6012
|
-
{
|
|
6013
|
-
deviceID: 5,
|
|
6014
|
-
inputClusters: [0, 1],
|
|
6015
|
-
outputClusters: [2],
|
|
6016
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
6017
|
-
profileID: 99,
|
|
6018
|
-
ID: 1,
|
|
6019
|
-
clusters: {},
|
|
6020
|
-
deviceIeeeAddress: "0x129",
|
|
6021
|
-
deviceNetworkAddress: 129,
|
|
6022
|
-
_binds: [],
|
|
6023
|
-
_configuredReportings: [],
|
|
6024
|
-
_events: {},
|
|
6025
|
-
_eventsCount: 0,
|
|
6026
|
-
meta: {},
|
|
6027
|
-
},
|
|
6028
|
-
],
|
|
6029
|
-
_hardwareVersion: 3,
|
|
6030
|
-
_events: {},
|
|
6031
|
-
_eventsCount: 0,
|
|
6032
|
-
_ieeeAddr: "0x129",
|
|
6033
|
-
_interviewState: InterviewState.Successful,
|
|
6034
|
-
_lastSeen: Date.now(),
|
|
6035
|
-
_linkquality: 19,
|
|
6036
|
-
_skipDefaultResponse: false,
|
|
6037
|
-
_manufacturerID: 1212,
|
|
6038
|
-
_manufacturerName: "KoenAndCo",
|
|
6039
|
-
_modelID: "myModelID",
|
|
6040
|
-
_networkAddress: 129,
|
|
6041
|
-
_powerSource: "Mains (single phase)",
|
|
6042
|
-
_softwareBuildID: "1.01",
|
|
6043
|
-
_stackVersion: 101,
|
|
6044
|
-
_type: "Router",
|
|
6045
|
-
_zclVersion: 1,
|
|
6046
|
-
meta: {},
|
|
6047
|
-
},
|
|
6048
|
-
endpoint: {
|
|
6049
|
-
deviceID: 5,
|
|
6050
|
-
inputClusters: [0, 1],
|
|
6051
|
-
outputClusters: [2],
|
|
6052
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
6053
|
-
profileID: 99,
|
|
6054
|
-
ID: 1,
|
|
6055
|
-
clusters: {},
|
|
6056
|
-
deviceIeeeAddress: "0x129",
|
|
6057
|
-
deviceNetworkAddress: 129,
|
|
6058
|
-
_binds: [],
|
|
6059
|
-
_configuredReportings: [],
|
|
6060
|
-
_events: {},
|
|
6061
|
-
_eventsCount: 0,
|
|
6062
|
-
meta: {},
|
|
6063
|
-
},
|
|
5588
|
+
device: expect.any(Device),
|
|
5589
|
+
endpoint: expect.any(Endpoint),
|
|
6064
5590
|
data: ["mainsVoltage", 9999],
|
|
6065
5591
|
linkquality: 19,
|
|
6066
5592
|
groupID: 10,
|
|
@@ -6074,11 +5600,13 @@ describe("Controller", () => {
|
|
|
6074
5600
|
frameType: 0,
|
|
6075
5601
|
manufacturerSpecific: false,
|
|
6076
5602
|
},
|
|
5603
|
+
manufacturerCode: undefined,
|
|
5604
|
+
rawData: expect.any(Buffer),
|
|
6077
5605
|
},
|
|
6078
5606
|
};
|
|
6079
5607
|
|
|
6080
5608
|
expect(events.message.length).toBe(1);
|
|
6081
|
-
expect(
|
|
5609
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
6082
5610
|
});
|
|
6083
5611
|
|
|
6084
5612
|
it("Emit write from device", async () => {
|
|
@@ -6099,65 +5627,8 @@ describe("Controller", () => {
|
|
|
6099
5627
|
|
|
6100
5628
|
const expected = {
|
|
6101
5629
|
type: "write",
|
|
6102
|
-
device:
|
|
6103
|
-
|
|
6104
|
-
_events: {},
|
|
6105
|
-
_eventsCount: 0,
|
|
6106
|
-
_applicationVersion: 2,
|
|
6107
|
-
_dateCode: "201901",
|
|
6108
|
-
_pendingRequestTimeout: 0,
|
|
6109
|
-
_customClusters: {},
|
|
6110
|
-
_endpoints: [
|
|
6111
|
-
{
|
|
6112
|
-
meta: {},
|
|
6113
|
-
deviceID: 5,
|
|
6114
|
-
_events: {},
|
|
6115
|
-
_eventsCount: 0,
|
|
6116
|
-
inputClusters: [0, 1],
|
|
6117
|
-
outputClusters: [2],
|
|
6118
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
6119
|
-
profileID: 99,
|
|
6120
|
-
ID: 1,
|
|
6121
|
-
clusters: {},
|
|
6122
|
-
deviceIeeeAddress: "0x129",
|
|
6123
|
-
deviceNetworkAddress: 129,
|
|
6124
|
-
_binds: [],
|
|
6125
|
-
_configuredReportings: [],
|
|
6126
|
-
},
|
|
6127
|
-
],
|
|
6128
|
-
_hardwareVersion: 3,
|
|
6129
|
-
_ieeeAddr: "0x129",
|
|
6130
|
-
_interviewState: InterviewState.Successful,
|
|
6131
|
-
_lastSeen: Date.now(),
|
|
6132
|
-
_linkquality: 19,
|
|
6133
|
-
_skipDefaultResponse: false,
|
|
6134
|
-
_manufacturerID: 1212,
|
|
6135
|
-
_manufacturerName: "KoenAndCo",
|
|
6136
|
-
_modelID: "myModelID",
|
|
6137
|
-
_networkAddress: 129,
|
|
6138
|
-
_powerSource: "Mains (single phase)",
|
|
6139
|
-
_softwareBuildID: "1.01",
|
|
6140
|
-
_stackVersion: 101,
|
|
6141
|
-
_type: "Router",
|
|
6142
|
-
_zclVersion: 1,
|
|
6143
|
-
meta: {},
|
|
6144
|
-
},
|
|
6145
|
-
endpoint: {
|
|
6146
|
-
_events: {},
|
|
6147
|
-
_eventsCount: 0,
|
|
6148
|
-
deviceID: 5,
|
|
6149
|
-
inputClusters: [0, 1],
|
|
6150
|
-
outputClusters: [2],
|
|
6151
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x129", sendInProgress: false},
|
|
6152
|
-
profileID: 99,
|
|
6153
|
-
ID: 1,
|
|
6154
|
-
clusters: {},
|
|
6155
|
-
deviceIeeeAddress: "0x129",
|
|
6156
|
-
deviceNetworkAddress: 129,
|
|
6157
|
-
_binds: [],
|
|
6158
|
-
_configuredReportings: [],
|
|
6159
|
-
meta: {},
|
|
6160
|
-
},
|
|
5630
|
+
device: expect.any(Device),
|
|
5631
|
+
endpoint: expect.any(Endpoint),
|
|
6161
5632
|
data: {
|
|
6162
5633
|
"16389": 3,
|
|
6163
5634
|
},
|
|
@@ -6173,11 +5644,13 @@ describe("Controller", () => {
|
|
|
6173
5644
|
frameType: 0,
|
|
6174
5645
|
manufacturerSpecific: false,
|
|
6175
5646
|
},
|
|
5647
|
+
manufacturerCode: undefined,
|
|
5648
|
+
rawData: expect.any(Buffer),
|
|
6176
5649
|
},
|
|
6177
5650
|
};
|
|
6178
5651
|
|
|
6179
5652
|
expect(events.message.length).toBe(1);
|
|
6180
|
-
expect(
|
|
5653
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
6181
5654
|
});
|
|
6182
5655
|
|
|
6183
5656
|
it("Endpoint command error", async () => {
|
|
@@ -6401,13 +5874,13 @@ describe("Controller", () => {
|
|
|
6401
5874
|
mocksendZclFrameToEndpoint.mockRejectedValueOnce(new Error("timeout occurred"));
|
|
6402
5875
|
let error;
|
|
6403
5876
|
try {
|
|
6404
|
-
await endpoint.readResponse("genOnOff", 1,
|
|
5877
|
+
await endpoint.readResponse("genOnOff", 1, {onOff: 1});
|
|
6405
5878
|
} catch (e) {
|
|
6406
5879
|
error = e;
|
|
6407
5880
|
}
|
|
6408
5881
|
expect(error).toStrictEqual(
|
|
6409
5882
|
new Error(
|
|
6410
|
-
`ZCL command 0x129/1 genOnOff.readRsp(
|
|
5883
|
+
`ZCL command 0x129/1 genOnOff.readRsp({"onOff":1}, {"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":1,"reservedBits":0,"transactionSequenceNumber":1,"writeUndiv":false}) failed (timeout occurred)`,
|
|
6411
5884
|
),
|
|
6412
5885
|
);
|
|
6413
5886
|
});
|
|
@@ -6681,53 +6154,8 @@ describe("Controller", () => {
|
|
|
6681
6154
|
expect(events.message.length).toBe(1);
|
|
6682
6155
|
const expected = {
|
|
6683
6156
|
type: "commandNotification",
|
|
6684
|
-
device:
|
|
6685
|
-
|
|
6686
|
-
_events: {},
|
|
6687
|
-
_eventsCount: 0,
|
|
6688
|
-
_pendingRequestTimeout: 0,
|
|
6689
|
-
_customClusters: {},
|
|
6690
|
-
_endpoints: [
|
|
6691
|
-
{
|
|
6692
|
-
inputClusters: [],
|
|
6693
|
-
meta: {},
|
|
6694
|
-
outputClusters: [],
|
|
6695
|
-
pendingRequests: {id: ZSpec.GP_ENDPOINT, deviceIeeeAddress: "0x000000000046f4fe", sendInProgress: false},
|
|
6696
|
-
ID: ZSpec.GP_ENDPOINT,
|
|
6697
|
-
_events: {},
|
|
6698
|
-
_eventsCount: 0,
|
|
6699
|
-
clusters: {},
|
|
6700
|
-
deviceIeeeAddress: "0x000000000046f4fe",
|
|
6701
|
-
deviceNetworkAddress: 0xf4fe,
|
|
6702
|
-
_binds: [],
|
|
6703
|
-
_configuredReportings: [],
|
|
6704
|
-
},
|
|
6705
|
-
],
|
|
6706
|
-
_ieeeAddr: "0x000000000046f4fe",
|
|
6707
|
-
_interviewState: InterviewState.Successful,
|
|
6708
|
-
_lastSeen: Date.now(),
|
|
6709
|
-
_linkquality: 50,
|
|
6710
|
-
_skipDefaultResponse: false,
|
|
6711
|
-
_modelID: "GreenPower_2",
|
|
6712
|
-
_networkAddress: 0xf4fe,
|
|
6713
|
-
_type: "GreenPower",
|
|
6714
|
-
meta: {},
|
|
6715
|
-
_gpSecurityKey: [0xf1, 0xec, 0x92, 0xab, 0xff, 0x8f, 0x13, 0x63, 0xe1, 0x46, 0xbe, 0xb5, 0x18, 0xc9, 0x0c, 0xab],
|
|
6716
|
-
},
|
|
6717
|
-
endpoint: {
|
|
6718
|
-
inputClusters: [],
|
|
6719
|
-
meta: {},
|
|
6720
|
-
outputClusters: [],
|
|
6721
|
-
pendingRequests: {id: ZSpec.GP_ENDPOINT, deviceIeeeAddress: "0x000000000046f4fe", sendInProgress: false},
|
|
6722
|
-
ID: ZSpec.GP_ENDPOINT,
|
|
6723
|
-
_events: {},
|
|
6724
|
-
_eventsCount: 0,
|
|
6725
|
-
clusters: {},
|
|
6726
|
-
deviceIeeeAddress: "0x000000000046f4fe",
|
|
6727
|
-
deviceNetworkAddress: 0xf4fe,
|
|
6728
|
-
_binds: [],
|
|
6729
|
-
_configuredReportings: [],
|
|
6730
|
-
},
|
|
6157
|
+
device: expect.any(Device),
|
|
6158
|
+
endpoint: expect.any(Endpoint),
|
|
6731
6159
|
data: {options: 0, srcID: 0x46f4fe, frameCounter: 228, commandID: 34, payloadSize: 255, commandFrame: {}},
|
|
6732
6160
|
linkquality: 50,
|
|
6733
6161
|
groupID: 1,
|
|
@@ -6735,9 +6163,11 @@ describe("Controller", () => {
|
|
|
6735
6163
|
meta: {
|
|
6736
6164
|
zclTransactionSequenceNumber: 10,
|
|
6737
6165
|
frameControl: {reservedBits: 0, frameType: 1, direction: 0, disableDefaultResponse: true, manufacturerSpecific: false},
|
|
6166
|
+
manufacturerCode: undefined,
|
|
6167
|
+
rawData: expect.any(Buffer),
|
|
6738
6168
|
},
|
|
6739
6169
|
};
|
|
6740
|
-
expect(
|
|
6170
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
6741
6171
|
|
|
6742
6172
|
const identifyUnknownDeviceSpy = vi.spyOn(controller, "identifyUnknownDevice");
|
|
6743
6173
|
|
|
@@ -7320,53 +6750,8 @@ describe("Controller", () => {
|
|
|
7320
6750
|
expect(events.message.length).toBe(1);
|
|
7321
6751
|
const expected = {
|
|
7322
6752
|
type: "commandNotification",
|
|
7323
|
-
device:
|
|
7324
|
-
|
|
7325
|
-
_eventsCount: 0,
|
|
7326
|
-
ID: 3,
|
|
7327
|
-
_type: "GreenPower",
|
|
7328
|
-
_ieeeAddr: "0x00000000017171f8",
|
|
7329
|
-
_networkAddress: 29176,
|
|
7330
|
-
_customClusters: {},
|
|
7331
|
-
_endpoints: [
|
|
7332
|
-
{
|
|
7333
|
-
_events: {},
|
|
7334
|
-
_eventsCount: 0,
|
|
7335
|
-
ID: ZSpec.GP_ENDPOINT,
|
|
7336
|
-
inputClusters: [],
|
|
7337
|
-
outputClusters: [],
|
|
7338
|
-
deviceNetworkAddress: 29176,
|
|
7339
|
-
deviceIeeeAddress: "0x00000000017171f8",
|
|
7340
|
-
clusters: {},
|
|
7341
|
-
_binds: [],
|
|
7342
|
-
_configuredReportings: [],
|
|
7343
|
-
meta: {},
|
|
7344
|
-
pendingRequests: {sendInProgress: false, id: ZSpec.GP_ENDPOINT, deviceIeeeAddress: "0x00000000017171f8"},
|
|
7345
|
-
},
|
|
7346
|
-
],
|
|
7347
|
-
_modelID: "GreenPower_2",
|
|
7348
|
-
_interviewState: InterviewState.Successful,
|
|
7349
|
-
_skipDefaultResponse: false,
|
|
7350
|
-
meta: {},
|
|
7351
|
-
_gpSecurityKey: [0x21, 0x7f, 0x8c, 0xb2, 0x90, 0xd9, 0x90, 0x14, 0x15, 0xd0, 0x5c, 0xb1, 0x64, 0x7c, 0x44, 0x6c],
|
|
7352
|
-
_lastSeen: Date.now(),
|
|
7353
|
-
_pendingRequestTimeout: 0,
|
|
7354
|
-
_linkquality: 50,
|
|
7355
|
-
},
|
|
7356
|
-
endpoint: {
|
|
7357
|
-
_events: {},
|
|
7358
|
-
_eventsCount: 0,
|
|
7359
|
-
ID: ZSpec.GP_ENDPOINT,
|
|
7360
|
-
inputClusters: [],
|
|
7361
|
-
outputClusters: [],
|
|
7362
|
-
deviceNetworkAddress: 29176,
|
|
7363
|
-
deviceIeeeAddress: "0x00000000017171f8",
|
|
7364
|
-
clusters: {},
|
|
7365
|
-
_binds: [],
|
|
7366
|
-
_configuredReportings: [],
|
|
7367
|
-
meta: {},
|
|
7368
|
-
pendingRequests: {sendInProgress: false, id: ZSpec.GP_ENDPOINT, deviceIeeeAddress: "0x00000000017171f8"},
|
|
7369
|
-
},
|
|
6753
|
+
device: expect.any(Device),
|
|
6754
|
+
endpoint: expect.any(Endpoint),
|
|
7370
6755
|
data: {
|
|
7371
6756
|
options: 21640,
|
|
7372
6757
|
srcID: 24211960,
|
|
@@ -7383,9 +6768,11 @@ describe("Controller", () => {
|
|
|
7383
6768
|
meta: {
|
|
7384
6769
|
zclTransactionSequenceNumber: 10,
|
|
7385
6770
|
frameControl: {reservedBits: 0, frameType: 1, direction: 0, disableDefaultResponse: true, manufacturerSpecific: false},
|
|
6771
|
+
manufacturerCode: undefined,
|
|
6772
|
+
rawData: expect.any(Buffer),
|
|
7386
6773
|
},
|
|
7387
6774
|
};
|
|
7388
|
-
expect(
|
|
6775
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
7389
6776
|
|
|
7390
6777
|
// Remove green power device from network
|
|
7391
6778
|
const removeCommand = {
|
|
@@ -8109,135 +7496,8 @@ describe("Controller", () => {
|
|
|
8109
7496
|
|
|
8110
7497
|
const expected = {
|
|
8111
7498
|
type: "read",
|
|
8112
|
-
device: {
|
|
8113
|
-
|
|
8114
|
-
_applicationVersion: 2,
|
|
8115
|
-
_dateCode: "201901",
|
|
8116
|
-
_pendingRequestTimeout: 0,
|
|
8117
|
-
_customClusters: {},
|
|
8118
|
-
_endpoints: [
|
|
8119
|
-
{
|
|
8120
|
-
deviceID: 5,
|
|
8121
|
-
inputClusters: [0, 1, 2],
|
|
8122
|
-
outputClusters: [2],
|
|
8123
|
-
profileID: 99,
|
|
8124
|
-
ID: 1,
|
|
8125
|
-
clusters: {},
|
|
8126
|
-
deviceIeeeAddress: "0x171",
|
|
8127
|
-
deviceNetworkAddress: 171,
|
|
8128
|
-
_binds: [],
|
|
8129
|
-
_configuredReportings: [],
|
|
8130
|
-
_events: {},
|
|
8131
|
-
_eventsCount: 0,
|
|
8132
|
-
meta: {},
|
|
8133
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8134
|
-
},
|
|
8135
|
-
{
|
|
8136
|
-
inputClusters: [],
|
|
8137
|
-
outputClusters: [],
|
|
8138
|
-
ID: 2,
|
|
8139
|
-
clusters: {},
|
|
8140
|
-
deviceIeeeAddress: "0x171",
|
|
8141
|
-
deviceNetworkAddress: 171,
|
|
8142
|
-
_binds: [],
|
|
8143
|
-
_configuredReportings: [],
|
|
8144
|
-
_events: {},
|
|
8145
|
-
_eventsCount: 0,
|
|
8146
|
-
meta: {},
|
|
8147
|
-
pendingRequests: {id: 2, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8148
|
-
},
|
|
8149
|
-
{
|
|
8150
|
-
inputClusters: [],
|
|
8151
|
-
outputClusters: [],
|
|
8152
|
-
ID: 3,
|
|
8153
|
-
clusters: {},
|
|
8154
|
-
deviceIeeeAddress: "0x171",
|
|
8155
|
-
deviceNetworkAddress: 171,
|
|
8156
|
-
_binds: [],
|
|
8157
|
-
_configuredReportings: [],
|
|
8158
|
-
_events: {},
|
|
8159
|
-
_eventsCount: 0,
|
|
8160
|
-
meta: {},
|
|
8161
|
-
pendingRequests: {id: 3, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8162
|
-
},
|
|
8163
|
-
{
|
|
8164
|
-
inputClusters: [],
|
|
8165
|
-
outputClusters: [],
|
|
8166
|
-
ID: 4,
|
|
8167
|
-
clusters: {},
|
|
8168
|
-
deviceIeeeAddress: "0x171",
|
|
8169
|
-
deviceNetworkAddress: 171,
|
|
8170
|
-
_binds: [],
|
|
8171
|
-
_configuredReportings: [],
|
|
8172
|
-
_events: {},
|
|
8173
|
-
_eventsCount: 0,
|
|
8174
|
-
meta: {},
|
|
8175
|
-
pendingRequests: {id: 4, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8176
|
-
},
|
|
8177
|
-
{
|
|
8178
|
-
inputClusters: [],
|
|
8179
|
-
outputClusters: [],
|
|
8180
|
-
ID: 5,
|
|
8181
|
-
clusters: {},
|
|
8182
|
-
deviceIeeeAddress: "0x171",
|
|
8183
|
-
deviceNetworkAddress: 171,
|
|
8184
|
-
_binds: [],
|
|
8185
|
-
_configuredReportings: [],
|
|
8186
|
-
_events: {},
|
|
8187
|
-
_eventsCount: 0,
|
|
8188
|
-
meta: {},
|
|
8189
|
-
pendingRequests: {id: 5, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8190
|
-
},
|
|
8191
|
-
{
|
|
8192
|
-
inputClusters: [],
|
|
8193
|
-
outputClusters: [],
|
|
8194
|
-
ID: 6,
|
|
8195
|
-
clusters: {},
|
|
8196
|
-
deviceIeeeAddress: "0x171",
|
|
8197
|
-
deviceNetworkAddress: 171,
|
|
8198
|
-
_binds: [],
|
|
8199
|
-
_configuredReportings: [],
|
|
8200
|
-
_events: {},
|
|
8201
|
-
_eventsCount: 0,
|
|
8202
|
-
meta: {},
|
|
8203
|
-
pendingRequests: {id: 6, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8204
|
-
},
|
|
8205
|
-
],
|
|
8206
|
-
_events: {},
|
|
8207
|
-
_eventsCount: 0,
|
|
8208
|
-
_hardwareVersion: 3,
|
|
8209
|
-
_ieeeAddr: "0x171",
|
|
8210
|
-
_interviewState: InterviewState.Successful,
|
|
8211
|
-
_lastSeen: Date.now(),
|
|
8212
|
-
_manufacturerID: 1212,
|
|
8213
|
-
_manufacturerName: "Xioami",
|
|
8214
|
-
_modelID: "lumi.remote.b286opcn01",
|
|
8215
|
-
_networkAddress: 171,
|
|
8216
|
-
_powerSource: "Mains (single phase)",
|
|
8217
|
-
_softwareBuildID: "1.01",
|
|
8218
|
-
_stackVersion: 101,
|
|
8219
|
-
_type: "EndDevice",
|
|
8220
|
-
_zclVersion: 1,
|
|
8221
|
-
_linkquality: 19,
|
|
8222
|
-
_skipDefaultResponse: false,
|
|
8223
|
-
meta: {},
|
|
8224
|
-
},
|
|
8225
|
-
endpoint: {
|
|
8226
|
-
deviceID: 5,
|
|
8227
|
-
inputClusters: [0, 1, 2],
|
|
8228
|
-
outputClusters: [2],
|
|
8229
|
-
profileID: 99,
|
|
8230
|
-
ID: 1,
|
|
8231
|
-
clusters: {},
|
|
8232
|
-
deviceIeeeAddress: "0x171",
|
|
8233
|
-
deviceNetworkAddress: 171,
|
|
8234
|
-
_binds: [],
|
|
8235
|
-
_configuredReportings: [],
|
|
8236
|
-
_events: {},
|
|
8237
|
-
_eventsCount: 0,
|
|
8238
|
-
meta: {},
|
|
8239
|
-
pendingRequests: {id: 1, deviceIeeeAddress: "0x171", sendInProgress: false},
|
|
8240
|
-
},
|
|
7499
|
+
device: expect.objectContaining({_ieeeAddr: "0x171"}),
|
|
7500
|
+
endpoint: expect.objectContaining({deviceIeeeAddress: "0x171"}),
|
|
8241
7501
|
data: ["mainsVoltage", 9999],
|
|
8242
7502
|
linkquality: 19,
|
|
8243
7503
|
groupID: 171,
|
|
@@ -8245,10 +7505,12 @@ describe("Controller", () => {
|
|
|
8245
7505
|
meta: {
|
|
8246
7506
|
zclTransactionSequenceNumber: 40,
|
|
8247
7507
|
frameControl: {reservedBits: 0, frameType: 0, direction: 0, disableDefaultResponse: true, manufacturerSpecific: false},
|
|
7508
|
+
manufacturerCode: undefined,
|
|
7509
|
+
rawData: expect.any(Buffer),
|
|
8248
7510
|
},
|
|
8249
7511
|
};
|
|
8250
7512
|
expect(events.message.length).toBe(1);
|
|
8251
|
-
expect(
|
|
7513
|
+
expect(events.message[0]).toStrictEqual(expected);
|
|
8252
7514
|
});
|
|
8253
7515
|
|
|
8254
7516
|
it("Shouldnt throw error on coordinatorCheck when adapter doesnt support backups", async () => {
|
|
@@ -9212,7 +8474,7 @@ describe("Controller", () => {
|
|
|
9212
8474
|
type: "commandIndividualLedEffect",
|
|
9213
8475
|
data: {
|
|
9214
8476
|
color: 0,
|
|
9215
|
-
duration:
|
|
8477
|
+
duration: null,
|
|
9216
8478
|
effect: 1,
|
|
9217
8479
|
led: 5,
|
|
9218
8480
|
level: 100,
|