zigbee-herdsman 6.0.1 → 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 (260) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/adapter/ezsp/driver/uart.js +1 -1
  3. package/dist/adapter/ezsp/driver/uart.js.map +1 -1
  4. package/dist/adapter/z-stack/adapter/zStackAdapter.js +4 -4
  5. package/dist/adapter/z-stack/adapter/zStackAdapter.js.map +1 -1
  6. package/dist/adapter/zigate/adapter/zigateAdapter.js +4 -4
  7. package/dist/adapter/zigate/adapter/zigateAdapter.js.map +1 -1
  8. package/dist/controller/model/device.d.ts.map +1 -1
  9. package/dist/controller/model/device.js +1 -0
  10. package/dist/controller/model/device.js.map +1 -1
  11. package/package.json +14 -6
  12. package/.github/ISSUE_TEMPLATE/config.yml +0 -5
  13. package/.github/dependabot.yml +0 -22
  14. package/.github/workflows/ci.yml +0 -64
  15. package/.github/workflows/release-please.yml +0 -18
  16. package/.github/workflows/stale.yml +0 -20
  17. package/.github/workflows/typedoc.yaml +0 -47
  18. package/.release-please-manifest.json +0 -3
  19. package/.vscode/extensions.json +0 -3
  20. package/.vscode/settings.json +0 -11
  21. package/biome.json +0 -98
  22. package/examples/join-and-log.js +0 -24
  23. package/release-please-config.json +0 -9
  24. package/src/adapter/adapter.ts +0 -189
  25. package/src/adapter/adapterDiscovery.ts +0 -666
  26. package/src/adapter/const.ts +0 -12
  27. package/src/adapter/deconz/adapter/deconzAdapter.ts +0 -877
  28. package/src/adapter/deconz/driver/constants.ts +0 -246
  29. package/src/adapter/deconz/driver/driver.ts +0 -1540
  30. package/src/adapter/deconz/driver/frame.ts +0 -11
  31. package/src/adapter/deconz/driver/frameParser.ts +0 -753
  32. package/src/adapter/deconz/driver/parser.ts +0 -45
  33. package/src/adapter/deconz/driver/writer.ts +0 -22
  34. package/src/adapter/deconz/types.d.ts +0 -13
  35. package/src/adapter/ember/adapter/emberAdapter.ts +0 -2265
  36. package/src/adapter/ember/adapter/endpoints.ts +0 -86
  37. package/src/adapter/ember/adapter/oneWaitress.ts +0 -324
  38. package/src/adapter/ember/adapter/tokensManager.ts +0 -782
  39. package/src/adapter/ember/consts.ts +0 -178
  40. package/src/adapter/ember/enums.ts +0 -1746
  41. package/src/adapter/ember/ezsp/buffalo.ts +0 -1392
  42. package/src/adapter/ember/ezsp/consts.ts +0 -148
  43. package/src/adapter/ember/ezsp/enums.ts +0 -1114
  44. package/src/adapter/ember/ezsp/ezsp.ts +0 -9061
  45. package/src/adapter/ember/ezspError.ts +0 -10
  46. package/src/adapter/ember/types.ts +0 -866
  47. package/src/adapter/ember/uart/ash.ts +0 -1960
  48. package/src/adapter/ember/uart/consts.ts +0 -109
  49. package/src/adapter/ember/uart/enums.ts +0 -192
  50. package/src/adapter/ember/uart/parser.ts +0 -48
  51. package/src/adapter/ember/uart/queues.ts +0 -247
  52. package/src/adapter/ember/uart/writer.ts +0 -53
  53. package/src/adapter/ember/utils/initters.ts +0 -58
  54. package/src/adapter/ember/utils/math.ts +0 -73
  55. package/src/adapter/events.ts +0 -21
  56. package/src/adapter/ezsp/adapter/backup.ts +0 -109
  57. package/src/adapter/ezsp/adapter/ezspAdapter.ts +0 -614
  58. package/src/adapter/ezsp/driver/commands.ts +0 -2497
  59. package/src/adapter/ezsp/driver/consts.ts +0 -11
  60. package/src/adapter/ezsp/driver/driver.ts +0 -1002
  61. package/src/adapter/ezsp/driver/ezsp.ts +0 -802
  62. package/src/adapter/ezsp/driver/frame.ts +0 -101
  63. package/src/adapter/ezsp/driver/index.ts +0 -4
  64. package/src/adapter/ezsp/driver/multicast.ts +0 -78
  65. package/src/adapter/ezsp/driver/parser.ts +0 -81
  66. package/src/adapter/ezsp/driver/types/basic.ts +0 -201
  67. package/src/adapter/ezsp/driver/types/index.ts +0 -239
  68. package/src/adapter/ezsp/driver/types/named.ts +0 -2330
  69. package/src/adapter/ezsp/driver/types/struct.ts +0 -844
  70. package/src/adapter/ezsp/driver/uart.ts +0 -460
  71. package/src/adapter/ezsp/driver/utils/crc16ccitt.ts +0 -44
  72. package/src/adapter/ezsp/driver/utils/index.ts +0 -32
  73. package/src/adapter/ezsp/driver/writer.ts +0 -64
  74. package/src/adapter/index.ts +0 -3
  75. package/src/adapter/serialPort.ts +0 -58
  76. package/src/adapter/socketPortUtils.ts +0 -16
  77. package/src/adapter/tstype.ts +0 -78
  78. package/src/adapter/z-stack/adapter/adapter-backup.ts +0 -519
  79. package/src/adapter/z-stack/adapter/adapter-nv-memory.ts +0 -457
  80. package/src/adapter/z-stack/adapter/endpoints.ts +0 -57
  81. package/src/adapter/z-stack/adapter/manager.ts +0 -543
  82. package/src/adapter/z-stack/adapter/tstype.ts +0 -6
  83. package/src/adapter/z-stack/adapter/zStackAdapter.ts +0 -1190
  84. package/src/adapter/z-stack/constants/af.ts +0 -27
  85. package/src/adapter/z-stack/constants/common.ts +0 -285
  86. package/src/adapter/z-stack/constants/dbg.ts +0 -23
  87. package/src/adapter/z-stack/constants/index.ts +0 -11
  88. package/src/adapter/z-stack/constants/mac.ts +0 -128
  89. package/src/adapter/z-stack/constants/sapi.ts +0 -25
  90. package/src/adapter/z-stack/constants/sys.ts +0 -72
  91. package/src/adapter/z-stack/constants/util.ts +0 -82
  92. package/src/adapter/z-stack/constants/utils.ts +0 -14
  93. package/src/adapter/z-stack/constants/zdo.ts +0 -103
  94. package/src/adapter/z-stack/models/startup-options.ts +0 -13
  95. package/src/adapter/z-stack/structs/entries/address-manager-entry.ts +0 -44
  96. package/src/adapter/z-stack/structs/entries/address-manager-table.ts +0 -19
  97. package/src/adapter/z-stack/structs/entries/aps-link-key-data-entry.ts +0 -12
  98. package/src/adapter/z-stack/structs/entries/aps-link-key-data-table.ts +0 -21
  99. package/src/adapter/z-stack/structs/entries/aps-tc-link-key-entry.ts +0 -19
  100. package/src/adapter/z-stack/structs/entries/aps-tc-link-key-table.ts +0 -21
  101. package/src/adapter/z-stack/structs/entries/channel-list.ts +0 -8
  102. package/src/adapter/z-stack/structs/entries/has-configured.ts +0 -16
  103. package/src/adapter/z-stack/structs/entries/index.ts +0 -16
  104. package/src/adapter/z-stack/structs/entries/nib.ts +0 -66
  105. package/src/adapter/z-stack/structs/entries/nwk-key-descriptor.ts +0 -15
  106. package/src/adapter/z-stack/structs/entries/nwk-key.ts +0 -13
  107. package/src/adapter/z-stack/structs/entries/nwk-pan-id.ts +0 -8
  108. package/src/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-entry.ts +0 -20
  109. package/src/adapter/z-stack/structs/entries/nwk-sec-material-descriptor-table.ts +0 -19
  110. package/src/adapter/z-stack/structs/entries/security-manager-entry.ts +0 -33
  111. package/src/adapter/z-stack/structs/entries/security-manager-table.ts +0 -22
  112. package/src/adapter/z-stack/structs/index.ts +0 -4
  113. package/src/adapter/z-stack/structs/serializable-memory-object.ts +0 -14
  114. package/src/adapter/z-stack/structs/struct.ts +0 -367
  115. package/src/adapter/z-stack/structs/table.ts +0 -198
  116. package/src/adapter/z-stack/unpi/constants.ts +0 -33
  117. package/src/adapter/z-stack/unpi/frame.ts +0 -62
  118. package/src/adapter/z-stack/unpi/index.ts +0 -4
  119. package/src/adapter/z-stack/unpi/parser.ts +0 -56
  120. package/src/adapter/z-stack/unpi/writer.ts +0 -21
  121. package/src/adapter/z-stack/utils/channel-list.ts +0 -40
  122. package/src/adapter/z-stack/utils/index.ts +0 -2
  123. package/src/adapter/z-stack/utils/network-options.ts +0 -26
  124. package/src/adapter/z-stack/znp/buffaloZnp.ts +0 -175
  125. package/src/adapter/z-stack/znp/definition.ts +0 -2713
  126. package/src/adapter/z-stack/znp/index.ts +0 -2
  127. package/src/adapter/z-stack/znp/parameterType.ts +0 -22
  128. package/src/adapter/z-stack/znp/tstype.ts +0 -44
  129. package/src/adapter/z-stack/znp/utils.ts +0 -10
  130. package/src/adapter/z-stack/znp/znp.ts +0 -342
  131. package/src/adapter/z-stack/znp/zpiObject.ts +0 -148
  132. package/src/adapter/zboss/adapter/zbossAdapter.ts +0 -526
  133. package/src/adapter/zboss/commands.ts +0 -1184
  134. package/src/adapter/zboss/consts.ts +0 -9
  135. package/src/adapter/zboss/driver.ts +0 -422
  136. package/src/adapter/zboss/enums.ts +0 -360
  137. package/src/adapter/zboss/frame.ts +0 -227
  138. package/src/adapter/zboss/reader.ts +0 -65
  139. package/src/adapter/zboss/types.ts +0 -0
  140. package/src/adapter/zboss/uart.ts +0 -428
  141. package/src/adapter/zboss/utils.ts +0 -58
  142. package/src/adapter/zboss/writer.ts +0 -49
  143. package/src/adapter/zigate/adapter/patchZdoBuffaloBE.ts +0 -27
  144. package/src/adapter/zigate/adapter/zigateAdapter.ts +0 -618
  145. package/src/adapter/zigate/driver/LICENSE +0 -17
  146. package/src/adapter/zigate/driver/buffaloZiGate.ts +0 -212
  147. package/src/adapter/zigate/driver/commandType.ts +0 -418
  148. package/src/adapter/zigate/driver/constants.ts +0 -150
  149. package/src/adapter/zigate/driver/frame.ts +0 -197
  150. package/src/adapter/zigate/driver/messageType.ts +0 -287
  151. package/src/adapter/zigate/driver/parameterType.ts +0 -32
  152. package/src/adapter/zigate/driver/ziGateObject.ts +0 -146
  153. package/src/adapter/zigate/driver/zigate.ts +0 -423
  154. package/src/adapter/zoh/adapter/utils.ts +0 -27
  155. package/src/adapter/zoh/adapter/zohAdapter.ts +0 -838
  156. package/src/buffalo/buffalo.ts +0 -342
  157. package/src/buffalo/index.ts +0 -1
  158. package/src/controller/controller.ts +0 -1022
  159. package/src/controller/database.ts +0 -124
  160. package/src/controller/events.ts +0 -52
  161. package/src/controller/greenPower.ts +0 -603
  162. package/src/controller/helpers/index.ts +0 -1
  163. package/src/controller/helpers/installCodes.ts +0 -107
  164. package/src/controller/helpers/request.ts +0 -96
  165. package/src/controller/helpers/requestQueue.ts +0 -125
  166. package/src/controller/helpers/zclFrameConverter.ts +0 -47
  167. package/src/controller/helpers/zclTransactionSequenceNumber.ts +0 -19
  168. package/src/controller/index.ts +0 -6
  169. package/src/controller/model/device.ts +0 -1248
  170. package/src/controller/model/endpoint.ts +0 -1105
  171. package/src/controller/model/entity.ts +0 -23
  172. package/src/controller/model/group.ts +0 -424
  173. package/src/controller/model/index.ts +0 -5
  174. package/src/controller/model/zigbeeEntity.ts +0 -30
  175. package/src/controller/touchlink.ts +0 -189
  176. package/src/controller/tstype.ts +0 -274
  177. package/src/index.ts +0 -12
  178. package/src/models/backup-storage-legacy.ts +0 -48
  179. package/src/models/backup-storage-unified.ts +0 -47
  180. package/src/models/backup.ts +0 -37
  181. package/src/models/index.ts +0 -5
  182. package/src/models/network-options.ts +0 -11
  183. package/src/utils/backup.ts +0 -152
  184. package/src/utils/index.ts +0 -5
  185. package/src/utils/logger.ts +0 -20
  186. package/src/utils/patchBigIntSerialization.ts +0 -8
  187. package/src/utils/queue.ts +0 -76
  188. package/src/utils/types.d.ts +0 -3
  189. package/src/utils/utils.ts +0 -19
  190. package/src/utils/wait.ts +0 -5
  191. package/src/utils/waitress.ts +0 -96
  192. package/src/zspec/consts.ts +0 -84
  193. package/src/zspec/enums.ts +0 -22
  194. package/src/zspec/index.ts +0 -3
  195. package/src/zspec/tstypes.ts +0 -18
  196. package/src/zspec/utils.ts +0 -247
  197. package/src/zspec/zcl/buffaloZcl.ts +0 -1220
  198. package/src/zspec/zcl/definition/cluster.ts +0 -5915
  199. package/src/zspec/zcl/definition/clusters-typegen.ts +0 -588
  200. package/src/zspec/zcl/definition/clusters-types.ts +0 -7331
  201. package/src/zspec/zcl/definition/consts.ts +0 -24
  202. package/src/zspec/zcl/definition/enums.ts +0 -203
  203. package/src/zspec/zcl/definition/foundation.ts +0 -329
  204. package/src/zspec/zcl/definition/manufacturerCode.ts +0 -729
  205. package/src/zspec/zcl/definition/status.ts +0 -69
  206. package/src/zspec/zcl/definition/tstype.ts +0 -377
  207. package/src/zspec/zcl/index.ts +0 -11
  208. package/src/zspec/zcl/utils.ts +0 -321
  209. package/src/zspec/zcl/zclFrame.ts +0 -356
  210. package/src/zspec/zcl/zclHeader.ts +0 -102
  211. package/src/zspec/zcl/zclStatusError.ts +0 -10
  212. package/src/zspec/zdo/buffaloZdo.ts +0 -2336
  213. package/src/zspec/zdo/definition/clusters.ts +0 -722
  214. package/src/zspec/zdo/definition/consts.ts +0 -16
  215. package/src/zspec/zdo/definition/enums.ts +0 -99
  216. package/src/zspec/zdo/definition/status.ts +0 -105
  217. package/src/zspec/zdo/definition/tstypes.ts +0 -1062
  218. package/src/zspec/zdo/index.ts +0 -7
  219. package/src/zspec/zdo/utils.ts +0 -76
  220. package/src/zspec/zdo/zdoStatusError.ts +0 -10
  221. package/test/adapter/adapter.test.ts +0 -1062
  222. package/test/adapter/ember/ash.test.ts +0 -337
  223. package/test/adapter/ember/consts.ts +0 -131
  224. package/test/adapter/ember/emberAdapter.test.ts +0 -3449
  225. package/test/adapter/ember/ezsp.test.ts +0 -385
  226. package/test/adapter/ember/ezspBuffalo.test.ts +0 -93
  227. package/test/adapter/ember/ezspError.test.ts +0 -12
  228. package/test/adapter/ember/math.test.ts +0 -206
  229. package/test/adapter/ezsp/frame.test.ts +0 -30
  230. package/test/adapter/ezsp/uart.test.ts +0 -181
  231. package/test/adapter/z-stack/adapter.test.ts +0 -3984
  232. package/test/adapter/z-stack/constants.test.ts +0 -33
  233. package/test/adapter/z-stack/structs.test.ts +0 -115
  234. package/test/adapter/z-stack/unpi.test.ts +0 -213
  235. package/test/adapter/z-stack/znp.test.ts +0 -1284
  236. package/test/adapter/zboss/fixZdoResponse.test.ts +0 -179
  237. package/test/adapter/zigate/patchZdoBuffaloBE.test.ts +0 -81
  238. package/test/adapter/zigate/zdo.test.ts +0 -187
  239. package/test/adapter/zoh/utils.test.ts +0 -36
  240. package/test/adapter/zoh/zohAdapter.test.ts +0 -1307
  241. package/test/buffalo.test.ts +0 -431
  242. package/test/controller.bench.ts +0 -193
  243. package/test/controller.test.ts +0 -8702
  244. package/test/greenpower.test.ts +0 -1408
  245. package/test/mockAdapters.ts +0 -65
  246. package/test/mockDevices.ts +0 -598
  247. package/test/requests.bench.ts +0 -206
  248. package/test/testUtils.ts +0 -20
  249. package/test/tsconfig.json +0 -9
  250. package/test/utils/math.ts +0 -19
  251. package/test/utils.test.ts +0 -279
  252. package/test/vitest.config.mts +0 -27
  253. package/test/zcl.test.ts +0 -2831
  254. package/test/zspec/utils.test.ts +0 -68
  255. package/test/zspec/zcl/buffalo.test.ts +0 -1374
  256. package/test/zspec/zcl/frame.test.ts +0 -960
  257. package/test/zspec/zcl/utils.test.ts +0 -273
  258. package/test/zspec/zdo/buffalo.test.ts +0 -1850
  259. package/test/zspec/zdo/utils.test.ts +0 -241
  260. 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
- };