homebridge-gree-ac 2.2.2-beta.5 → 2.2.2-beta.6

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 (45) hide show
  1. package/CHANGELOG.md +8 -4
  2. package/LICENSE +175 -175
  3. package/README.md +511 -500
  4. package/config.schema.json +520 -509
  5. package/dist/commands.d.ts +35 -160
  6. package/dist/commands.js +160 -162
  7. package/dist/commands.js.map +1 -1
  8. package/dist/crypto.d.ts +10 -11
  9. package/dist/crypto.js +28 -33
  10. package/dist/crypto.js.map +1 -1
  11. package/dist/index.d.ts +6 -7
  12. package/dist/index.js +8 -6
  13. package/dist/index.js.map +1 -1
  14. package/dist/platform.d.ts +47 -43
  15. package/dist/platform.js +585 -549
  16. package/dist/platform.js.map +1 -1
  17. package/dist/platformAccessory.d.ts +108 -102
  18. package/dist/platformAccessory.js +1763 -1726
  19. package/dist/platformAccessory.js.map +1 -1
  20. package/dist/settings.d.ts +72 -113
  21. package/dist/settings.js +97 -103
  22. package/dist/settings.js.map +1 -1
  23. package/dist/tsAccessory.d.ts +32 -34
  24. package/dist/tsAccessory.js +69 -71
  25. package/dist/tsAccessory.js.map +1 -1
  26. package/dist/version.d.ts +1 -2
  27. package/dist/version.js +2 -5
  28. package/dist/version.js.map +1 -1
  29. package/greedevice.jpg +0 -0
  30. package/greedevinfo.jpg +0 -0
  31. package/greemac.jpg +0 -0
  32. package/ha_fan.jpg +0 -0
  33. package/ha_settings.jpg +0 -0
  34. package/package.json +56 -52
  35. package/uiconfig.jpg +0 -0
  36. package/uiconfigcustdef.jpg +0 -0
  37. package/uiconfigmin.jpg +0 -0
  38. package/dist/commands.d.ts.map +0 -1
  39. package/dist/crypto.d.ts.map +0 -1
  40. package/dist/index.d.ts.map +0 -1
  41. package/dist/platform.d.ts.map +0 -1
  42. package/dist/platformAccessory.d.ts.map +0 -1
  43. package/dist/settings.d.ts.map +0 -1
  44. package/dist/tsAccessory.d.ts.map +0 -1
  45. package/dist/version.d.ts.map +0 -1
