zigbee-herdsman 6.0.2 → 6.0.3

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 (252) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/package.json +12 -3
  3. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  4. package/.github/dependabot.yml +0 -22
  5. package/.github/workflows/ci.yml +0 -69
  6. package/.github/workflows/release-please.yml +0 -18
  7. package/.github/workflows/stale.yml +0 -20
  8. package/.github/workflows/typedoc.yaml +0 -47
  9. package/.release-please-manifest.json +0 -3
  10. package/.vscode/extensions.json +0 -3
  11. package/.vscode/settings.json +0 -11
  12. package/biome.json +0 -98
  13. package/examples/join-and-log.js +0 -24
  14. package/release-please-config.json +0 -9
  15. package/src/adapter/adapter.ts +0 -189
  16. package/src/adapter/adapterDiscovery.ts +0 -666
  17. package/src/adapter/const.ts +0 -12
  18. package/src/adapter/deconz/adapter/deconzAdapter.ts +0 -877
  19. package/src/adapter/deconz/driver/constants.ts +0 -246
  20. package/src/adapter/deconz/driver/driver.ts +0 -1540
  21. package/src/adapter/deconz/driver/frame.ts +0 -11
  22. package/src/adapter/deconz/driver/frameParser.ts +0 -753
  23. package/src/adapter/deconz/driver/parser.ts +0 -45
  24. package/src/adapter/deconz/driver/writer.ts +0 -22
  25. package/src/adapter/deconz/types.d.ts +0 -13
  26. package/src/adapter/ember/adapter/emberAdapter.ts +0 -2265
  27. package/src/adapter/ember/adapter/endpoints.ts +0 -86
  28. package/src/adapter/ember/adapter/oneWaitress.ts +0 -324
  29. package/src/adapter/ember/adapter/tokensManager.ts +0 -782
  30. package/src/adapter/ember/consts.ts +0 -178
  31. package/src/adapter/ember/enums.ts +0 -1746
  32. package/src/adapter/ember/ezsp/buffalo.ts +0 -1392
  33. package/src/adapter/ember/ezsp/consts.ts +0 -148
  34. package/src/adapter/ember/ezsp/enums.ts +0 -1114
  35. package/src/adapter/ember/ezsp/ezsp.ts +0 -9061
  36. package/src/adapter/ember/ezspError.ts +0 -10
  37. package/src/adapter/ember/types.ts +0 -866
  38. package/src/adapter/ember/uart/ash.ts +0 -1960
  39. package/src/adapter/ember/uart/consts.ts +0 -109
  40. package/src/adapter/ember/uart/enums.ts +0 -192
  41. package/src/adapter/ember/uart/parser.ts +0 -48
  42. package/src/adapter/ember/uart/queues.ts +0 -247
  43. package/src/adapter/ember/uart/writer.ts +0 -53
  44. package/src/adapter/ember/utils/initters.ts +0 -58
  45. package/src/adapter/ember/utils/math.ts +0 -73
  46. package/src/adapter/events.ts +0 -21
  47. package/src/adapter/ezsp/adapter/backup.ts +0 -109
  48. package/src/adapter/ezsp/adapter/ezspAdapter.ts +0 -614
  49. package/src/adapter/ezsp/driver/commands.ts +0 -2497
  50. package/src/adapter/ezsp/driver/consts.ts +0 -11
  51. package/src/adapter/ezsp/driver/driver.ts +0 -1002
  52. package/src/adapter/ezsp/driver/ezsp.ts +0 -802
  53. package/src/adapter/ezsp/driver/frame.ts +0 -101
  54. package/src/adapter/ezsp/driver/index.ts +0 -4
  55. package/src/adapter/ezsp/driver/multicast.ts +0 -78
  56. package/src/adapter/ezsp/driver/parser.ts +0 -81
  57. package/src/adapter/ezsp/driver/types/basic.ts +0 -201
  58. package/src/adapter/ezsp/driver/types/index.ts +0 -239
  59. package/src/adapter/ezsp/driver/types/named.ts +0 -2330
  60. package/src/adapter/ezsp/driver/types/struct.ts +0 -844
  61. package/src/adapter/ezsp/driver/uart.ts +0 -460
  62. package/src/adapter/ezsp/driver/utils/crc16ccitt.ts +0 -44
  63. package/src/adapter/ezsp/driver/utils/index.ts +0 -32
  64. package/src/adapter/ezsp/driver/writer.ts +0 -64
  65. package/src/adapter/index.ts +0 -3
  66. package/src/adapter/serialPort.ts +0 -58
  67. package/src/adapter/socketPortUtils.ts +0 -16
  68. package/src/adapter/tstype.ts +0 -78
  69. package/src/adapter/z-stack/adapter/adapter-backup.ts +0 -519
  70. package/src/adapter/z-stack/adapter/adapter-nv-memory.ts +0 -457
  71. package/src/adapter/z-stack/adapter/endpoints.ts +0 -57
  72. package/src/adapter/z-stack/adapter/manager.ts +0 -543
  73. package/src/adapter/z-stack/adapter/tstype.ts +0 -6
  74. package/src/adapter/z-stack/adapter/zStackAdapter.ts +0 -1190
  75. package/src/adapter/z-stack/constants/af.ts +0 -27
  76. package/src/adapter/z-stack/constants/common.ts +0 -285
  77. package/src/adapter/z-stack/constants/dbg.ts +0 -23
  78. package/src/adapter/z-stack/constants/index.ts +0 -11
  79. package/src/adapter/z-stack/constants/mac.ts +0 -128
  80. package/src/adapter/z-stack/constants/sapi.ts +0 -25
  81. package/src/adapter/z-stack/constants/sys.ts +0 -72
  82. package/src/adapter/z-stack/constants/util.ts +0 -82
  83. package/src/adapter/z-stack/constants/utils.ts +0 -14
  84. package/src/adapter/z-stack/constants/zdo.ts +0 -103
  85. package/src/adapter/z-stack/models/startup-options.ts +0 -13
  86. package/src/adapter/z-stack/structs/entries/address-manager-entry.ts +0 -44
  87. package/src/adapter/z-stack/structs/entries/address-manager-table.ts +0 -19
  88. package/src/adapter/z-stack/structs/entries/aps-link-key-data-entry.ts +0 -12
  89. package/src/adapter/z-stack/structs/entries/aps-link-key-data-table.ts +0 -21
  90. package/src/adapter/z-stack/structs/entries/aps-tc-link-key-entry.ts +0 -19
  91. package/src/adapter/z-stack/structs/entries/aps-tc-link-key-table.ts +0 -21
  92. package/src/adapter/z-stack/structs/entries/channel-list.ts +0 -8
  93. package/src/adapter/z-stack/structs/entries/has-configured.ts +0 -16
  94. package/src/adapter/z-stack/structs/entries/index.ts +0 -16
  95. package/src/adapter/z-stack/structs/entries/nib.ts +0 -66
  96. package/src/adapter/z-stack/structs/entries/nwk-key-descriptor.ts +0 -15
  97. package/src/adapter/z-stack/structs/entries/nwk-key.ts +0 -13
  98. package/src/adapter/z-stack/structs/entries/nwk-pan-id.ts +0 -8
  99. package/src/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-entry.ts +0 -20
  100. package/src/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-table.ts +0 -19
  101. package/src/adapter/z-stack/structs/entries/security-manager-entry.ts +0 -33
  102. package/src/adapter/z-stack/structs/entries/security-manager-table.ts +0 -22
  103. package/src/adapter/z-stack/structs/index.ts +0 -4
  104. package/src/adapter/z-stack/structs/serializable-memory-object.ts +0 -14
  105. package/src/adapter/z-stack/structs/struct.ts +0 -367
  106. package/src/adapter/z-stack/structs/table.ts +0 -198
  107. package/src/adapter/z-stack/unpi/constants.ts +0 -33
  108. package/src/adapter/z-stack/unpi/frame.ts +0 -62
  109. package/src/adapter/z-stack/unpi/index.ts +0 -4
  110. package/src/adapter/z-stack/unpi/parser.ts +0 -56
  111. package/src/adapter/z-stack/unpi/writer.ts +0 -21
  112. package/src/adapter/z-stack/utils/channel-list.ts +0 -40
  113. package/src/adapter/z-stack/utils/index.ts +0 -2
  114. package/src/adapter/z-stack/utils/network-options.ts +0 -26
  115. package/src/adapter/z-stack/znp/buffaloZnp.ts +0 -175
  116. package/src/adapter/z-stack/znp/definition.ts +0 -2713
  117. package/src/adapter/z-stack/znp/index.ts +0 -2
  118. package/src/adapter/z-stack/znp/parameterType.ts +0 -22
  119. package/src/adapter/z-stack/znp/tstype.ts +0 -44
  120. package/src/adapter/z-stack/znp/utils.ts +0 -10
  121. package/src/adapter/z-stack/znp/znp.ts +0 -342
  122. package/src/adapter/z-stack/znp/zpiObject.ts +0 -148
  123. package/src/adapter/zboss/adapter/zbossAdapter.ts +0 -526
  124. package/src/adapter/zboss/commands.ts +0 -1184
  125. package/src/adapter/zboss/consts.ts +0 -9
  126. package/src/adapter/zboss/driver.ts +0 -422
  127. package/src/adapter/zboss/enums.ts +0 -360
  128. package/src/adapter/zboss/frame.ts +0 -227
  129. package/src/adapter/zboss/reader.ts +0 -65
  130. package/src/adapter/zboss/types.ts +0 -0
  131. package/src/adapter/zboss/uart.ts +0 -428
  132. package/src/adapter/zboss/utils.ts +0 -58
  133. package/src/adapter/zboss/writer.ts +0 -49
  134. package/src/adapter/zigate/adapter/patchZdoBuffaloBE.ts +0 -27
  135. package/src/adapter/zigate/adapter/zigateAdapter.ts +0 -618
  136. package/src/adapter/zigate/driver/LICENSE +0 -17
  137. package/src/adapter/zigate/driver/buffaloZiGate.ts +0 -212
  138. package/src/adapter/zigate/driver/commandType.ts +0 -418
  139. package/src/adapter/zigate/driver/constants.ts +0 -150
  140. package/src/adapter/zigate/driver/frame.ts +0 -197
  141. package/src/adapter/zigate/driver/messageType.ts +0 -287
  142. package/src/adapter/zigate/driver/parameterType.ts +0 -32
  143. package/src/adapter/zigate/driver/ziGateObject.ts +0 -146
  144. package/src/adapter/zigate/driver/zigate.ts +0 -423
  145. package/src/adapter/zoh/adapter/utils.ts +0 -27
  146. package/src/adapter/zoh/adapter/zohAdapter.ts +0 -838
  147. package/src/buffalo/buffalo.ts +0 -342
  148. package/src/buffalo/index.ts +0 -1
  149. package/src/controller/controller.ts +0 -1022
  150. package/src/controller/database.ts +0 -124
  151. package/src/controller/events.ts +0 -52
  152. package/src/controller/greenPower.ts +0 -603
  153. package/src/controller/helpers/index.ts +0 -1
  154. package/src/controller/helpers/installCodes.ts +0 -107
  155. package/src/controller/helpers/request.ts +0 -96
  156. package/src/controller/helpers/requestQueue.ts +0 -125
  157. package/src/controller/helpers/zclFrameConverter.ts +0 -47
  158. package/src/controller/helpers/zclTransactionSequenceNumber.ts +0 -19
  159. package/src/controller/index.ts +0 -6
  160. package/src/controller/model/device.ts +0 -1249
  161. package/src/controller/model/endpoint.ts +0 -1105
  162. package/src/controller/model/entity.ts +0 -23
  163. package/src/controller/model/group.ts +0 -424
  164. package/src/controller/model/index.ts +0 -5
  165. package/src/controller/model/zigbeeEntity.ts +0 -30
  166. package/src/controller/touchlink.ts +0 -189
  167. package/src/controller/tstype.ts +0 -274
  168. package/src/index.ts +0 -12
  169. package/src/models/backup-storage-legacy.ts +0 -48
  170. package/src/models/backup-storage-unified.ts +0 -47
  171. package/src/models/backup.ts +0 -37
  172. package/src/models/index.ts +0 -5
  173. package/src/models/network-options.ts +0 -11
  174. package/src/utils/backup.ts +0 -152
  175. package/src/utils/index.ts +0 -5
  176. package/src/utils/logger.ts +0 -20
  177. package/src/utils/patchBigIntSerialization.ts +0 -8
  178. package/src/utils/queue.ts +0 -76
  179. package/src/utils/types.d.ts +0 -3
  180. package/src/utils/utils.ts +0 -19
  181. package/src/utils/wait.ts +0 -5
  182. package/src/utils/waitress.ts +0 -96
  183. package/src/zspec/consts.ts +0 -84
  184. package/src/zspec/enums.ts +0 -22
  185. package/src/zspec/index.ts +0 -3
  186. package/src/zspec/tstypes.ts +0 -18
  187. package/src/zspec/utils.ts +0 -247
  188. package/src/zspec/zcl/buffaloZcl.ts +0 -1220
  189. package/src/zspec/zcl/definition/cluster.ts +0 -5915
  190. package/src/zspec/zcl/definition/clusters-typegen.ts +0 -588
  191. package/src/zspec/zcl/definition/clusters-types.ts +0 -7331
  192. package/src/zspec/zcl/definition/consts.ts +0 -24
  193. package/src/zspec/zcl/definition/enums.ts +0 -203
  194. package/src/zspec/zcl/definition/foundation.ts +0 -329
  195. package/src/zspec/zcl/definition/manufacturerCode.ts +0 -729
  196. package/src/zspec/zcl/definition/status.ts +0 -69
  197. package/src/zspec/zcl/definition/tstype.ts +0 -377
  198. package/src/zspec/zcl/index.ts +0 -11
  199. package/src/zspec/zcl/utils.ts +0 -321
  200. package/src/zspec/zcl/zclFrame.ts +0 -356
  201. package/src/zspec/zcl/zclHeader.ts +0 -102
  202. package/src/zspec/zcl/zclStatusError.ts +0 -10
  203. package/src/zspec/zdo/buffaloZdo.ts +0 -2336
  204. package/src/zspec/zdo/definition/clusters.ts +0 -722
  205. package/src/zspec/zdo/definition/consts.ts +0 -16
  206. package/src/zspec/zdo/definition/enums.ts +0 -99
  207. package/src/zspec/zdo/definition/status.ts +0 -105
  208. package/src/zspec/zdo/definition/tstypes.ts +0 -1062
  209. package/src/zspec/zdo/index.ts +0 -7
  210. package/src/zspec/zdo/utils.ts +0 -76
  211. package/src/zspec/zdo/zdoStatusError.ts +0 -10
  212. package/test/adapter/adapter.test.ts +0 -1062
  213. package/test/adapter/ember/ash.test.ts +0 -337
  214. package/test/adapter/ember/consts.ts +0 -131
  215. package/test/adapter/ember/emberAdapter.test.ts +0 -3449
  216. package/test/adapter/ember/ezsp.test.ts +0 -385
  217. package/test/adapter/ember/ezspBuffalo.test.ts +0 -93
  218. package/test/adapter/ember/ezspError.test.ts +0 -12
  219. package/test/adapter/ember/math.test.ts +0 -206
  220. package/test/adapter/ezsp/frame.test.ts +0 -30
  221. package/test/adapter/ezsp/uart.test.ts +0 -181
  222. package/test/adapter/z-stack/adapter.test.ts +0 -3984
  223. package/test/adapter/z-stack/constants.test.ts +0 -33
  224. package/test/adapter/z-stack/structs.test.ts +0 -115
  225. package/test/adapter/z-stack/unpi.test.ts +0 -213
  226. package/test/adapter/z-stack/znp.test.ts +0 -1284
  227. package/test/adapter/zboss/fixZdoResponse.test.ts +0 -179
  228. package/test/adapter/zigate/patchZdoBuffaloBE.test.ts +0 -81
  229. package/test/adapter/zigate/zdo.test.ts +0 -187
  230. package/test/adapter/zoh/utils.test.ts +0 -36
  231. package/test/adapter/zoh/zohAdapter.test.ts +0 -1307
  232. package/test/benchOptions.ts +0 -14
  233. package/test/buffalo.test.ts +0 -431
  234. package/test/controller.bench.ts +0 -214
  235. package/test/controller.test.ts +0 -8702
  236. package/test/greenpower.test.ts +0 -1408
  237. package/test/mockAdapters.ts +0 -65
  238. package/test/mockDevices.ts +0 -598
  239. package/test/requests.bench.ts +0 -229
  240. package/test/testUtils.ts +0 -20
  241. package/test/tsconfig.json +0 -9
  242. package/test/utils/math.ts +0 -19
  243. package/test/utils.test.ts +0 -279
  244. package/test/vitest.config.mts +0 -26
  245. package/test/zcl.test.ts +0 -2831
  246. package/test/zspec/utils.test.ts +0 -68
  247. package/test/zspec/zcl/buffalo.test.ts +0 -1374
  248. package/test/zspec/zcl/frame.test.ts +0 -960
  249. package/test/zspec/zcl/utils.test.ts +0 -273
  250. package/test/zspec/zdo/buffalo.test.ts +0 -1850
  251. package/test/zspec/zdo/utils.test.ts +0 -241
  252. package/tsconfig.json +0 -24