@@ -1,160 +1,35 @@
1
- declare const commands: {
2
- power: {
3
- code: string;
4
- value: {
5
- off: number;
6
- on: number;
7
- };
8
- };
9
- mode: {
10
- code: string;
11
- value: {
12
- auto: number;
13
- cool: number;
14
- dry: number;
15
- fan: number;
16
- heat: number;
17
- };
18
- };
19
- targetTemperature: {
20
- code: string;
21
- };
22
- temperature: {
23
- code: string;
24
- };
25
- units: {
26
- code: string;
27
- value: {
28
- celsius: number;
29
- fahrenheit: number;
30
- };
31
- };
32
- temperatureOffset: {
33
- code: string;
34
- };
35
- speed: {
36
- code: string;
37
- value: {
38
- auto: number;
39
- low: number;
40
- mediumLow: number;
41
- medium: number;
42
- mediumHigh: number;
43
- high: number;
44
- };
45
- };
46
- swingHorizontal: {
47
- code: string;
48
- value: {
49
- default: number;
50
- full: number;
51
- left: number;
52
- centerLeft: number;
53
- center: number;
54
- centerRight: number;
55
- right: number;
56
- };
57
- };
58
- swingVertical: {
59
- code: string;
60
- value: {
61
- default: number;
62
- full: number;
63
- fixedHighest: number;
64
- fixedHigher: number;
65
- fixedMiddle: number;
66
- fixedLower: number;
67
- fixedLowest: number;
68
- swingLowest: number;
69
- swingLower: number;
70
- swingMiddle: number;
71
- swingHigher: number;
72
- swingHighest: number;
73
- };
74
- };
75
- xFan: {
76
- code: string;
77
- value: {
78
- off: number;
79
- on: number;
80
- };
81
- };
82
- light: {
83
- code: string;
84
- value: {
85
- off: number;
86
- on: number;
87
- };
88
- };
89
- quietMode: {
90
- code: string;
91
- value: {
92
- off: number;
93
- on: number;
94
- };
95
- };
96
- powerfulMode: {
97
- code: string;
98
- value: {
99
- off: number;
100
- on: number;
101
- };
102
- };
103
- HeatCoolType: {
104
- code: string;
105
- };
106
- energySaving: {
107
- code: string;
108
- value: {
109
- off: number;
110
- on: number;
111
- };
112
- };
113
- sleepMode: {
114
- code: string;
115
- value: {
116
- off: number;
117
- on: number;
118
- };
119
- };
120
- sleep: {
121
- code: string;
122
- value: {
123
- off: number;
124
- on: number;
125
- };
126
- };
127
- time: {
128
- code: string;
129
- };
130
- air: {
131
- code: string;
132
- value: {
133
- off: number;
134
- on: number;
135
- };
136
- };
137
- health: {
138
- code: string;
139
- value: {
140
- off: number;
141
- on: number;
142
- };
143
- };
144
- nofrost: {
145
- code: string;
146
- value: {
147
- off: number;
148
- on: number;
149
- };
150
- };
151
- buzzer: {
152
- code: string;
153
- value: {
154
- off: number;
155
- on: number;
156
- };
157
- };
158
- };
159
- export default commands;
160
- //# sourceMappingURL=commands.d.ts.map
1
+ type CommandValueMap = Record<string, number>;
2
+ interface CommandWithValue {
3
+ code: string;
4
+ value: CommandValueMap;
5
+ }
6
+ interface CommandWithoutValue {
7
+ code: string;
8
+ }
9
+ interface Commands {
10
+ power: CommandWithValue;
11
+ mode: CommandWithValue;
12
+ targetTemperature: CommandWithoutValue;
13
+ temperature: CommandWithoutValue;
14
+ units: CommandWithValue;
15
+ temperatureOffset: CommandWithoutValue;
16
+ speed: CommandWithValue;
17
+ swingHorizontal: CommandWithValue;
18
+ swingVertical: CommandWithValue;
19
+ xFan: CommandWithValue;
20
+ light: CommandWithValue;
21
+ quietMode: CommandWithValue;
22
+ powerfulMode: CommandWithValue;
23
+ HeatCoolType: CommandWithoutValue;
24
+ energySaving: CommandWithValue;
25
+ sleepMode: CommandWithValue;
26
+ sleep: CommandWithValue;
27
+ time: CommandWithoutValue;
28
+ air: CommandWithValue;
29
+ health: CommandWithValue;
30
+ nofrost: CommandWithValue;
31
+ buzzer: CommandWithValue;
32
+ }
33
+ export type { CommandValueMap, Commands };
34
+ declare const commands: Commands;
35
+ export default commands;
package/dist/commands.js CHANGED
@@ -1,163 +1,161 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const commands = {
4
- power: {
5
- code: 'Pow',
6
- value: {
7
- off: 0,
8
- on: 1,
9
- },
10
- },
11
- mode: {
12
- code: 'Mod',
13
- value: {
14
- auto: 0,
15
- cool: 1,
16
- dry: 2,
17
- fan: 3,
18
- heat: 4,
19
- },
20
- },
21
- targetTemperature: {
22
- code: 'SetTem',
23
- },
24
- temperature: {
25
- code: 'TemSen',
26
- },
27
- units: {
28
- code: 'TemUn',
29
- value: {
30
- celsius: 0,
31
- fahrenheit: 1,
32
- },
33
- },
34
- temperatureOffset: {
35
- code: 'TemRec',
36
- },
37
- speed: {
38
- code: 'WdSpd',
39
- value: {
40
- auto: 0,
41
- low: 1,
42
- mediumLow: 2,
43
- medium: 3,
44
- mediumHigh: 4,
45
- high: 5,
46
- },
47
- },
48
- swingHorizontal: {
49
- code: 'SwingLfRig',
50
- value: {
51
- default: 0,
52
- full: 1,
53
- left: 2,
54
- centerLeft: 3,
55
- center: 4,
56
- centerRight: 5,
57
- right: 6,
58
- },
59
- },
60
- swingVertical: {
61
- code: 'SwUpDn',
62
- value: {
63
- default: 0,
64
- full: 1,
65
- fixedHighest: 2,
66
- fixedHigher: 3,
67
- fixedMiddle: 4,
68
- fixedLower: 5,
69
- fixedLowest: 6,
70
- swingLowest: 7,
71
- swingLower: 8,
72
- swingMiddle: 9,
73
- swingHigher: 10,
74
- swingHighest: 11, // swing in the upmost region (1/5)
75
- },
76
- },
77
- xFan: {
78
- code: 'Blo',
79
- value: {
80
- off: 0,
81
- on: 1,
82
- },
83
- },
84
- light: {
85
- code: 'Lig',
86
- value: {
87
- off: 0,
88
- on: 1,
89
- },
90
- },
91
- quietMode: {
92
- code: 'Quiet',
93
- value: {
94
- off: 0,
95
- on: 2,
96
- },
97
- },
98
- powerfulMode: {
99
- code: 'Tur',
100
- value: {
101
- off: 0,
102
- on: 1,
103
- },
104
- },
105
- HeatCoolType: {
106
- code: 'HeatCoolType',
107
- },
108
- energySaving: {
109
- code: 'SvSt',
110
- value: {
111
- off: 0,
112
- on: 1,
113
- },
114
- },
115
- // sleepMode and sleep should be syncronized (to turn on set both to 1 / to turn off set both to 0)
116
- sleepMode: {
117
- code: 'SwhSlp',
118
- value: {
119
- off: 0,
120
- on: 1,
121
- },
122
- },
123
- sleep: {
124
- code: 'SlpMod',
125
- value: {
126
- off: 0,
127
- on: 1,
128
- },
129
- },
130
- time: {
131
- code: 'time',
132
- },
133
- air: {
134
- code: 'Air',
135
- value: {
136
- off: 0,
137
- on: 1,
138
- },
139
- },
140
- health: {
141
- code: 'Health',
142
- value: {
143
- off: 0,
144
- on: 1,
145
- },
146
- },
147
- nofrost: {
148
- code: 'StHt',
149
- value: {
150
- off: 0,
151
- on: 1,
152
- },
153
- },
154
- buzzer: {
155
- code: 'Buzzer_ON_OFF',
156
- value: {
157
- off: 1,
158
- on: 0,
159
- },
160
- },
161
- };
162
- exports.default = commands;
1
+ const commands = {
2
+ power: {
3
+ code: 'Pow',
4
+ value: {
5
+ off: 0,
6
+ on: 1,
7
+ },
8
+ },
9
+ mode: {
10
+ code: 'Mod',
11
+ value: {
12
+ auto: 0,
13
+ cool: 1,
14
+ dry: 2,
15
+ fan: 3,
16
+ heat: 4,
17
+ },
18
+ },
19
+ targetTemperature: {
20
+ code: 'SetTem',
21
+ },
22
+ temperature: {
23
+ code: 'TemSen',
24
+ },
25
+ units: {
26
+ code: 'TemUn',
27
+ value: {
28
+ celsius: 0,
29
+ fahrenheit: 1,
30
+ },
31
+ },
32
+ temperatureOffset: {
33
+ code: 'TemRec',
34
+ },
35
+ speed: {
36
+ code: 'WdSpd',
37
+ value: {
38
+ auto: 0,
39
+ low: 1,
40
+ mediumLow: 2, // not available on 3-speed units
41
+ medium: 3,
42
+ mediumHigh: 4, // not available on 3-speed units
43
+ high: 5,
44
+ },
45
+ },
46
+ swingHorizontal: {
47
+ code: 'SwingLfRig',
48
+ value: {
49
+ default: 0,
50
+ full: 1,
51
+ left: 2,
52
+ centerLeft: 3,
53
+ center: 4,
54
+ centerRight: 5,
55
+ right: 6,
56
+ },
57
+ },
58
+ swingVertical: {
59
+ code: 'SwUpDn',
60
+ value: {
61
+ default: 0,
62
+ full: 1, // swing in full range
63
+ fixedHighest: 2, // fixed in the upmost position (1/5)
64
+ fixedHigher: 3, // fixed in the middle-up position (2/5)
65
+ fixedMiddle: 4, // fixed in the middle position (3/5)
66
+ fixedLower: 5, // fixed in the middle-low position (4/5)
67
+ fixedLowest: 6, // fixed in the lowest position (5/5)
68
+ swingLowest: 7, // swing in the downmost region (5/5)
69
+ swingLower: 8, // swing in the middle-low region (4/5)
70
+ swingMiddle: 9, // swing in the middle region (3/5)
71
+ swingHigher: 10, // swing in the middle-up region (2/5)
72
+ swingHighest: 11, // swing in the upmost region (1/5)
73
+ },
74
+ },
75
+ xFan: {
76
+ code: 'Blo',
77
+ value: {
78
+ off: 0,
79
+ on: 1,
80
+ },
81
+ },
82
+ light: {
83
+ code: 'Lig',
84
+ value: {
85
+ off: 0,
86
+ on: 1,
87
+ },
88
+ },
89
+ quietMode: {
90
+ code: 'Quiet',
91
+ value: {
92
+ off: 0,
93
+ on: 2,
94
+ },
95
+ },
96
+ powerfulMode: {
97
+ code: 'Tur',
98
+ value: {
99
+ off: 0,
100
+ on: 1,
101
+ },
102
+ },
103
+ HeatCoolType: {
104
+ code: 'HeatCoolType',
105
+ },
106
+ energySaving: {
107
+ code: 'SvSt',
108
+ value: {
109
+ off: 0,
110
+ on: 1,
111
+ },
112
+ },
113
+ // sleepMode and sleep should be syncronized (to turn on set both to 1 / to turn off set both to 0)
114
+ sleepMode: {
115
+ code: 'SwhSlp',
116
+ value: {
117
+ off: 0,
118
+ on: 1,
119
+ },
120
+ },
121
+ sleep: {
122
+ code: 'SlpMod',
123
+ value: {
124
+ off: 0,
125
+ on: 1,
126
+ },
127
+ },
128
+ time: {
129
+ code: 'time',
130
+ },
131
+ air: {
132
+ code: 'Air',
133
+ value: {
134
+ off: 0,
135
+ on: 1,
136
+ },
137
+ },
138
+ health: {
139
+ code: 'Health',
140
+ value: {
141
+ off: 0,
142
+ on: 1,
143
+ },
144
+ },
145
+ nofrost: {
146
+ code: 'StHt',
147
+ value: {
148
+ off: 0,
149
+ on: 1,
150
+ },
151
+ },
152
+ buzzer: {
153
+ code: 'Buzzer_ON_OFF',
154
+ value: {
155
+ off: 1,
156
+ on: 0,
157
+ },
158
+ },
159
+ };
160
+ export default commands;
163
161
  //# sourceMappingURL=commands.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":";;AAAA,MAAM,QAAQ,GAAG;IACf,KAAK,EAAE;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;SACR;KACF;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;KACf;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,OAAO,EAAE,CAAC;YACV,UAAU,EAAE,CAAC;SACd;KACF;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,CAAC;YACT,UAAU,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;SACR;KACF;IACD,eAAe,EAAE;QACf,IAAI,EAAE,YAAY;QAClB,KAAK,EAAE;YACL,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;YACP,UAAU,EAAE,CAAC;YACb,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,CAAC;YACd,KAAK,EAAE,CAAC;SACT;KACF;IACD,aAAa,EAAE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M;KACb;IACD,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;CACF,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAsCA,MAAM,QAAQ,GAAa;IACzB,KAAK,EAAE;QACL,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;YACP,GAAG,EAAE,CAAC;YACN,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;SACR;KACF;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;KACf;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,OAAO,EAAE,CAAC;YACV,UAAU,EAAE,CAAC;SACd;KACF;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;KACf;IACD,KAAK,EAAE;QACL,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,CAAC;YACP,GAAG,EA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,EAAE;QACZ,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;KACrB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,mGAAmG;IACnG,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;KACb;IACD,GAAG,EAAE;QACH,IAAI,EAAE,KAAK;QACX,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;IACD,MAAM,EAAE;QACN,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE;YACL,GAAG,EAAE,CAAC;YACN,EAAE,EAAE,CAAC;SACN;KACF;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/dist/crypto.d.ts CHANGED