@@ -1,24 +0,0 @@
1
- /** Mapping of power source bits to descriptive string. */
2
- export const POWER_SOURCES: Readonly<{[s: number]: string}> = {
3
- 0: "Unknown",
4
- 1: "Mains (single phase)",
5
- 2: "Mains (3 phase)",
6
- 3: "Battery",
7
- 4: "DC Source",
8
- 5: "Emergency mains constantly powered",
9
- 6: "Emergency mains and transfer switch",
10
- };
11
-
12
- /** Mapping of device type to ID */
13
- export const ENDPOINT_DEVICE_TYPE: Readonly<{[s: string]: number}> = {
14
- ZLLOnOffLight: 0x0000,
15
- ZLLOnOffPluginUnit: 0x0010,
16
- ZLLDimmableLight: 0x0100,
17
- ZLLDimmablePluginUnit: 0x0110,
18
- ZLLColorLight: 0x0200,
19
- ZLLExtendedColorLight: 0x0210,
20
- ZLLColorTemperatureLight: 0x0220,
21
- HAOnOffLight: 0x0100,
22
- HADimmableLight: 0x0101,
23
- HAColorLight: 0x0102,
24
- };
@@ -1,203 +0,0 @@
1
- /**
2
- * This is the specification-defined data types. It should not contain "custom" types and is expected to have [0x00-0xFF] values.
3
- *
4
- * - Values of analog types may be added to or subtracted from other values of the same type and are typically
5
- * used to measure the value of properties in the real world that vary continuously over a range.
6
- * - Values of discrete data types only have meaning as individual values and may not be added or subtracted.
7
- */
8
- export enum DataType {
9
- /** length=0 */
10
- NO_DATA = 0x00,
11
-
12
- /** class=discrete, length=1 */
13
- DATA8 = 0x08,
14
- /** class=discrete, length=2 */
15
- DATA16 = 0x09,
16
- /** class=discrete, length=3 */
17
- DATA24 = 0x0a,
18
- /** class=discrete, length=4 */
19
- DATA32 = 0x0b,
20
- /** class=discrete, length=5 */
21
- DATA40 = 0x0c,
22
- /** class=discrete, length=6 */
23
- DATA48 = 0x0d,
24
- /** class=discrete, length=7 */
25
- DATA56 = 0x0e,
26
- /** class=discrete, length=8 */
27
- DATA64 = 0x0f,
28
- /** 0x00=false, 0x01=true, class=discrete, length=1, non-value=0xFF */
29
- BOOLEAN = 0x10,
30
-
31
- /** class=discrete, length=1 */
32
- BITMAP8 = 0x18,
33
- /** class=discrete, length=2 */
34
- BITMAP16 = 0x19,
35
- /** class=discrete, length=3 */
36
- BITMAP24 = 0x1a,
37
- /** class=discrete, length=4 */
38
- BITMAP32 = 0x1b,
39
- /** class=discrete, length=5 */
40
- BITMAP40 = 0x1c,
41
- /** class=discrete, length=6 */
42
- BITMAP48 = 0x1d,
43
- /** class=discrete, length=7 */
44
- BITMAP56 = 0x1e,
45
- /** class=discrete, length=8 */
46
- BITMAP64 = 0x1f,
47
- /** class=discrete, length=1, non-value=0xFF */
48
- UINT8 = 0x20,
49
- /** class=analog, length=2, non-value=0xFFFF */
50
- UINT16 = 0x21,
51
- /** class=analog, length=3, non-value=0xFFFFFF */
52
- UINT24 = 0x22,
53
- /** class=analog, length=4, non-value=0xFFFFFFFF */
54
- UINT32 = 0x23,
55
- /** class=analog, length=5, non-value=0xFFFFFFFFFF */
56
- UINT40 = 0x24,
57
- /** class=analog, length=6, non-value=0xFFFFFFFFFFFF */
58
- UINT48 = 0x25,
59
- /** class=analog, length=7, non-value=0xFFFFFFFFFFFFFF */
60
- UINT56 = 0x26,
61
- /** class=analog, length=8, non-value=0xFFFFFFFFFFFFFFFF */
62
- UINT64 = 0x27,
63
- /** class=analog, length=1, non-value=0x80 */
64
- INT8 = 0x28,
65
- /** class=analog, length=2, non-value=0x8000 */
66
- INT16 = 0x29,
67
- /** class=analog, length=3, non-value=0x800000 */
68
- INT24 = 0x2a,
69
- /** class=analog, length=4, non-value=0x80000000 */
70
- INT32 = 0x2b,
71
- /** class=analog, length=5, non-value=0x8000000000 */
72
- INT40 = 0x2c,
73
- /** class=analog, length=6, non-value=0x800000000000 */
74
- INT48 = 0x2d,
75
- /** class=analog, length=7, non-value=0x80000000000000 */
76
- INT56 = 0x2e,
77
- /** class=analog, length=8, non-value=0x8000000000000000 */
78
- INT64 = 0x2f,
79
- /** class=discrete, length=1, non-value=0xFF */
80
- ENUM8 = 0x30,
81
- /** class=discrete, length=2, non-value=0xFF */
82
- ENUM16 = 0x31,
83
-
84
- /** class=analog, length=2, non-value=NaN */
85
- SEMI_PREC = 0x38,
86
- /** class=analog, length=4, non-value=NaN */
87
- SINGLE_PREC = 0x39,
88
- /** class=analog, length=8, non-value=NaN */
89
- DOUBLE_PREC = 0x3a,
90
-
91
- /** class=composite, length=0x00-0xFE, non-value=0xFF */
92
- OCTET_STR = 0x41,
93
- /** class=composite, length=0x00-0xFE, non-value=0xFF */
94
- CHAR_STR = 0x42,
95
- /** class=composite, length=0x0000-0xFFFE, non-value=0xFFFF */
96
- LONG_OCTET_STR = 0x43,
97
- /** class=composite, length=0x0000-0xFFFE, non-value=0xFFFF */
98
- LONG_CHAR_STR = 0x44,
99
-
100
- /** class=composite, length=variable, non-value=(length=0xFFFF) */
101
- ARRAY = 0x48,
102
-
103
- /** class=composite, length=variable, non-value=(length=0xFFFF) */
104
- STRUCT = 0x4c,
105
-
106
- /** class=composite, length=max(0xFFFE * DataType) non-value=(length=0xFFFF) */
107
- SET = 0x50,
108
- /** @see SET Same but allows duplicate values */
109
- BAG = 0x51,
110
-
111
- /** Time of Day, @see ZclTimeOfDay , class=analog, length=4, unused-subfield=0xFF, non-value=0xFFFFFFFF */
112
- TOD = 0xe0,
113
- /** @see ZclDate , class=analog, length=4, unused-subfield=0xFF, non-value=0xFFFFFFFF */
114
- DATE = 0xe1,
115
- /** Number of seconds since 2000-01-01 00:00:00 UTC, class=analog, length=4, non-value=0xFFFFFFFF */
116
- UTC = 0xe2,
117
-
118
- /** Defined in 2.6.1.3 of ZCL spec, class=discrete, length=2, non-value=0xFFFF */
119
- CLUSTER_ID = 0xe8,
120
- /** Defined in 2.6.1.4 of ZCL spec, class=discrete, length=2, non-value=0xFFFF */
121
- ATTR_ID = 0xe9,
122
- /** BACnet OID, allow internetworking (format defined in BACnet ref), class=discrete, length=4, non-value=0xFFFFFFFF */
123
- BAC_OID = 0xea,
124
-
125
- /** class=discrete, length=8, non-value=0xFFFFFFFFFFFFFFFF */
126
- IEEE_ADDR = 0xf0,
127
- /** Any 128-bit value, class=discrete, length=16 */
128
- SEC_KEY = 0xf1,
129
-
130
- /** length=0 */
131
- UNKNOWN = 0xff,
132
- }
133
-
134
- /** @TODO strings for backwards compat in tests. Should be moved to numbers. */
135
- export enum DataTypeClass {
136
- ANALOG = "ANALOG",
137
- DISCRETE = "DISCRETE",
138
- }
139
-
140
- export enum BuffaloZclDataType {
141
- USE_DATA_TYPE = 1000,
142
- LIST_UINT8 = 1001,
143
- LIST_UINT16 = 1002,
144
- LIST_UINT24 = 1003,
145
- LIST_UINT32 = 1004,
146
- LIST_ZONEINFO = 1005,
147
- EXTENSION_FIELD_SETS = 1006,
148
- LIST_THERMO_TRANSITIONS = 1007,
149
- BUFFER = 1008,
150
- GPD_FRAME = 1009,
151
- STRUCTURED_SELECTOR = 1010,
152
- LIST_TUYA_DATAPOINT_VALUES = 1011,
153
- LIST_MIBOXER_ZONES = 1012,
154
- BIG_ENDIAN_UINT24 = 1013,
155
- MI_STRUCT = 1014,
156
- }
157
-
158
- /** @TODO strings for backwards compat in tests. Should be moved to numbers. */
159
- export enum ParameterCondition {
160
- MINIMUM_REMAINING_BUFFER_BYTES = "minimumRemainingBufferBytes",
161
- BITMASK_SET = "bitMaskSet",
162
- BITFIELD_ENUM = "bitFieldEnum",
163
- DATA_TYPE_CLASS_EQUAL = "dataTypeValueTypeEquals",
164
- FIELD_EQUAL = "fieldEquals",
165
- FIELD_GT = "fieldGT",
166
- }
167
-
168
- export enum FrameType {
169
- GLOBAL = 0,
170
- SPECIFIC = 1,
171
- }
172
-
173
- export enum Direction {
174
- CLIENT_TO_SERVER = 0,
175
- SERVER_TO_CLIENT = 1,
176
- }
177
-
178
- /**
179
- * The upper 4 bits of the Indicator subfield for Attributes Structured commands.
180
- */
181
- export enum StructuredIndicatorType {
182
- /**
183
- * Write: Only for attributes of type other than array, structure, set or bag
184
- *
185
- * Read: Only for attributes of type other than array or structure
186
- */
187
- Whole = 0x00,
188
- /** Add element to the set/bag */
189
- WriteAdd = 0x10,
190
- /** Remove element from the set/bag */
191
- WriteRemove = 0x20,
192
- }
193
-
194
- /** Mapping of descriptive string power to source bits. */
195
- export enum PowerSource {
196
- Unknown = 0,
197
- "Mains (single phase)" = 1,
198
- "Mains (3 phase)" = 2,
199
- Battery = 3,
200
- "DC Source" = 4,
201
- "Emergency mains constantly powered" = 5,
202
- "Emergency mains and transfer switch" = 6,
203
- }
@@ -1,329 +0,0 @@
1
- import {BuffaloZclDataType, DataType, DataTypeClass, Direction, ParameterCondition} from "./enums";
2
- import {Status} from "./status";
3
- import type {ParameterDefinition} from "./tstype";
4
-
5
- export type FoundationCommandName =
6
- | "read"
7
- | "readRsp"
8
- | "write"
9
- | "writeUndiv"
10
- | "writeRsp"
11
- | "writeNoRsp"
12
- | "configReport"
13
- | "configReportRsp"
14
- | "readReportConfig"
15
- | "readReportConfigRsp"
16
- | "report"
17
- | "defaultRsp"
18
- | "discover"
19
- | "discoverRsp"
20
- | "readStructured"
21
- | "writeStructured"
22
- | "writeStructuredRsp"
23
- | "discoverCommands"
24
- | "discoverCommandsRsp"
25
- | "discoverCommandsGen"
26
- | "discoverCommandsGenRsp"
27
- | "discoverExt"
28
- | "discoverExtRsp";
29
-
30
- export interface FoundationDefinition {
31
- ID: number;
32
- parseStrategy: "repetitive" | "flat" | "oneof";
33
- parameters: readonly ParameterDefinition[];
34
- response?: number;
35
- }
36
-
37
- export const Foundation: Readonly<Record<FoundationCommandName, Readonly<FoundationDefinition>>> = {
38
- /** Read Attributes */
39
- read: {
40
- ID: 0x00,
41
- parseStrategy: "repetitive",
42
- parameters: [{name: "attrId", type: DataType.UINT16}],
43
- response: 0x01, // readRsp
44
- },
45
- /** Read Attributes Response */
46
- readRsp: {
47
- ID: 0x01,
48
- parseStrategy: "repetitive",
49
- parameters: [
50
- {name: "attrId", type: DataType.UINT16},
51
- {name: "status", type: DataType.UINT8},
52
- {name: "dataType", type: DataType.UINT8, conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "status", value: Status.SUCCESS}]},
53
- {
54
- name: "attrData",
55
- type: BuffaloZclDataType.USE_DATA_TYPE,
56
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "status", value: Status.SUCCESS}],
57
- },
58
- ],
59
- },
60
- /** Write Attributes */
61
- write: {
62
- ID: 0x02,
63
- parseStrategy: "repetitive",
64
- parameters: [
65
- {name: "attrId", type: DataType.UINT16},
66
- {name: "dataType", type: DataType.UINT8},
67
- {name: "attrData", type: BuffaloZclDataType.USE_DATA_TYPE},
68
- ],
69
- response: 0x04, // writeRsp
70
- },
71
- /** Write Attributes Undivided */
72
- writeUndiv: {
73
- ID: 0x03,
74
- parseStrategy: "repetitive",
75
- parameters: [
76
- {name: "attrId", type: DataType.UINT16},
77
- {name: "dataType", type: DataType.UINT8},
78
- {name: "attrData", type: BuffaloZclDataType.USE_DATA_TYPE},
79
- ],
80
- },
81
- /** Write Attributes Response */
82
- writeRsp: {
83
- ID: 0x04,
84
- parseStrategy: "repetitive",
85
- parameters: [
86
- {name: "status", type: DataType.UINT8},
87
- {
88
- name: "attrId",
89
- type: DataType.UINT16,
90
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "status", reversed: true, value: Status.SUCCESS}],
91
- },
92
- ],
93
- },
94
- /** Write Attributes No Response */
95
- writeNoRsp: {
96
- ID: 0x05,
97
- parseStrategy: "repetitive",
98
- parameters: [
99
- {name: "attrId", type: DataType.UINT16},
100
- {name: "dataType", type: DataType.UINT8},
101
- {name: "attrData", type: BuffaloZclDataType.USE_DATA_TYPE},
102
- ],
103
- },
104
- /** Configure Reporting */
105
- configReport: {
106
- ID: 0x06,
107
- parseStrategy: "repetitive",
108
- parameters: [
109
- {name: "direction", type: DataType.UINT8},
110
- {name: "attrId", type: DataType.UINT16},
111
- {
112
- name: "dataType",
113
- type: DataType.UINT8,
114
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER}],
115
- },
116
- {
117
- name: "minRepIntval",
118
- type: DataType.UINT16,
119
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER}],
120
- },
121
- {
122
- name: "maxRepIntval",
123
- type: DataType.UINT16,
124
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER}],
125
- },
126
- {
127
- name: "repChange",
128
- type: BuffaloZclDataType.USE_DATA_TYPE,
129
- conditions: [
130
- {type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER},
131
- {type: ParameterCondition.DATA_TYPE_CLASS_EQUAL, value: DataTypeClass.ANALOG},
132
- ],
133
- },
134
- {
135
- name: "timeout",
136
- type: DataType.UINT16,
137
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.SERVER_TO_CLIENT}],
138
- },
139
- ],
140
- response: 0x07, // configReportRsp
141
- },
142
- /** Configure Reporting Response */
143
- configReportRsp: {
144
- ID: 0x07,
145
- parseStrategy: "repetitive",
146
- parameters: [
147
- {name: "status", type: DataType.UINT8},
148
- // minimumRemainingBufferBytes: if direction is present, attrId is also present
149
- // https://github.com/Koenkk/zigbee-herdsman/pull/115
150
- {name: "direction", type: DataType.UINT8, conditions: [{type: ParameterCondition.MINIMUM_REMAINING_BUFFER_BYTES, value: 3}]},
151
- {name: "attrId", type: DataType.UINT16, conditions: [{type: ParameterCondition.MINIMUM_REMAINING_BUFFER_BYTES, value: 2}]},
152
- ],
153
- },
154
- /** Read Reporting Configuration */
155
- readReportConfig: {
156
- ID: 0x08,
157
- parseStrategy: "repetitive",
158
- parameters: [
159
- {name: "direction", type: DataType.UINT8},
160
- {name: "attrId", type: DataType.UINT16},
161
- ],
162
- response: 0x09, // readReportConfigRsp
163
- },
164
- /** Read Reporting Configuration Response */
165
- readReportConfigRsp: {
166
- ID: 0x09,
167
- parseStrategy: "repetitive",
168
- parameters: [
169
- {name: "status", type: DataType.UINT8},
170
- {name: "direction", type: DataType.UINT8},
171
- {name: "attrId", type: DataType.UINT16},
172
- {
173
- name: "dataType",
174
- type: DataType.UINT8,
175
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER}],
176
- },
177
- {
178
- name: "minRepIntval",
179
- type: DataType.UINT16,
180
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER}],
181
- },
182
- {
183
- name: "maxRepIntval",
184
- type: DataType.UINT16,
185
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER}],
186
- },
187
- {
188
- name: "repChange",
189
- type: BuffaloZclDataType.USE_DATA_TYPE,
190
- conditions: [
191
- {type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.CLIENT_TO_SERVER},
192
- {type: ParameterCondition.DATA_TYPE_CLASS_EQUAL, value: DataTypeClass.ANALOG},
193
- ],
194
- },
195
- {
196
- name: "timeout",
197
- type: DataType.UINT16,
198
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "direction", value: Direction.SERVER_TO_CLIENT}],
199
- },
200
- ],
201
- },
202
- /** Report attributes */
203
- report: {
204
- ID: 0x0a,
205
- parseStrategy: "repetitive",
206
- parameters: [
207
- {name: "attrId", type: DataType.UINT16},
208
- {name: "dataType", type: DataType.UINT8},
209
- {name: "attrData", type: BuffaloZclDataType.USE_DATA_TYPE},
210
- ],
211
- },
212
- /** Default Response */
213
- defaultRsp: {
214
- ID: 0x0b,
215
- parseStrategy: "flat",
216
- parameters: [
217
- {name: "cmdId", type: DataType.UINT8},
218
- {name: "statusCode", type: DataType.UINT8},
219
- ],
220
- },
221
- /** Discover Attributes */
222
- discover: {
223
- ID: 0x0c,
224
- parseStrategy: "flat",
225
- parameters: [
226
- {name: "startAttrId", type: DataType.UINT16},
227
- {name: "maxAttrIds", type: DataType.UINT8},
228
- ],
229
- },
230
- /** Discover Attributes Response */
231
- discoverRsp: {
232
- ID: 0x0d,
233
- parseStrategy: "oneof",
234
- parameters: [
235
- {name: "attrId", type: DataType.UINT16},
236
- {name: "dataType", type: DataType.UINT8},
237
- ],
238
- },
239
- /** Read Attributes Structured */
240
- readStructured: {
241
- ID: 0x0e,
242
- parseStrategy: "repetitive",
243
- parameters: [
244
- {name: "attrId", type: DataType.UINT16},
245
- {name: "selector", type: BuffaloZclDataType.STRUCTURED_SELECTOR},
246
- ],
247
- },
248
- /** Write Attributes Structured */
249
- writeStructured: {
250
- ID: 0x0f,
251
- parseStrategy: "repetitive",
252
- parameters: [
253
- {name: "attrId", type: DataType.UINT16},
254
- {name: "selector", type: BuffaloZclDataType.STRUCTURED_SELECTOR},
255
- {name: "dataType", type: DataType.UINT8},
256
- {name: "elementData", type: BuffaloZclDataType.USE_DATA_TYPE},
257
- ],
258
- response: 0x10, // writeStructuredRsp
259
- },
260
- /** Write Attributes Structured response */
261
- writeStructuredRsp: {
262
- ID: 0x10,
263
- parseStrategy: "repetitive",
264
- // contains only one SUCCESS record for all written attributes if all written successfully
265
- parameters: [
266
- {name: "status", type: DataType.UINT8},
267
- {
268
- name: "attrId",
269
- type: DataType.UINT16,
270
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "status", reversed: true, value: Status.SUCCESS}],
271
- },
272
- // always one zero-octet if failed attribute not of type array or structure, otherwise can also be zero if no info on which element caused failure
273
- {
274
- name: "selector",
275
- type: BuffaloZclDataType.STRUCTURED_SELECTOR,
276
- conditions: [{type: ParameterCondition.FIELD_EQUAL, field: "status", reversed: true, value: Status.SUCCESS}],
277
- },
278
- ],
279
- },
280
- /** Discover Commands Received */
281
- discoverCommands: {
282
- ID: 0x11,
283
- parseStrategy: "flat",
284
- parameters: [
285
- {name: "startCmdId", type: DataType.UINT8},
286
- {name: "maxCmdIds", type: DataType.UINT8},
287
- ],
288
- },
289
- /** Discover Commands Received Response */
290
- discoverCommandsRsp: {
291
- ID: 0x12,
292
- parseStrategy: "oneof",
293
- parameters: [{name: "cmdId", type: DataType.UINT8}],
294
- },
295
- /** Discover Commands Generated */
296
- discoverCommandsGen: {
297
- ID: 0x13,
298
- parseStrategy: "flat",
299
- parameters: [
300
- {name: "startCmdId", type: DataType.UINT8},
301
- {name: "maxCmdIds", type: DataType.UINT8},
302
- ],
303
- },
304
- /** Discover Commands Generated Response */
305
- discoverCommandsGenRsp: {
306
- ID: 0x14,
307
- parseStrategy: "oneof",
308
- parameters: [{name: "cmdId", type: DataType.UINT8}],
309
- },
310
- /** Discover Attributes Extended */
311
- discoverExt: {
312
- ID: 0x15,
313
- parseStrategy: "flat",
314
- parameters: [
315
- {name: "startAttrId", type: DataType.UINT16},
316
- {name: "maxAttrIds", type: DataType.UINT8},
317
- ],
318
- },
319
- /** Discover Attributes Extended Response */
320
- discoverExtRsp: {
321
- ID: 0x16,
322
- parseStrategy: "oneof",
323
- parameters: [
324
- {name: "attrId", type: DataType.UINT16},
325
- {name: "dataType", type: DataType.UINT8},
326
- {name: "access", type: DataType.UINT8},
327
- ],
328
- },
329
- };