@@ -1,11 +1,10 @@
1
- declare const _default: {
2
- encrypt_v1: (data: any, key?: string) => string;
3
- decrypt_v1: (data: string, key?: string) => any;
4
- encrypt_v2: (data: any, key?: string) => {
5
- pack: string;
6
- tag: string;
7
- };
8
- decrypt_v2: (data: string, tag: string, key?: string) => any;
9
- };
10
- export default _default;
11
- //# sourceMappingURL=crypto.d.ts.map
1
+ declare const _default: {
2
+ encrypt_v1: (data: unknown, key?: string) => string;
3
+ decrypt_v1: (data: string, key?: string) => any;
4
+ encrypt_v2: (data: unknown, key?: string) => {
5
+ pack: string;
6
+ tag: string;
7
+ };
8
+ decrypt_v2: (data: string, tag: string, key?: string) => any;
9
+ };
10
+ export default _default;
package/dist/crypto.js CHANGED
@@ -1,34 +1,29 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const crypto_1 = __importDefault(require("crypto"));
7
- const genericKey_v1 = 'a3K8Bx%2r8Y7#xDh';
8
- const genericKey_v2 = '{yxAHAY_Lm6pbC/<';
9
- const iv_v2 = Buffer.from([0x54, 0x40, 0x78, 0x44, 0x49, 0x67, 0x5a, 0x51, 0x6c, 0x5e, 0x63, 0x13]);
10
- const aad_v2 = Buffer.from('qualcomm-test');
11
- exports.default = {
12
- encrypt_v1: (data, key = genericKey_v1) => {
13
- const str = JSON.stringify(data);
14
- const cipher = crypto_1.default.createCipheriv('aes-128-ecb', key, null);
15
- return cipher.update(str, 'utf8', 'base64') + cipher.final('base64');
16
- },
17
- decrypt_v1: (data, key = genericKey_v1) => {
18
- const decipher = crypto_1.default.createDecipheriv('aes-128-ecb', key, null);
19
- return JSON.parse(decipher.update(data, 'base64', 'utf8') + decipher.final('utf8'));
20
- },
21
- encrypt_v2: (data, key = genericKey_v2) => {
22
- const str = JSON.stringify(data);
23
- const cipher = crypto_1.default.createCipheriv('aes-128-gcm', key, iv_v2).setAAD(aad_v2);
24
- const pack = cipher.update(str, 'utf8', 'base64') + cipher.final('base64');
25
- const tag = cipher.getAuthTag().toString('base64');
26
- return { pack, tag };
27
- },
28
- decrypt_v2: (data, tag, key = genericKey_v2) => {
29
- const tagbuffer = Buffer.from(tag, 'base64');
30
- const decipher = crypto_1.default.createDecipheriv('aes-128-gcm', key, iv_v2).setAuthTag(tagbuffer).setAAD(aad_v2);
31
- return JSON.parse(decipher.update(data, 'base64', 'utf8') + decipher.final('utf8'));
32
- },
33
- };
1
+ import crypto from 'crypto';
2
+ const genericKey_v1 = 'a3K8Bx%2r8Y7#xDh';
3
+ const genericKey_v2 = '{yxAHAY_Lm6pbC/<';
4
+ const iv_v2 = Buffer.from([0x54, 0x40, 0x78, 0x44, 0x49, 0x67, 0x5a, 0x51, 0x6c, 0x5e, 0x63, 0x13]);
5
+ const aad_v2 = Buffer.from('qualcomm-test');
6
+ export default {
7
+ encrypt_v1: (data, key = genericKey_v1) => {
8
+ const str = JSON.stringify(data);
9
+ const cipher = crypto.createCipheriv('aes-128-ecb', key, null);
10
+ return cipher.update(str, 'utf8', 'base64') + cipher.final('base64');
11
+ },
12
+ decrypt_v1: (data, key = genericKey_v1) => {
13
+ const decipher = crypto.createDecipheriv('aes-128-ecb', key, null);
14
+ return JSON.parse(decipher.update(data, 'base64', 'utf8') + decipher.final('utf8'));
15
+ },
16
+ encrypt_v2: (data, key = genericKey_v2) => {
17
+ const str = JSON.stringify(data);
18
+ const cipher = crypto.createCipheriv('aes-128-gcm', key, iv_v2).setAAD(aad_v2);
19
+ const pack = cipher.update(str, 'utf8', 'base64') + cipher.final('base64');
20
+ const tag = cipher.getAuthTag().toString('base64');
21
+ return { pack, tag };
22
+ },
23
+ decrypt_v2: (data, tag, key = genericKey_v2) => {
24
+ const tagbuffer = Buffer.from(tag, 'base64');
25
+ const decipher = crypto.createDecipheriv('aes-128-gcm', key, iv_v2).setAuthTag(tagbuffer).setAAD(aad_v2);
26
+ return JSON.parse(decipher.update(data, 'base64', 'utf8') + decipher.final('utf8'));
27
+ },
28
+ };
34
29
  //# sourceMappingURL=crypto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":";;;;;AAAA,oDAA4B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,QAAQ,CAAC,CAAC;QACnD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC;IACvB,CAAC;IACD,UAAU,EAAE,CAAC,IAAY,EAAE,GAAW,EAAE,GAAG,GAAG,aAAa,EAAE,EAAE;QAC7D,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACzG,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACtF,CAAC;CACF,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- import { API } from 'homebridge';
2
- /**
3
- * This method registers the platform with Homebridge
4
- */
5
- declare const _default: (api: API) => void;
6
- export = _default;
7
- //# sourceMappingURL=index.d.ts.map
1
+ import type { API } from 'homebridge';
2
+ /**
3
+ * This method registers the platform with Homebridge
4
+ */
5
+ declare const _default: (api: API) => void;
6
+ export default _default;