@willieee802/zigbee-herdsman-converters 19.44.0 → 19.44.2

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 (1609) hide show
  1. package/dist/converters/actions.d.ts +36 -0
  2. package/dist/converters/actions.d.ts.map +1 -0
  3. package/dist/converters/actions.js +137 -0
  4. package/dist/converters/actions.js.map +1 -0
  5. package/dist/converters/fromZigbee.d.ts +293 -0
  6. package/dist/converters/fromZigbee.d.ts.map +1 -0
  7. package/dist/converters/fromZigbee.js +5192 -0
  8. package/dist/converters/fromZigbee.js.map +1 -0
  9. package/dist/converters/toZigbee.d.ts +235 -0
  10. package/dist/converters/toZigbee.d.ts.map +1 -0
  11. package/dist/converters/toZigbee.js +4577 -0
  12. package/dist/converters/toZigbee.js.map +1 -0
  13. package/dist/devices/ITCommander.d.ts +3 -0
  14. package/dist/devices/ITCommander.d.ts.map +1 -0
  15. package/dist/devices/ITCommander.js +73 -0
  16. package/dist/devices/ITCommander.js.map +1 -0
  17. package/dist/devices/acova.d.ts +3 -0
  18. package/dist/devices/acova.d.ts.map +1 -0
  19. package/dist/devices/acova.js +124 -0
  20. package/dist/devices/acova.js.map +1 -0
  21. package/dist/devices/acuity_brands_lighting.d.ts +3 -0
  22. package/dist/devices/acuity_brands_lighting.d.ts.map +1 -0
  23. package/dist/devices/acuity_brands_lighting.js +61 -0
  24. package/dist/devices/acuity_brands_lighting.js.map +1 -0
  25. package/dist/devices/adeo.d.ts +3 -0
  26. package/dist/devices/adeo.d.ts.map +1 -0
  27. package/dist/devices/adeo.js +518 -0
  28. package/dist/devices/adeo.js.map +1 -0
  29. package/dist/devices/adurosmart.d.ts +3 -0
  30. package/dist/devices/adurosmart.d.ts.map +1 -0
  31. package/dist/devices/adurosmart.js +235 -0
  32. package/dist/devices/adurosmart.js.map +1 -0
  33. package/dist/devices/aeotec.d.ts +3 -0
  34. package/dist/devices/aeotec.d.ts.map +1 -0
  35. package/dist/devices/aeotec.js +95 -0
  36. package/dist/devices/aeotec.js.map +1 -0
  37. package/dist/devices/airam.d.ts +3 -0
  38. package/dist/devices/airam.d.ts.map +1 -0
  39. package/dist/devices/airam.js +102 -0
  40. package/dist/devices/airam.js.map +1 -0
  41. package/dist/devices/airzone_aidoo.d.ts +3 -0
  42. package/dist/devices/airzone_aidoo.d.ts.map +1 -0
  43. package/dist/devices/airzone_aidoo.js +77 -0
  44. package/dist/devices/airzone_aidoo.js.map +1 -0
  45. package/dist/devices/ajax_online.d.ts +3 -0
  46. package/dist/devices/ajax_online.d.ts.map +1 -0
  47. package/dist/devices/ajax_online.js +83 -0
  48. package/dist/devices/ajax_online.js.map +1 -0
  49. package/dist/devices/akuvox.d.ts +3 -0
  50. package/dist/devices/akuvox.d.ts.map +1 -0
  51. package/dist/devices/akuvox.js +65 -0
  52. package/dist/devices/akuvox.js.map +1 -0
  53. package/dist/devices/alchemy.d.ts +3 -0
  54. package/dist/devices/alchemy.d.ts.map +1 -0
  55. package/dist/devices/alchemy.js +54 -0
  56. package/dist/devices/alchemy.js.map +1 -0
  57. package/dist/devices/aldi.d.ts +3 -0
  58. package/dist/devices/aldi.d.ts.map +1 -0
  59. package/dist/devices/aldi.js +54 -0
  60. package/dist/devices/aldi.js.map +1 -0
  61. package/dist/devices/alecto.d.ts +3 -0
  62. package/dist/devices/alecto.d.ts.map +1 -0
  63. package/dist/devices/alecto.js +91 -0
  64. package/dist/devices/alecto.js.map +1 -0
  65. package/dist/devices/amina.d.ts +3 -0
  66. package/dist/devices/amina.d.ts.map +1 -0
  67. package/dist/devices/amina.js +360 -0
  68. package/dist/devices/amina.js.map +1 -0
  69. package/dist/devices/anchor.d.ts +3 -0
  70. package/dist/devices/anchor.d.ts.map +1 -0
  71. package/dist/devices/anchor.js +47 -0
  72. package/dist/devices/anchor.js.map +1 -0
  73. package/dist/devices/atlantic.d.ts +3 -0
  74. package/dist/devices/atlantic.d.ts.map +1 -0
  75. package/dist/devices/atlantic.js +147 -0
  76. package/dist/devices/atlantic.js.map +1 -0
  77. package/dist/devices/atsmart.d.ts +3 -0
  78. package/dist/devices/atsmart.d.ts.map +1 -0
  79. package/dist/devices/atsmart.js +47 -0
  80. package/dist/devices/atsmart.js.map +1 -0
  81. package/dist/devices/aubess.d.ts +3 -0
  82. package/dist/devices/aubess.d.ts.map +1 -0
  83. package/dist/devices/aubess.js +60 -0
  84. package/dist/devices/aubess.js.map +1 -0
  85. package/dist/devices/aurora_lighting.d.ts +3 -0
  86. package/dist/devices/aurora_lighting.d.ts.map +1 -0
  87. package/dist/devices/aurora_lighting.js +347 -0
  88. package/dist/devices/aurora_lighting.js.map +1 -0
  89. package/dist/devices/automaton.d.ts +3 -0
  90. package/dist/devices/automaton.d.ts.map +1 -0
  91. package/dist/devices/automaton.js +64 -0
  92. package/dist/devices/automaton.js.map +1 -0
  93. package/dist/devices/avatto.d.ts +3 -0
  94. package/dist/devices/avatto.d.ts.map +1 -0
  95. package/dist/devices/avatto.js +635 -0
  96. package/dist/devices/avatto.js.map +1 -0
  97. package/dist/devices/awox.d.ts +3 -0
  98. package/dist/devices/awox.d.ts.map +1 -0
  99. package/dist/devices/awox.js +352 -0
  100. package/dist/devices/awox.js.map +1 -0
  101. package/dist/devices/axis.d.ts +3 -0
  102. package/dist/devices/axis.d.ts.map +1 -0
  103. package/dist/devices/axis.js +59 -0
  104. package/dist/devices/axis.js.map +1 -0
  105. package/dist/devices/bacchus.d.ts +3 -0
  106. package/dist/devices/bacchus.d.ts.map +1 -0
  107. package/dist/devices/bacchus.js +902 -0
  108. package/dist/devices/bacchus.js.map +1 -0
  109. package/dist/devices/bankamp.d.ts +3 -0
  110. package/dist/devices/bankamp.d.ts.map +1 -0
  111. package/dist/devices/bankamp.js +47 -0
  112. package/dist/devices/bankamp.js.map +1 -0
  113. package/dist/devices/bega.d.ts +3 -0
  114. package/dist/devices/bega.d.ts.map +1 -0
  115. package/dist/devices/bega.js +68 -0
  116. package/dist/devices/bega.js.map +1 -0
  117. package/dist/devices/belkin.d.ts +3 -0
  118. package/dist/devices/belkin.d.ts.map +1 -0
  119. package/dist/devices/belkin.js +47 -0
  120. package/dist/devices/belkin.js.map +1 -0
  121. package/dist/devices/bitron.d.ts +3 -0
  122. package/dist/devices/bitron.d.ts.map +1 -0
  123. package/dist/devices/bitron.js +357 -0
  124. package/dist/devices/bitron.js.map +1 -0
  125. package/dist/devices/bituo_technik.d.ts +3 -0
  126. package/dist/devices/bituo_technik.d.ts.map +1 -0
  127. package/dist/devices/bituo_technik.js +487 -0
  128. package/dist/devices/bituo_technik.js.map +1 -0
  129. package/dist/devices/blaupunkt.d.ts +3 -0
  130. package/dist/devices/blaupunkt.d.ts.map +1 -0
  131. package/dist/devices/blaupunkt.js +64 -0
  132. package/dist/devices/blaupunkt.js.map +1 -0
  133. package/dist/devices/blitzwolf.d.ts +3 -0
  134. package/dist/devices/blitzwolf.d.ts.map +1 -0
  135. package/dist/devices/blitzwolf.js +77 -0
  136. package/dist/devices/blitzwolf.js.map +1 -0
  137. package/dist/devices/bosch.d.ts +3 -0
  138. package/dist/devices/bosch.d.ts.map +1 -0
  139. package/dist/devices/bosch.js +1381 -0
  140. package/dist/devices/bosch.js.map +1 -0
  141. package/dist/devices/bouffalo_lab.d.ts +3 -0
  142. package/dist/devices/bouffalo_lab.d.ts.map +1 -0
  143. package/dist/devices/bouffalo_lab.js +47 -0
  144. package/dist/devices/bouffalo_lab.js.map +1 -0
  145. package/dist/devices/box.d.ts +3 -0
  146. package/dist/devices/box.d.ts.map +1 -0
  147. package/dist/devices/box.js +370 -0
  148. package/dist/devices/box.js.map +1 -0
  149. package/dist/devices/brimate.d.ts +3 -0
  150. package/dist/devices/brimate.d.ts.map +1 -0
  151. package/dist/devices/brimate.js +51 -0
  152. package/dist/devices/brimate.js.map +1 -0
  153. package/dist/devices/brun_holding.d.ts +3 -0
  154. package/dist/devices/brun_holding.d.ts.map +1 -0
  155. package/dist/devices/brun_holding.js +59 -0
  156. package/dist/devices/brun_holding.js.map +1 -0
  157. package/dist/devices/bseed.d.ts +3 -0
  158. package/dist/devices/bseed.d.ts.map +1 -0
  159. package/dist/devices/bseed.js +53 -0
  160. package/dist/devices/bseed.js.map +1 -0
  161. package/dist/devices/bticino.d.ts +3 -0
  162. package/dist/devices/bticino.d.ts.map +1 -0
  163. package/dist/devices/bticino.js +111 -0
  164. package/dist/devices/bticino.js.map +1 -0
  165. package/dist/devices/bubendorff.d.ts +3 -0
  166. package/dist/devices/bubendorff.d.ts.map +1 -0
  167. package/dist/devices/bubendorff.js +47 -0
  168. package/dist/devices/bubendorff.js.map +1 -0
  169. package/dist/devices/busch_jaeger.d.ts +3 -0
  170. package/dist/devices/busch_jaeger.d.ts.map +1 -0
  171. package/dist/devices/busch_jaeger.js +163 -0
  172. package/dist/devices/busch_jaeger.js.map +1 -0
  173. package/dist/devices/byun.d.ts +3 -0
  174. package/dist/devices/byun.d.ts.map +1 -0
  175. package/dist/devices/byun.js +60 -0
  176. package/dist/devices/byun.js.map +1 -0
  177. package/dist/devices/calex.d.ts +3 -0
  178. package/dist/devices/calex.d.ts.map +1 -0
  179. package/dist/devices/calex.js +87 -0
  180. package/dist/devices/calex.js.map +1 -0
  181. package/dist/devices/candeo.d.ts +3 -0
  182. package/dist/devices/candeo.d.ts.map +1 -0
  183. package/dist/devices/candeo.js +887 -0
  184. package/dist/devices/candeo.js.map +1 -0
  185. package/dist/devices/casaia.d.ts +3 -0
  186. package/dist/devices/casaia.d.ts.map +1 -0
  187. package/dist/devices/casaia.js +95 -0
  188. package/dist/devices/casaia.js.map +1 -0
  189. package/dist/devices/cel.d.ts +3 -0
  190. package/dist/devices/cel.d.ts.map +1 -0
  191. package/dist/devices/cel.js +49 -0
  192. package/dist/devices/cel.js.map +1 -0
  193. package/dist/devices/centralite.d.ts +28 -0
  194. package/dist/devices/centralite.d.ts.map +1 -0
  195. package/dist/devices/centralite.js +440 -0
  196. package/dist/devices/centralite.js.map +1 -0
  197. package/dist/devices/chacon.d.ts +3 -0
  198. package/dist/devices/chacon.d.ts.map +1 -0
  199. package/dist/devices/chacon.js +57 -0
  200. package/dist/devices/chacon.js.map +1 -0
  201. package/dist/devices/cleode.d.ts +3 -0
  202. package/dist/devices/cleode.d.ts.map +1 -0
  203. package/dist/devices/cleode.js +47 -0
  204. package/dist/devices/cleode.js.map +1 -0
  205. package/dist/devices/cleverio.d.ts +3 -0
  206. package/dist/devices/cleverio.d.ts.map +1 -0
  207. package/dist/devices/cleverio.js +74 -0
  208. package/dist/devices/cleverio.js.map +1 -0
  209. package/dist/devices/climax.d.ts +3 -0
  210. package/dist/devices/climax.d.ts.map +1 -0
  211. package/dist/devices/climax.js +184 -0
  212. package/dist/devices/climax.js.map +1 -0
  213. package/dist/devices/commercial_electric.d.ts +3 -0
  214. package/dist/devices/commercial_electric.d.ts.map +1 -0
  215. package/dist/devices/commercial_electric.js +47 -0
  216. package/dist/devices/commercial_electric.js.map +1 -0
  217. package/dist/devices/cree.d.ts +3 -0
  218. package/dist/devices/cree.d.ts.map +1 -0
  219. package/dist/devices/cree.js +47 -0
  220. package/dist/devices/cree.js.map +1 -0
  221. package/dist/devices/ctm.d.ts +3 -0
  222. package/dist/devices/ctm.d.ts.map +1 -0
  223. package/dist/devices/ctm.js +1411 -0
  224. package/dist/devices/ctm.js.map +1 -0
  225. package/dist/devices/current_products_corp.d.ts +3 -0
  226. package/dist/devices/current_products_corp.d.ts.map +1 -0
  227. package/dist/devices/current_products_corp.js +60 -0
  228. package/dist/devices/current_products_corp.js.map +1 -0
  229. package/dist/devices/custom_devices_diy.d.ts +3 -0
  230. package/dist/devices/custom_devices_diy.d.ts.map +1 -0
  231. package/dist/devices/custom_devices_diy.js +1302 -0
  232. package/dist/devices/custom_devices_diy.js.map +1 -0
  233. package/dist/devices/cwd.d.ts +3 -0
  234. package/dist/devices/cwd.d.ts.map +1 -0
  235. package/dist/devices/cwd.js +47 -0
  236. package/dist/devices/cwd.js.map +1 -0
  237. package/dist/devices/cy_lighting.d.ts +3 -0
  238. package/dist/devices/cy_lighting.d.ts.map +1 -0
  239. package/dist/devices/cy_lighting.js +47 -0
  240. package/dist/devices/cy_lighting.js.map +1 -0
  241. package/dist/devices/danalock.d.ts +3 -0
  242. package/dist/devices/danalock.d.ts.map +1 -0
  243. package/dist/devices/danalock.js +61 -0
  244. package/dist/devices/danalock.js.map +1 -0
  245. package/dist/devices/danfoss.d.ts +3 -0
  246. package/dist/devices/danfoss.d.ts.map +1 -0
  247. package/dist/devices/danfoss.js +793 -0
  248. package/dist/devices/danfoss.js.map +1 -0
  249. package/dist/devices/databyte.d.ts +3 -0
  250. package/dist/devices/databyte.d.ts.map +1 -0
  251. package/dist/devices/databyte.js +90 -0
  252. package/dist/devices/databyte.js.map +1 -0
  253. package/dist/devices/datek.d.ts +3 -0
  254. package/dist/devices/datek.d.ts.map +1 -0
  255. package/dist/devices/datek.js +303 -0
  256. package/dist/devices/datek.js.map +1 -0
  257. package/dist/devices/dawon_dns.d.ts +3 -0
  258. package/dist/devices/dawon_dns.d.ts.map +1 -0
  259. package/dist/devices/dawon_dns.js +314 -0
  260. package/dist/devices/dawon_dns.js.map +1 -0
  261. package/dist/devices/develco.d.ts +3 -0
  262. package/dist/devices/develco.d.ts.map +1 -0
  263. package/dist/devices/develco.js +1113 -0
  264. package/dist/devices/develco.js.map +1 -0
  265. package/dist/devices/digi.d.ts +3 -0
  266. package/dist/devices/digi.d.ts.map +1 -0
  267. package/dist/devices/digi.js +24 -0
  268. package/dist/devices/digi.js.map +1 -0
  269. package/dist/devices/direct_signs.d.ts +3 -0
  270. package/dist/devices/direct_signs.d.ts.map +1 -0
  271. package/dist/devices/direct_signs.js +47 -0
  272. package/dist/devices/direct_signs.js.map +1 -0
  273. package/dist/devices/diyruz.d.ts +3 -0
  274. package/dist/devices/diyruz.d.ts.map +1 -0
  275. package/dist/devices/diyruz.js +397 -0
  276. package/dist/devices/diyruz.js.map +1 -0
  277. package/dist/devices/dlink.d.ts +3 -0
  278. package/dist/devices/dlink.d.ts.map +1 -0
  279. package/dist/devices/dlink.js +72 -0
  280. package/dist/devices/dlink.js.map +1 -0
  281. package/dist/devices/dnake.d.ts +3 -0
  282. package/dist/devices/dnake.d.ts.map +1 -0
  283. package/dist/devices/dnake.js +47 -0
  284. package/dist/devices/dnake.js.map +1 -0
  285. package/dist/devices/domraem.d.ts +3 -0
  286. package/dist/devices/domraem.d.ts.map +1 -0
  287. package/dist/devices/domraem.js +75 -0
  288. package/dist/devices/domraem.js.map +1 -0
  289. package/dist/devices/dowsing_reynolds.d.ts +3 -0
  290. package/dist/devices/dowsing_reynolds.d.ts.map +1 -0
  291. package/dist/devices/dowsing_reynolds.js +47 -0
  292. package/dist/devices/dowsing_reynolds.js.map +1 -0
  293. package/dist/devices/dqsmart.d.ts +3 -0
  294. package/dist/devices/dqsmart.d.ts.map +1 -0
  295. package/dist/devices/dqsmart.js +50 -0
  296. package/dist/devices/dqsmart.js.map +1 -0
  297. package/dist/devices/dresden_elektronik.d.ts +3 -0
  298. package/dist/devices/dresden_elektronik.d.ts.map +1 -0
  299. package/dist/devices/dresden_elektronik.js +167 -0
  300. package/dist/devices/dresden_elektronik.js.map +1 -0
  301. package/dist/devices/easyaccess.d.ts +3 -0
  302. package/dist/devices/easyaccess.d.ts.map +1 -0
  303. package/dist/devices/easyaccess.js +67 -0
  304. package/dist/devices/easyaccess.js.map +1 -0
  305. package/dist/devices/easyiot.d.ts +3 -0
  306. package/dist/devices/easyiot.d.ts.map +1 -0
  307. package/dist/devices/easyiot.js +359 -0
  308. package/dist/devices/easyiot.js.map +1 -0
  309. package/dist/devices/eatonhalo_led.d.ts +3 -0
  310. package/dist/devices/eatonhalo_led.d.ts.map +1 -0
  311. package/dist/devices/eatonhalo_led.js +47 -0
  312. package/dist/devices/eatonhalo_led.js.map +1 -0
  313. package/dist/devices/echostar.d.ts +3 -0
  314. package/dist/devices/echostar.d.ts.map +1 -0
  315. package/dist/devices/echostar.js +61 -0
  316. package/dist/devices/echostar.js.map +1 -0
  317. package/dist/devices/ecodim.d.ts +3 -0
  318. package/dist/devices/ecodim.d.ts.map +1 -0
  319. package/dist/devices/ecodim.js +274 -0
  320. package/dist/devices/ecodim.js.map +1 -0
  321. package/dist/devices/ecolink.d.ts +3 -0
  322. package/dist/devices/ecolink.d.ts.map +1 -0
  323. package/dist/devices/ecolink.js +57 -0
  324. package/dist/devices/ecolink.js.map +1 -0
  325. package/dist/devices/ecosmart.d.ts +3 -0
  326. package/dist/devices/ecosmart.d.ts.map +1 -0
  327. package/dist/devices/ecosmart.js +115 -0
  328. package/dist/devices/ecosmart.js.map +1 -0
  329. package/dist/devices/ecozy.d.ts +3 -0
  330. package/dist/devices/ecozy.d.ts.map +1 -0
  331. package/dist/devices/ecozy.js +85 -0
  332. package/dist/devices/ecozy.js.map +1 -0
  333. package/dist/devices/edp.d.ts +3 -0
  334. package/dist/devices/edp.d.ts.map +1 -0
  335. package/dist/devices/edp.js +70 -0
  336. package/dist/devices/edp.js.map +1 -0
  337. package/dist/devices/efekta.d.ts +3 -0
  338. package/dist/devices/efekta.d.ts.map +1 -0
  339. package/dist/devices/efekta.js +8230 -0
  340. package/dist/devices/efekta.js.map +1 -0
  341. package/dist/devices/eglo.d.ts +3 -0
  342. package/dist/devices/eglo.d.ts.map +1 -0
  343. package/dist/devices/eglo.js +142 -0
  344. package/dist/devices/eglo.js.map +1 -0
  345. package/dist/devices/elko.d.ts +27 -0
  346. package/dist/devices/elko.d.ts.map +1 -0
  347. package/dist/devices/elko.js +306 -0
  348. package/dist/devices/elko.js.map +1 -0
  349. package/dist/devices/enbrighten.d.ts +3 -0
  350. package/dist/devices/enbrighten.d.ts.map +1 -0
  351. package/dist/devices/enbrighten.js +152 -0
  352. package/dist/devices/enbrighten.js.map +1 -0
  353. package/dist/devices/engo.d.ts +3 -0
  354. package/dist/devices/engo.d.ts.map +1 -0
  355. package/dist/devices/engo.js +1041 -0
  356. package/dist/devices/engo.js.map +1 -0
  357. package/dist/devices/enkin.d.ts +3 -0
  358. package/dist/devices/enkin.d.ts.map +1 -0
  359. package/dist/devices/enkin.js +14 -0
  360. package/dist/devices/enkin.js.map +1 -0
  361. package/dist/devices/enocean.d.ts +3 -0
  362. package/dist/devices/enocean.d.ts.map +1 -0
  363. package/dist/devices/enocean.js +150 -0
  364. package/dist/devices/enocean.js.map +1 -0
  365. package/dist/devices/envilar.d.ts +3 -0
  366. package/dist/devices/envilar.d.ts.map +1 -0
  367. package/dist/devices/envilar.js +131 -0
  368. package/dist/devices/envilar.js.map +1 -0
  369. package/dist/devices/espressif.d.ts +3 -0
  370. package/dist/devices/espressif.d.ts.map +1 -0
  371. package/dist/devices/espressif.js +61 -0
  372. package/dist/devices/espressif.js.map +1 -0
  373. package/dist/devices/essentialb.d.ts +3 -0
  374. package/dist/devices/essentialb.d.ts.map +1 -0
  375. package/dist/devices/essentialb.js +133 -0
  376. package/dist/devices/essentialb.js.map +1 -0
  377. package/dist/devices/essentials.d.ts +3 -0
  378. package/dist/devices/essentials.d.ts.map +1 -0
  379. package/dist/devices/essentials.js +150 -0
  380. package/dist/devices/essentials.js.map +1 -0
  381. package/dist/devices/eucontrols.d.ts +3 -0
  382. package/dist/devices/eucontrols.d.ts.map +1 -0
  383. package/dist/devices/eucontrols.js +47 -0
  384. package/dist/devices/eucontrols.js.map +1 -0
  385. package/dist/devices/eurotronic.d.ts +3 -0
  386. package/dist/devices/eurotronic.d.ts.map +1 -0
  387. package/dist/devices/eurotronic.js +278 -0
  388. package/dist/devices/eurotronic.js.map +1 -0
  389. package/dist/devices/evanell.d.ts +3 -0
  390. package/dist/devices/evanell.d.ts.map +1 -0
  391. package/dist/devices/evanell.js +66 -0
  392. package/dist/devices/evanell.js.map +1 -0
  393. package/dist/devices/evn.d.ts +3 -0
  394. package/dist/devices/evn.d.ts.map +1 -0
  395. package/dist/devices/evn.js +97 -0
  396. package/dist/devices/evn.js.map +1 -0
  397. package/dist/devices/evology.d.ts +3 -0
  398. package/dist/devices/evology.d.ts.map +1 -0
  399. package/dist/devices/evology.js +60 -0
  400. package/dist/devices/evology.js.map +1 -0
  401. package/dist/devices/evvr.d.ts +3 -0
  402. package/dist/devices/evvr.d.ts.map +1 -0
  403. package/dist/devices/evvr.js +47 -0
  404. package/dist/devices/evvr.js.map +1 -0
  405. package/dist/devices/ewelink.d.ts +3 -0
  406. package/dist/devices/ewelink.d.ts.map +1 -0
  407. package/dist/devices/ewelink.js +326 -0
  408. package/dist/devices/ewelink.js.map +1 -0
  409. package/dist/devices/ezex.d.ts +3 -0
  410. package/dist/devices/ezex.d.ts.map +1 -0
  411. package/dist/devices/ezex.js +47 -0
  412. package/dist/devices/ezex.js.map +1 -0
  413. package/dist/devices/ezviz.d.ts +3 -0
  414. package/dist/devices/ezviz.d.ts.map +1 -0
  415. package/dist/devices/ezviz.js +47 -0
  416. package/dist/devices/ezviz.js.map +1 -0
  417. package/dist/devices/fantem.d.ts +3 -0
  418. package/dist/devices/fantem.d.ts.map +1 -0
  419. package/dist/devices/fantem.js +112 -0
  420. package/dist/devices/fantem.js.map +1 -0
  421. package/dist/devices/feibit.d.ts +3 -0
  422. package/dist/devices/feibit.d.ts.map +1 -0
  423. package/dist/devices/feibit.js +335 -0
  424. package/dist/devices/feibit.js.map +1 -0
  425. package/dist/devices/fireangel.d.ts +3 -0
  426. package/dist/devices/fireangel.d.ts.map +1 -0
  427. package/dist/devices/fireangel.js +96 -0
  428. package/dist/devices/fireangel.js.map +1 -0
  429. package/dist/devices/frankever.d.ts +3 -0
  430. package/dist/devices/frankever.d.ts.map +1 -0
  431. package/dist/devices/frankever.js +67 -0
  432. package/dist/devices/frankever.js.map +1 -0
  433. package/dist/devices/frient.d.ts +3 -0
  434. package/dist/devices/frient.d.ts.map +1 -0
  435. package/dist/devices/frient.js +84 -0
  436. package/dist/devices/frient.js.map +1 -0
  437. package/dist/devices/futurehome.d.ts +3 -0
  438. package/dist/devices/futurehome.d.ts.map +1 -0
  439. package/dist/devices/futurehome.js +137 -0
  440. package/dist/devices/futurehome.js.map +1 -0
  441. package/dist/devices/ge.d.ts +3 -0
  442. package/dist/devices/ge.d.ts.map +1 -0
  443. package/dist/devices/ge.js +130 -0
  444. package/dist/devices/ge.js.map +1 -0
  445. package/dist/devices/gewiss.d.ts +3 -0
  446. package/dist/devices/gewiss.d.ts.map +1 -0
  447. package/dist/devices/gewiss.js +148 -0
  448. package/dist/devices/gewiss.js.map +1 -0
  449. package/dist/devices/gidealed.d.ts +3 -0
  450. package/dist/devices/gidealed.d.ts.map +1 -0
  451. package/dist/devices/gidealed.js +47 -0
  452. package/dist/devices/gidealed.js.map +1 -0
  453. package/dist/devices/giderwel.d.ts +3 -0
  454. package/dist/devices/giderwel.d.ts.map +1 -0
  455. package/dist/devices/giderwel.js +47 -0
  456. package/dist/devices/giderwel.js.map +1 -0
  457. package/dist/devices/giex.d.ts +3 -0
  458. package/dist/devices/giex.d.ts.map +1 -0
  459. package/dist/devices/giex.js +114 -0
  460. package/dist/devices/giex.js.map +1 -0
  461. package/dist/devices/girier.d.ts +3 -0
  462. package/dist/devices/girier.d.ts.map +1 -0
  463. package/dist/devices/girier.js +51 -0
  464. package/dist/devices/girier.js.map +1 -0
  465. package/dist/devices/gledopto.d.ts +3 -0
  466. package/dist/devices/gledopto.d.ts.map +1 -0
  467. package/dist/devices/gledopto.js +1395 -0
  468. package/dist/devices/gledopto.js.map +1 -0
  469. package/dist/devices/gmmts.d.ts +3 -0
  470. package/dist/devices/gmmts.d.ts.map +1 -0
  471. package/dist/devices/gmmts.js +2267 -0
  472. package/dist/devices/gmmts.js.map +1 -0
  473. package/dist/devices/gmy.d.ts +3 -0
  474. package/dist/devices/gmy.d.ts.map +1 -0
  475. package/dist/devices/gmy.js +47 -0
  476. package/dist/devices/gmy.js.map +1 -0
  477. package/dist/devices/gs.d.ts +3 -0
  478. package/dist/devices/gs.d.ts.map +1 -0
  479. package/dist/devices/gs.js +121 -0
  480. package/dist/devices/gs.js.map +1 -0
  481. package/dist/devices/gumax.d.ts +3 -0
  482. package/dist/devices/gumax.d.ts.map +1 -0
  483. package/dist/devices/gumax.js +47 -0
  484. package/dist/devices/gumax.js.map +1 -0
  485. package/dist/devices/halemeier.d.ts +3 -0
  486. package/dist/devices/halemeier.d.ts.map +1 -0
  487. package/dist/devices/halemeier.js +142 -0
  488. package/dist/devices/halemeier.js.map +1 -0
  489. package/dist/devices/hampton_bay.d.ts +3 -0
  490. package/dist/devices/hampton_bay.d.ts.map +1 -0
  491. package/dist/devices/hampton_bay.js +68 -0
  492. package/dist/devices/hampton_bay.js.map +1 -0
  493. package/dist/devices/heatit.d.ts +3 -0
  494. package/dist/devices/heatit.d.ts.map +1 -0
  495. package/dist/devices/heatit.js +47 -0
  496. package/dist/devices/heatit.js.map +1 -0
  497. package/dist/devices/heiman.d.ts +3 -0
  498. package/dist/devices/heiman.d.ts.map +1 -0
  499. package/dist/devices/heiman.js +2092 -0
  500. package/dist/devices/heiman.js.map +1 -0
  501. package/dist/devices/heimgard_technologies.d.ts +3 -0
  502. package/dist/devices/heimgard_technologies.d.ts.map +1 -0
  503. package/dist/devices/heimgard_technologies.js +189 -0
  504. package/dist/devices/heimgard_technologies.js.map +1 -0
  505. package/dist/devices/hej.d.ts +3 -0
  506. package/dist/devices/hej.d.ts.map +1 -0
  507. package/dist/devices/hej.js +126 -0
  508. package/dist/devices/hej.js.map +1 -0
  509. package/dist/devices/hfh.d.ts +3 -0
  510. package/dist/devices/hfh.d.ts.map +1 -0
  511. package/dist/devices/hfh.js +47 -0
  512. package/dist/devices/hfh.js.map +1 -0
  513. package/dist/devices/hilux.d.ts +3 -0
  514. package/dist/devices/hilux.d.ts.map +1 -0
  515. package/dist/devices/hilux.js +54 -0
  516. package/dist/devices/hilux.js.map +1 -0
  517. package/dist/devices/hive.d.ts +3 -0
  518. package/dist/devices/hive.d.ts.map +1 -0
  519. package/dist/devices/hive.js +798 -0
  520. package/dist/devices/hive.js.map +1 -0
  521. package/dist/devices/hoftronic.d.ts +3 -0
  522. package/dist/devices/hoftronic.d.ts.map +1 -0
  523. package/dist/devices/hoftronic.js +56 -0
  524. package/dist/devices/hoftronic.js.map +1 -0
  525. package/dist/devices/homeseer.d.ts +3 -0
  526. package/dist/devices/homeseer.d.ts.map +1 -0
  527. package/dist/devices/homeseer.js +53 -0
  528. package/dist/devices/homeseer.js.map +1 -0
  529. package/dist/devices/hommyn.d.ts +3 -0
  530. package/dist/devices/hommyn.d.ts.map +1 -0
  531. package/dist/devices/hommyn.js +60 -0
  532. package/dist/devices/hommyn.js.map +1 -0
  533. package/dist/devices/honyar.d.ts +3 -0
  534. package/dist/devices/honyar.d.ts.map +1 -0
  535. package/dist/devices/honyar.js +167 -0
  536. package/dist/devices/honyar.js.map +1 -0
  537. package/dist/devices/hornbach.d.ts +3 -0
  538. package/dist/devices/hornbach.d.ts.map +1 -0
  539. package/dist/devices/hornbach.js +138 -0
  540. package/dist/devices/hornbach.js.map +1 -0
  541. package/dist/devices/hzc_electric.d.ts +3 -0
  542. package/dist/devices/hzc_electric.d.ts.map +1 -0
  543. package/dist/devices/hzc_electric.js +102 -0
  544. package/dist/devices/hzc_electric.js.map +1 -0
  545. package/dist/devices/icasa.d.ts +3 -0
  546. package/dist/devices/icasa.d.ts.map +1 -0
  547. package/dist/devices/icasa.js +174 -0
  548. package/dist/devices/icasa.js.map +1 -0
  549. package/dist/devices/idinio.d.ts +3 -0
  550. package/dist/devices/idinio.d.ts.map +1 -0
  551. package/dist/devices/idinio.js +47 -0
  552. package/dist/devices/idinio.js.map +1 -0
  553. package/dist/devices/ihorn.d.ts +3 -0
  554. package/dist/devices/ihorn.d.ts.map +1 -0
  555. package/dist/devices/ihorn.js +105 -0
  556. package/dist/devices/ihorn.js.map +1 -0
  557. package/dist/devices/ikea.d.ts +3 -0
  558. package/dist/devices/ikea.d.ts.map +1 -0
  559. package/dist/devices/ikea.js +1241 -0
  560. package/dist/devices/ikea.js.map +1 -0
  561. package/dist/devices/ilightsin.d.ts +3 -0
  562. package/dist/devices/ilightsin.d.ts.map +1 -0
  563. package/dist/devices/ilightsin.js +59 -0
  564. package/dist/devices/ilightsin.js.map +1 -0
  565. package/dist/devices/iluminize.d.ts +3 -0
  566. package/dist/devices/iluminize.d.ts.map +1 -0
  567. package/dist/devices/iluminize.js +385 -0
  568. package/dist/devices/iluminize.js.map +1 -0
  569. package/dist/devices/ilux.d.ts +3 -0
  570. package/dist/devices/ilux.d.ts.map +1 -0
  571. package/dist/devices/ilux.js +47 -0
  572. package/dist/devices/ilux.js.map +1 -0
  573. package/dist/devices/imhotepcreation.d.ts +3 -0
  574. package/dist/devices/imhotepcreation.d.ts.map +1 -0
  575. package/dist/devices/imhotepcreation.js +240 -0
  576. package/dist/devices/imhotepcreation.js.map +1 -0
  577. package/dist/devices/immax.d.ts +3 -0
  578. package/dist/devices/immax.d.ts.map +1 -0
  579. package/dist/devices/immax.js +471 -0
  580. package/dist/devices/immax.js.map +1 -0
  581. package/dist/devices/imou.d.ts +3 -0
  582. package/dist/devices/imou.d.ts.map +1 -0
  583. package/dist/devices/imou.js +109 -0
  584. package/dist/devices/imou.js.map +1 -0
  585. package/dist/devices/index.d.ts +4 -0
  586. package/dist/devices/index.d.ts.map +1 -0
  587. package/dist/devices/index.js +738 -0
  588. package/dist/devices/index.js.map +1 -0
  589. package/dist/devices/innr.d.ts +3 -0
  590. package/dist/devices/innr.d.ts.map +1 -0
  591. package/dist/devices/innr.js +1033 -0
  592. package/dist/devices/innr.js.map +1 -0
  593. package/dist/devices/inovelli.d.ts +3 -0
  594. package/dist/devices/inovelli.d.ts.map +1 -0
  595. package/dist/devices/inovelli.js +2474 -0
  596. package/dist/devices/inovelli.js.map +1 -0
  597. package/dist/devices/insta.d.ts +3 -0
  598. package/dist/devices/insta.d.ts.map +1 -0
  599. package/dist/devices/insta.js +182 -0
  600. package/dist/devices/insta.js.map +1 -0
  601. package/dist/devices/intuis.d.ts +3 -0
  602. package/dist/devices/intuis.d.ts.map +1 -0
  603. package/dist/devices/intuis.js +95 -0
  604. package/dist/devices/intuis.js.map +1 -0
  605. package/dist/devices/iolloi.d.ts +3 -0
  606. package/dist/devices/iolloi.d.ts.map +1 -0
  607. package/dist/devices/iolloi.js +48 -0
  608. package/dist/devices/iolloi.js.map +1 -0
  609. package/dist/devices/iotperfect.d.ts +3 -0
  610. package/dist/devices/iotperfect.d.ts.map +1 -0
  611. package/dist/devices/iotperfect.js +60 -0
  612. package/dist/devices/iotperfect.js.map +1 -0
  613. package/dist/devices/iris.d.ts +3 -0
  614. package/dist/devices/iris.d.ts.map +1 -0
  615. package/dist/devices/iris.js +208 -0
  616. package/dist/devices/iris.js.map +1 -0
  617. package/dist/devices/istar.d.ts +3 -0
  618. package/dist/devices/istar.d.ts.map +1 -0
  619. package/dist/devices/istar.js +61 -0
  620. package/dist/devices/istar.js.map +1 -0
  621. package/dist/devices/jasco.d.ts +3 -0
  622. package/dist/devices/jasco.d.ts.map +1 -0
  623. package/dist/devices/jasco.js +63 -0
  624. package/dist/devices/jasco.js.map +1 -0
  625. package/dist/devices/javis.d.ts +3 -0
  626. package/dist/devices/javis.d.ts.map +1 -0
  627. package/dist/devices/javis.js +77 -0
  628. package/dist/devices/javis.js.map +1 -0
  629. package/dist/devices/jethome.d.ts +3 -0
  630. package/dist/devices/jethome.d.ts.map +1 -0
  631. package/dist/devices/jethome.js +120 -0
  632. package/dist/devices/jethome.js.map +1 -0
  633. package/dist/devices/jiawen.d.ts +3 -0
  634. package/dist/devices/jiawen.d.ts.map +1 -0
  635. package/dist/devices/jiawen.js +54 -0
  636. package/dist/devices/jiawen.js.map +1 -0
  637. package/dist/devices/jumitech.d.ts +3 -0
  638. package/dist/devices/jumitech.d.ts.map +1 -0
  639. package/dist/devices/jumitech.js +47 -0
  640. package/dist/devices/jumitech.js.map +1 -0
  641. package/dist/devices/jxuan.d.ts +3 -0
  642. package/dist/devices/jxuan.d.ts.map +1 -0
  643. package/dist/devices/jxuan.js +85 -0
  644. package/dist/devices/jxuan.js.map +1 -0
  645. package/dist/devices/kami.d.ts +3 -0
  646. package/dist/devices/kami.d.ts.map +1 -0
  647. package/dist/devices/kami.js +51 -0
  648. package/dist/devices/kami.js.map +1 -0
  649. package/dist/devices/keen_home.d.ts +3 -0
  650. package/dist/devices/keen_home.d.ts.map +1 -0
  651. package/dist/devices/keen_home.js +155 -0
  652. package/dist/devices/keen_home.js.map +1 -0
  653. package/dist/devices/klikaanklikuit.d.ts +3 -0
  654. package/dist/devices/klikaanklikuit.d.ts.map +1 -0
  655. package/dist/devices/klikaanklikuit.js +54 -0
  656. package/dist/devices/klikaanklikuit.js.map +1 -0
  657. package/dist/devices/kmpcil.d.ts +3 -0
  658. package/dist/devices/kmpcil.d.ts.map +1 -0
  659. package/dist/devices/kmpcil.js +212 -0
  660. package/dist/devices/kmpcil.js.map +1 -0
  661. package/dist/devices/konke.d.ts +3 -0
  662. package/dist/devices/konke.d.ts.map +1 -0
  663. package/dist/devices/konke.js +207 -0
  664. package/dist/devices/konke.js.map +1 -0
  665. package/dist/devices/ksentry.d.ts +3 -0
  666. package/dist/devices/ksentry.d.ts.map +1 -0
  667. package/dist/devices/ksentry.js +47 -0
  668. package/dist/devices/ksentry.js.map +1 -0
  669. package/dist/devices/kurvia.d.ts +3 -0
  670. package/dist/devices/kurvia.d.ts.map +1 -0
  671. package/dist/devices/kurvia.js +49 -0
  672. package/dist/devices/kurvia.js.map +1 -0
  673. package/dist/devices/kwikset.d.ts +3 -0
  674. package/dist/devices/kwikset.d.ts.map +1 -0
  675. package/dist/devices/kwikset.js +153 -0
  676. package/dist/devices/kwikset.js.map +1 -0
  677. package/dist/devices/lanesto.d.ts +3 -0
  678. package/dist/devices/lanesto.d.ts.map +1 -0
  679. package/dist/devices/lanesto.js +47 -0
  680. package/dist/devices/lanesto.js.map +1 -0
  681. package/dist/devices/lds.d.ts +3 -0
  682. package/dist/devices/lds.d.ts.map +1 -0
  683. package/dist/devices/lds.js +54 -0
  684. package/dist/devices/lds.js.map +1 -0
  685. package/dist/devices/led_trading.d.ts +3 -0
  686. package/dist/devices/led_trading.d.ts.map +1 -0
  687. package/dist/devices/led_trading.js +108 -0
  688. package/dist/devices/led_trading.js.map +1 -0
  689. package/dist/devices/ledvance.d.ts +3 -0
  690. package/dist/devices/ledvance.d.ts.map +1 -0
  691. package/dist/devices/ledvance.js +407 -0
  692. package/dist/devices/ledvance.js.map +1 -0
  693. package/dist/devices/leedarson.d.ts +3 -0
  694. package/dist/devices/leedarson.d.ts.map +1 -0
  695. package/dist/devices/leedarson.js +180 -0
  696. package/dist/devices/leedarson.js.map +1 -0
  697. package/dist/devices/legrand.d.ts +3 -0
  698. package/dist/devices/legrand.d.ts.map +1 -0
  699. package/dist/devices/legrand.js +809 -0
  700. package/dist/devices/legrand.js.map +1 -0
  701. package/dist/devices/lellki.d.ts +3 -0
  702. package/dist/devices/lellki.d.ts.map +1 -0
  703. package/dist/devices/lellki.js +162 -0
  704. package/dist/devices/lellki.js.map +1 -0
  705. package/dist/devices/letsled.d.ts +3 -0
  706. package/dist/devices/letsled.d.ts.map +1 -0
  707. package/dist/devices/letsled.js +47 -0
  708. package/dist/devices/letsled.js.map +1 -0
  709. package/dist/devices/letv.d.ts +3 -0
  710. package/dist/devices/letv.d.ts.map +1 -0
  711. package/dist/devices/letv.js +86 -0
  712. package/dist/devices/letv.js.map +1 -0
  713. package/dist/devices/leviton.d.ts +3 -0
  714. package/dist/devices/leviton.d.ts.map +1 -0
  715. package/dist/devices/leviton.js +160 -0
  716. package/dist/devices/leviton.js.map +1 -0
  717. package/dist/devices/lg.d.ts +3 -0
  718. package/dist/devices/lg.d.ts.map +1 -0
  719. package/dist/devices/lg.js +61 -0
  720. package/dist/devices/lg.js.map +1 -0
  721. package/dist/devices/lidl.d.ts +3 -0
  722. package/dist/devices/lidl.d.ts.map +1 -0
  723. package/dist/devices/lidl.js +669 -0
  724. package/dist/devices/lidl.js.map +1 -0
  725. package/dist/devices/lifecontrol.d.ts +3 -0
  726. package/dist/devices/lifecontrol.d.ts.map +1 -0
  727. package/dist/devices/lifecontrol.js +141 -0
  728. package/dist/devices/lifecontrol.js.map +1 -0
  729. package/dist/devices/lightsolutions.d.ts +3 -0
  730. package/dist/devices/lightsolutions.d.ts.map +1 -0
  731. package/dist/devices/lightsolutions.js +90 -0
  732. package/dist/devices/lightsolutions.js.map +1 -0
  733. package/dist/devices/lincukoo.d.ts +3 -0
  734. package/dist/devices/lincukoo.d.ts.map +1 -0
  735. package/dist/devices/lincukoo.js +788 -0
  736. package/dist/devices/lincukoo.js.map +1 -0
  737. package/dist/devices/linkind.d.ts +3 -0
  738. package/dist/devices/linkind.d.ts.map +1 -0
  739. package/dist/devices/linkind.js +251 -0
  740. package/dist/devices/linkind.js.map +1 -0
  741. package/dist/devices/linptech.d.ts +3 -0
  742. package/dist/devices/linptech.d.ts.map +1 -0
  743. package/dist/devices/linptech.js +157 -0
  744. package/dist/devices/linptech.js.map +1 -0
  745. package/dist/devices/livingwise.d.ts +3 -0
  746. package/dist/devices/livingwise.d.ts.map +1 -0
  747. package/dist/devices/livingwise.js +115 -0
  748. package/dist/devices/livingwise.js.map +1 -0
  749. package/dist/devices/livolo.d.ts +3 -0
  750. package/dist/devices/livolo.d.ts.map +1 -0
  751. package/dist/devices/livolo.js +263 -0
  752. package/dist/devices/livolo.js.map +1 -0
  753. package/dist/devices/lixee.d.ts +3 -0
  754. package/dist/devices/lixee.d.ts.map +1 -0
  755. package/dist/devices/lixee.js +2038 -0
  756. package/dist/devices/lixee.js.map +1 -0
  757. package/dist/devices/lonsonho.d.ts +3 -0
  758. package/dist/devices/lonsonho.d.ts.map +1 -0
  759. package/dist/devices/lonsonho.js +310 -0
  760. package/dist/devices/lonsonho.js.map +1 -0
  761. package/dist/devices/ls.d.ts +3 -0
  762. package/dist/devices/ls.d.ts.map +1 -0
  763. package/dist/devices/ls.js +152 -0
  764. package/dist/devices/ls.js.map +1 -0
  765. package/dist/devices/lubeez.d.ts +3 -0
  766. package/dist/devices/lubeez.d.ts.map +1 -0
  767. package/dist/devices/lubeez.js +47 -0
  768. package/dist/devices/lubeez.js.map +1 -0
  769. package/dist/devices/lumi.d.ts +3 -0
  770. package/dist/devices/lumi.d.ts.map +1 -0
  771. package/dist/devices/lumi.js +5345 -0
  772. package/dist/devices/lumi.js.map +1 -0
  773. package/dist/devices/lupus.d.ts +3 -0
  774. package/dist/devices/lupus.d.ts.map +1 -0
  775. package/dist/devices/lupus.js +94 -0
  776. package/dist/devices/lupus.js.map +1 -0
  777. package/dist/devices/lutron.d.ts +3 -0
  778. package/dist/devices/lutron.d.ts.map +1 -0
  779. package/dist/devices/lutron.js +81 -0
  780. package/dist/devices/lutron.js.map +1 -0
  781. package/dist/devices/lux.d.ts +3 -0
  782. package/dist/devices/lux.d.ts.map +1 -0
  783. package/dist/devices/lux.js +87 -0
  784. package/dist/devices/lux.js.map +1 -0
  785. package/dist/devices/lytko.d.ts +3 -0
  786. package/dist/devices/lytko.d.ts.map +1 -0
  787. package/dist/devices/lytko.js +1809 -0
  788. package/dist/devices/lytko.js.map +1 -0
  789. package/dist/devices/m_elec.d.ts +3 -0
  790. package/dist/devices/m_elec.d.ts.map +1 -0
  791. package/dist/devices/m_elec.js +68 -0
  792. package/dist/devices/m_elec.js.map +1 -0
  793. package/dist/devices/makegood.d.ts +3 -0
  794. package/dist/devices/makegood.d.ts.map +1 -0
  795. package/dist/devices/makegood.js +117 -0
  796. package/dist/devices/makegood.js.map +1 -0
  797. package/dist/devices/matcall_bv.d.ts +3 -0
  798. package/dist/devices/matcall_bv.d.ts.map +1 -0
  799. package/dist/devices/matcall_bv.js +54 -0
  800. package/dist/devices/matcall_bv.js.map +1 -0
  801. package/dist/devices/mazda.d.ts +3 -0
  802. package/dist/devices/mazda.d.ts.map +1 -0
  803. package/dist/devices/mazda.js +146 -0
  804. package/dist/devices/mazda.js.map +1 -0
  805. package/dist/devices/meazon.d.ts +3 -0
  806. package/dist/devices/meazon.d.ts.map +1 -0
  807. package/dist/devices/meazon.js +95 -0
  808. package/dist/devices/meazon.js.map +1 -0
  809. package/dist/devices/mercator.d.ts +3 -0
  810. package/dist/devices/mercator.d.ts.map +1 -0
  811. package/dist/devices/mercator.js +242 -0
  812. package/dist/devices/mercator.js.map +1 -0
  813. package/dist/devices/miboxer.d.ts +3 -0
  814. package/dist/devices/miboxer.d.ts.map +1 -0
  815. package/dist/devices/miboxer.js +304 -0
  816. package/dist/devices/miboxer.js.map +1 -0
  817. package/dist/devices/micromatic.d.ts +3 -0
  818. package/dist/devices/micromatic.d.ts.map +1 -0
  819. package/dist/devices/micromatic.js +47 -0
  820. package/dist/devices/micromatic.js.map +1 -0
  821. package/dist/devices/mill.d.ts +3 -0
  822. package/dist/devices/mill.d.ts.map +1 -0
  823. package/dist/devices/mill.js +52 -0
  824. package/dist/devices/mill.js.map +1 -0
  825. package/dist/devices/mindy.d.ts +3 -0
  826. package/dist/devices/mindy.d.ts.map +1 -0
  827. package/dist/devices/mindy.js +379 -0
  828. package/dist/devices/mindy.js.map +1 -0
  829. package/dist/devices/modular.d.ts +3 -0
  830. package/dist/devices/modular.d.ts.map +1 -0
  831. package/dist/devices/modular.js +47 -0
  832. package/dist/devices/modular.js.map +1 -0
  833. package/dist/devices/moes.d.ts +3 -0
  834. package/dist/devices/moes.d.ts.map +1 -0
  835. package/dist/devices/moes.js +2368 -0
  836. package/dist/devices/moes.js.map +1 -0
  837. package/dist/devices/muller_licht.d.ts +3 -0
  838. package/dist/devices/muller_licht.d.ts.map +1 -0
  839. package/dist/devices/muller_licht.js +366 -0
  840. package/dist/devices/muller_licht.js.map +1 -0
  841. package/dist/devices/multir.d.ts +3 -0
  842. package/dist/devices/multir.d.ts.map +1 -0
  843. package/dist/devices/multir.js +152 -0
  844. package/dist/devices/multir.js.map +1 -0
  845. package/dist/devices/multiterm.d.ts +3 -0
  846. package/dist/devices/multiterm.d.ts.map +1 -0
  847. package/dist/devices/multiterm.js +119 -0
  848. package/dist/devices/multiterm.js.map +1 -0
  849. package/dist/devices/namron.d.ts +3 -0
  850. package/dist/devices/namron.d.ts.map +1 -0
  851. package/dist/devices/namron.js +2004 -0
  852. package/dist/devices/namron.js.map +1 -0
  853. package/dist/devices/nanoleaf.d.ts +3 -0
  854. package/dist/devices/nanoleaf.d.ts.map +1 -0
  855. package/dist/devices/nanoleaf.js +47 -0
  856. package/dist/devices/nanoleaf.js.map +1 -0
  857. package/dist/devices/nedis.d.ts +3 -0
  858. package/dist/devices/nedis.d.ts.map +1 -0
  859. package/dist/devices/nedis.js +87 -0
  860. package/dist/devices/nedis.js.map +1 -0
  861. package/dist/devices/neo.d.ts +3 -0
  862. package/dist/devices/neo.d.ts.map +1 -0
  863. package/dist/devices/neo.js +526 -0
  864. package/dist/devices/neo.js.map +1 -0
  865. package/dist/devices/net2grid.d.ts +3 -0
  866. package/dist/devices/net2grid.d.ts.map +1 -0
  867. package/dist/devices/net2grid.js +64 -0
  868. package/dist/devices/net2grid.js.map +1 -0
  869. package/dist/devices/netvox.d.ts +3 -0
  870. package/dist/devices/netvox.d.ts.map +1 -0
  871. package/dist/devices/netvox.js +71 -0
  872. package/dist/devices/netvox.js.map +1 -0
  873. package/dist/devices/nexelec.d.ts +3 -0
  874. package/dist/devices/nexelec.d.ts.map +1 -0
  875. package/dist/devices/nexelec.js +47 -0
  876. package/dist/devices/nexelec.js.map +1 -0
  877. package/dist/devices/niko.d.ts +3 -0
  878. package/dist/devices/niko.d.ts.map +1 -0
  879. package/dist/devices/niko.js +769 -0
  880. package/dist/devices/niko.js.map +1 -0
  881. package/dist/devices/ninja_blocks.d.ts +3 -0
  882. package/dist/devices/ninja_blocks.d.ts.map +1 -0
  883. package/dist/devices/ninja_blocks.js +60 -0
  884. package/dist/devices/ninja_blocks.js.map +1 -0
  885. package/dist/devices/niviss.d.ts +3 -0
  886. package/dist/devices/niviss.d.ts.map +1 -0
  887. package/dist/devices/niviss.js +47 -0
  888. package/dist/devices/niviss.js.map +1 -0
  889. package/dist/devices/nobo.d.ts +3 -0
  890. package/dist/devices/nobo.d.ts.map +1 -0
  891. package/dist/devices/nobo.js +88 -0
  892. package/dist/devices/nobo.js.map +1 -0
  893. package/dist/devices/nodon.d.ts +3 -0
  894. package/dist/devices/nodon.d.ts.map +1 -0
  895. package/dist/devices/nodon.js +483 -0
  896. package/dist/devices/nodon.js.map +1 -0
  897. package/dist/devices/nordtronic.d.ts +3 -0
  898. package/dist/devices/nordtronic.d.ts.map +1 -0
  899. package/dist/devices/nordtronic.js +95 -0
  900. package/dist/devices/nordtronic.js.map +1 -0
  901. package/dist/devices/nous.d.ts +3 -0
  902. package/dist/devices/nous.d.ts.map +1 -0
  903. package/dist/devices/nous.js +367 -0
  904. package/dist/devices/nous.js.map +1 -0
  905. package/dist/devices/novo.d.ts +3 -0
  906. package/dist/devices/novo.d.ts.map +1 -0
  907. package/dist/devices/novo.js +53 -0
  908. package/dist/devices/novo.js.map +1 -0
  909. package/dist/devices/nue_3a.d.ts +3 -0
  910. package/dist/devices/nue_3a.d.ts.map +1 -0
  911. package/dist/devices/nue_3a.js +359 -0
  912. package/dist/devices/nue_3a.js.map +1 -0
  913. package/dist/devices/nyce.d.ts +3 -0
  914. package/dist/devices/nyce.d.ts.map +1 -0
  915. package/dist/devices/nyce.js +124 -0
  916. package/dist/devices/nyce.js.map +1 -0
  917. package/dist/devices/onenuo.d.ts +3 -0
  918. package/dist/devices/onenuo.d.ts.map +1 -0
  919. package/dist/devices/onenuo.js +83 -0
  920. package/dist/devices/onenuo.js.map +1 -0
  921. package/dist/devices/onesti.d.ts +3 -0
  922. package/dist/devices/onesti.d.ts.map +1 -0
  923. package/dist/devices/onesti.js +265 -0
  924. package/dist/devices/onesti.js.map +1 -0
  925. package/dist/devices/onokom.d.ts +3 -0
  926. package/dist/devices/onokom.d.ts.map +1 -0
  927. package/dist/devices/onokom.js +2715 -0
  928. package/dist/devices/onokom.js.map +1 -0
  929. package/dist/devices/openlumi.d.ts +3 -0
  930. package/dist/devices/openlumi.d.ts.map +1 -0
  931. package/dist/devices/openlumi.js +47 -0
  932. package/dist/devices/openlumi.js.map +1 -0
  933. package/dist/devices/orvibo.d.ts +12 -0
  934. package/dist/devices/orvibo.d.ts.map +1 -0
  935. package/dist/devices/orvibo.js +715 -0
  936. package/dist/devices/orvibo.js.map +1 -0
  937. package/dist/devices/orztech.d.ts +3 -0
  938. package/dist/devices/orztech.d.ts.map +1 -0
  939. package/dist/devices/orztech.js +195 -0
  940. package/dist/devices/orztech.js.map +1 -0
  941. package/dist/devices/osram.d.ts +3 -0
  942. package/dist/devices/osram.d.ts.map +1 -0
  943. package/dist/devices/osram.js +513 -0
  944. package/dist/devices/osram.js.map +1 -0
  945. package/dist/devices/oujiabao.d.ts +3 -0
  946. package/dist/devices/oujiabao.d.ts.map +1 -0
  947. package/dist/devices/oujiabao.js +51 -0
  948. package/dist/devices/oujiabao.js.map +1 -0
  949. package/dist/devices/owon.d.ts +3 -0
  950. package/dist/devices/owon.d.ts.map +1 -0
  951. package/dist/devices/owon.js +888 -0
  952. package/dist/devices/owon.js.map +1 -0
  953. package/dist/devices/ozsmartthings.d.ts +3 -0
  954. package/dist/devices/ozsmartthings.d.ts.map +1 -0
  955. package/dist/devices/ozsmartthings.js +47 -0
  956. package/dist/devices/ozsmartthings.js.map +1 -0
  957. package/dist/devices/paul_neuhaus.d.ts +3 -0
  958. package/dist/devices/paul_neuhaus.d.ts.map +1 -0
  959. package/dist/devices/paul_neuhaus.js +190 -0
  960. package/dist/devices/paul_neuhaus.js.map +1 -0
  961. package/dist/devices/paulmann.d.ts +3 -0
  962. package/dist/devices/paulmann.d.ts.map +1 -0
  963. package/dist/devices/paulmann.js +426 -0
  964. package/dist/devices/paulmann.js.map +1 -0
  965. package/dist/devices/peq.d.ts +3 -0
  966. package/dist/devices/peq.d.ts.map +1 -0
  967. package/dist/devices/peq.js +60 -0
  968. package/dist/devices/peq.js.map +1 -0
  969. package/dist/devices/perenio.d.ts +3 -0
  970. package/dist/devices/perenio.d.ts.map +1 -0
  971. package/dist/devices/perenio.js +461 -0
  972. package/dist/devices/perenio.js.map +1 -0
  973. package/dist/devices/philio.d.ts +3 -0
  974. package/dist/devices/philio.d.ts.map +1 -0
  975. package/dist/devices/philio.js +48 -0
  976. package/dist/devices/philio.js.map +1 -0
  977. package/dist/devices/philips.d.ts +3 -0
  978. package/dist/devices/philips.d.ts.map +1 -0
  979. package/dist/devices/philips.js +4948 -0
  980. package/dist/devices/philips.js.map +1 -0
  981. package/dist/devices/plaid.d.ts +3 -0
  982. package/dist/devices/plaid.d.ts.map +1 -0
  983. package/dist/devices/plaid.js +61 -0
  984. package/dist/devices/plaid.js.map +1 -0
  985. package/dist/devices/plugwise.d.ts +3 -0
  986. package/dist/devices/plugwise.d.ts.map +1 -0
  987. package/dist/devices/plugwise.js +217 -0
  988. package/dist/devices/plugwise.js.map +1 -0
  989. package/dist/devices/profalux.d.ts +3 -0
  990. package/dist/devices/profalux.d.ts.map +1 -0
  991. package/dist/devices/profalux.js +215 -0
  992. package/dist/devices/profalux.js.map +1 -0
  993. package/dist/devices/prolight.d.ts +3 -0
  994. package/dist/devices/prolight.d.ts.map +1 -0
  995. package/dist/devices/prolight.js +111 -0
  996. package/dist/devices/prolight.js.map +1 -0
  997. package/dist/devices/purmo.d.ts +3 -0
  998. package/dist/devices/purmo.d.ts.map +1 -0
  999. package/dist/devices/purmo.js +91 -0
  1000. package/dist/devices/purmo.js.map +1 -0
  1001. package/dist/devices/pushok.d.ts +3 -0
  1002. package/dist/devices/pushok.d.ts.map +1 -0
  1003. package/dist/devices/pushok.js +736 -0
  1004. package/dist/devices/pushok.js.map +1 -0
  1005. package/dist/devices/qa.d.ts +3 -0
  1006. package/dist/devices/qa.d.ts.map +1 -0
  1007. package/dist/devices/qa.js +445 -0
  1008. package/dist/devices/qa.js.map +1 -0
  1009. package/dist/devices/qmotion.d.ts +3 -0
  1010. package/dist/devices/qmotion.d.ts.map +1 -0
  1011. package/dist/devices/qmotion.js +69 -0
  1012. package/dist/devices/qmotion.js.map +1 -0
  1013. package/dist/devices/qoto.d.ts +3 -0
  1014. package/dist/devices/qoto.d.ts.map +1 -0
  1015. package/dist/devices/qoto.js +83 -0
  1016. package/dist/devices/qoto.js.map +1 -0
  1017. package/dist/devices/quirky.d.ts +8 -0
  1018. package/dist/devices/quirky.d.ts.map +1 -0
  1019. package/dist/devices/quirky.js +47 -0
  1020. package/dist/devices/quirky.js.map +1 -0
  1021. package/dist/devices/quotra.d.ts +3 -0
  1022. package/dist/devices/quotra.d.ts.map +1 -0
  1023. package/dist/devices/quotra.js +54 -0
  1024. package/dist/devices/quotra.js.map +1 -0
  1025. package/dist/devices/rademacher.d.ts +3 -0
  1026. package/dist/devices/rademacher.d.ts.map +1 -0
  1027. package/dist/devices/rademacher.js +61 -0
  1028. package/dist/devices/rademacher.js.map +1 -0
  1029. package/dist/devices/radium.d.ts +3 -0
  1030. package/dist/devices/radium.d.ts.map +1 -0
  1031. package/dist/devices/radium.js +47 -0
  1032. package/dist/devices/radium.js.map +1 -0
  1033. package/dist/devices/raex.d.ts +3 -0
  1034. package/dist/devices/raex.d.ts.map +1 -0
  1035. package/dist/devices/raex.js +47 -0
  1036. package/dist/devices/raex.js.map +1 -0
  1037. package/dist/devices/rgb_genie.d.ts +3 -0
  1038. package/dist/devices/rgb_genie.d.ts.map +1 -0
  1039. package/dist/devices/rgb_genie.js +277 -0
  1040. package/dist/devices/rgb_genie.js.map +1 -0
  1041. package/dist/devices/robb.d.ts +3 -0
  1042. package/dist/devices/robb.d.ts.map +1 -0
  1043. package/dist/devices/robb.js +492 -0
  1044. package/dist/devices/robb.js.map +1 -0
  1045. package/dist/devices/roome.d.ts +3 -0
  1046. package/dist/devices/roome.d.ts.map +1 -0
  1047. package/dist/devices/roome.js +51 -0
  1048. package/dist/devices/roome.js.map +1 -0
  1049. package/dist/devices/rtx.d.ts +3 -0
  1050. package/dist/devices/rtx.d.ts.map +1 -0
  1051. package/dist/devices/rtx.js +143 -0
  1052. package/dist/devices/rtx.js.map +1 -0
  1053. package/dist/devices/salus_controls.d.ts +3 -0
  1054. package/dist/devices/salus_controls.d.ts.map +1 -0
  1055. package/dist/devices/salus_controls.js +222 -0
  1056. package/dist/devices/salus_controls.js.map +1 -0
  1057. package/dist/devices/samotech.d.ts +3 -0
  1058. package/dist/devices/samotech.d.ts.map +1 -0
  1059. package/dist/devices/samotech.js +123 -0
  1060. package/dist/devices/samotech.js.map +1 -0
  1061. package/dist/devices/saswell.d.ts +3 -0
  1062. package/dist/devices/saswell.d.ts.map +1 -0
  1063. package/dist/devices/saswell.js +120 -0
  1064. package/dist/devices/saswell.js.map +1 -0
  1065. package/dist/devices/sber.d.ts +3 -0
  1066. package/dist/devices/sber.d.ts.map +1 -0
  1067. package/dist/devices/sber.js +1921 -0
  1068. package/dist/devices/sber.js.map +1 -0
  1069. package/dist/devices/scanproducts.d.ts +3 -0
  1070. package/dist/devices/scanproducts.d.ts.map +1 -0
  1071. package/dist/devices/scanproducts.js +54 -0
  1072. package/dist/devices/scanproducts.js.map +1 -0
  1073. package/dist/devices/schlage.d.ts +3 -0
  1074. package/dist/devices/schlage.d.ts.map +1 -0
  1075. package/dist/devices/schlage.js +60 -0
  1076. package/dist/devices/schlage.js.map +1 -0
  1077. package/dist/devices/schneider_electric.d.ts +10 -0
  1078. package/dist/devices/schneider_electric.d.ts.map +1 -0
  1079. package/dist/devices/schneider_electric.js +2801 -0
  1080. package/dist/devices/schneider_electric.js.map +1 -0
  1081. package/dist/devices/schwaiger.d.ts +3 -0
  1082. package/dist/devices/schwaiger.d.ts.map +1 -0
  1083. package/dist/devices/schwaiger.js +105 -0
  1084. package/dist/devices/schwaiger.js.map +1 -0
  1085. package/dist/devices/seastar_intelligence.d.ts +3 -0
  1086. package/dist/devices/seastar_intelligence.d.ts.map +1 -0
  1087. package/dist/devices/seastar_intelligence.js +52 -0
  1088. package/dist/devices/seastar_intelligence.js.map +1 -0
  1089. package/dist/devices/securifi.d.ts +3 -0
  1090. package/dist/devices/securifi.d.ts.map +1 -0
  1091. package/dist/devices/securifi.js +79 -0
  1092. package/dist/devices/securifi.js.map +1 -0
  1093. package/dist/devices/sengled.d.ts +6 -0
  1094. package/dist/devices/sengled.d.ts.map +1 -0
  1095. package/dist/devices/sengled.js +395 -0
  1096. package/dist/devices/sengled.js.map +1 -0
  1097. package/dist/devices/senoro.d.ts +3 -0
  1098. package/dist/devices/senoro.d.ts.map +1 -0
  1099. package/dist/devices/senoro.js +64 -0
  1100. package/dist/devices/senoro.js.map +1 -0
  1101. package/dist/devices/sercomm.d.ts +3 -0
  1102. package/dist/devices/sercomm.d.ts.map +1 -0
  1103. package/dist/devices/sercomm.js +193 -0
  1104. package/dist/devices/sercomm.js.map +1 -0
  1105. package/dist/devices/shade_control.d.ts +3 -0
  1106. package/dist/devices/shade_control.d.ts.map +1 -0
  1107. package/dist/devices/shade_control.js +61 -0
  1108. package/dist/devices/shade_control.js.map +1 -0
  1109. package/dist/devices/shelly.d.ts +3 -0
  1110. package/dist/devices/shelly.d.ts.map +1 -0
  1111. package/dist/devices/shelly.js +1304 -0
  1112. package/dist/devices/shelly.js.map +1 -0
  1113. package/dist/devices/shenzhen_homa.d.ts +3 -0
  1114. package/dist/devices/shenzhen_homa.d.ts.map +1 -0
  1115. package/dist/devices/shenzhen_homa.js +143 -0
  1116. package/dist/devices/shenzhen_homa.js.map +1 -0
  1117. package/dist/devices/shinasystem.d.ts +3 -0
  1118. package/dist/devices/shinasystem.d.ts.map +1 -0
  1119. package/dist/devices/shinasystem.js +1322 -0
  1120. package/dist/devices/shinasystem.js.map +1 -0
  1121. package/dist/devices/shyugj.d.ts +3 -0
  1122. package/dist/devices/shyugj.d.ts.map +1 -0
  1123. package/dist/devices/shyugj.js +53 -0
  1124. package/dist/devices/shyugj.js.map +1 -0
  1125. package/dist/devices/siglis.d.ts +3 -0
  1126. package/dist/devices/siglis.d.ts.map +1 -0
  1127. package/dist/devices/siglis.js +440 -0
  1128. package/dist/devices/siglis.js.map +1 -0
  1129. package/dist/devices/sikom.d.ts +3 -0
  1130. package/dist/devices/sikom.d.ts.map +1 -0
  1131. package/dist/devices/sikom.js +64 -0
  1132. package/dist/devices/sikom.js.map +1 -0
  1133. package/dist/devices/silicon_labs.d.ts +3 -0
  1134. package/dist/devices/silicon_labs.d.ts.map +1 -0
  1135. package/dist/devices/silicon_labs.js +47 -0
  1136. package/dist/devices/silicon_labs.js.map +1 -0
  1137. package/dist/devices/simon.d.ts +3 -0
  1138. package/dist/devices/simon.d.ts.map +1 -0
  1139. package/dist/devices/simon.js +54 -0
  1140. package/dist/devices/simon.js.map +1 -0
  1141. package/dist/devices/simpla_home.d.ts +3 -0
  1142. package/dist/devices/simpla_home.d.ts.map +1 -0
  1143. package/dist/devices/simpla_home.js +97 -0
  1144. package/dist/devices/simpla_home.js.map +1 -0
  1145. package/dist/devices/sinope.d.ts +3 -0
  1146. package/dist/devices/sinope.d.ts.map +1 -0
  1147. package/dist/devices/sinope.js +2015 -0
  1148. package/dist/devices/sinope.js.map +1 -0
  1149. package/dist/devices/siterwell.d.ts +3 -0
  1150. package/dist/devices/siterwell.d.ts.map +1 -0
  1151. package/dist/devices/siterwell.js +107 -0
  1152. package/dist/devices/siterwell.js.map +1 -0
  1153. package/dist/devices/skydance.d.ts +3 -0
  1154. package/dist/devices/skydance.d.ts.map +1 -0
  1155. package/dist/devices/skydance.js +138 -0
  1156. package/dist/devices/skydance.js.map +1 -0
  1157. package/dist/devices/slacky_diy.d.ts +3 -0
  1158. package/dist/devices/slacky_diy.d.ts.map +1 -0
  1159. package/dist/devices/slacky_diy.js +3694 -0
  1160. package/dist/devices/slacky_diy.js.map +1 -0
  1161. package/dist/devices/slv.d.ts +3 -0
  1162. package/dist/devices/slv.d.ts.map +1 -0
  1163. package/dist/devices/slv.js +77 -0
  1164. package/dist/devices/slv.js.map +1 -0
  1165. package/dist/devices/smarli.d.ts +3 -0
  1166. package/dist/devices/smarli.d.ts.map +1 -0
  1167. package/dist/devices/smarli.js +99 -0
  1168. package/dist/devices/smarli.js.map +1 -0
  1169. package/dist/devices/smart9.d.ts +3 -0
  1170. package/dist/devices/smart9.d.ts.map +1 -0
  1171. package/dist/devices/smart9.js +58 -0
  1172. package/dist/devices/smart9.js.map +1 -0
  1173. package/dist/devices/smart_home_pty.d.ts +3 -0
  1174. package/dist/devices/smart_home_pty.d.ts.map +1 -0
  1175. package/dist/devices/smart_home_pty.js +54 -0
  1176. package/dist/devices/smart_home_pty.js.map +1 -0
  1177. package/dist/devices/smartenit.d.ts +3 -0
  1178. package/dist/devices/smartenit.d.ts.map +1 -0
  1179. package/dist/devices/smartenit.js +77 -0
  1180. package/dist/devices/smartenit.js.map +1 -0
  1181. package/dist/devices/smartthings.d.ts +26 -0
  1182. package/dist/devices/smartthings.d.ts.map +1 -0
  1183. package/dist/devices/smartthings.js +571 -0
  1184. package/dist/devices/smartthings.js.map +1 -0
  1185. package/dist/devices/smartwings.d.ts +3 -0
  1186. package/dist/devices/smartwings.d.ts.map +1 -0
  1187. package/dist/devices/smartwings.js +60 -0
  1188. package/dist/devices/smartwings.js.map +1 -0
  1189. package/dist/devices/smlight.d.ts +3 -0
  1190. package/dist/devices/smlight.d.ts.map +1 -0
  1191. package/dist/devices/smlight.js +73 -0
  1192. package/dist/devices/smlight.js.map +1 -0
  1193. package/dist/devices/soanalarm.d.ts +3 -0
  1194. package/dist/devices/soanalarm.d.ts.map +1 -0
  1195. package/dist/devices/soanalarm.js +58 -0
  1196. package/dist/devices/soanalarm.js.map +1 -0
  1197. package/dist/devices/sohan_electric.d.ts +3 -0
  1198. package/dist/devices/sohan_electric.d.ts.map +1 -0
  1199. package/dist/devices/sohan_electric.js +49 -0
  1200. package/dist/devices/sohan_electric.js.map +1 -0
  1201. package/dist/devices/solaredge.d.ts +3 -0
  1202. package/dist/devices/solaredge.d.ts.map +1 -0
  1203. package/dist/devices/solaredge.js +47 -0
  1204. package/dist/devices/solaredge.js.map +1 -0
  1205. package/dist/devices/soma.d.ts +3 -0
  1206. package/dist/devices/soma.d.ts.map +1 -0
  1207. package/dist/devices/soma.js +47 -0
  1208. package/dist/devices/soma.js.map +1 -0
  1209. package/dist/devices/somfy.d.ts +3 -0
  1210. package/dist/devices/somfy.d.ts.map +1 -0
  1211. package/dist/devices/somfy.js +173 -0
  1212. package/dist/devices/somfy.js.map +1 -0
  1213. package/dist/devices/somgoms.d.ts +3 -0
  1214. package/dist/devices/somgoms.d.ts.map +1 -0
  1215. package/dist/devices/somgoms.js +80 -0
  1216. package/dist/devices/somgoms.js.map +1 -0
  1217. package/dist/devices/sonoff.d.ts +42 -0
  1218. package/dist/devices/sonoff.d.ts.map +1 -0
  1219. package/dist/devices/sonoff.js +4921 -0
  1220. package/dist/devices/sonoff.js.map +1 -0
  1221. package/dist/devices/sowilo.d.ts +3 -0
  1222. package/dist/devices/sowilo.d.ts.map +1 -0
  1223. package/dist/devices/sowilo.js +47 -0
  1224. package/dist/devices/sowilo.js.map +1 -0
  1225. package/dist/devices/spacetronik.d.ts +3 -0
  1226. package/dist/devices/spacetronik.d.ts.map +1 -0
  1227. package/dist/devices/spacetronik.js +53 -0
  1228. package/dist/devices/spacetronik.js.map +1 -0
  1229. package/dist/devices/spotmau.d.ts +3 -0
  1230. package/dist/devices/spotmau.d.ts.map +1 -0
  1231. package/dist/devices/spotmau.js +74 -0
  1232. package/dist/devices/spotmau.js.map +1 -0
  1233. package/dist/devices/sprut.d.ts +3 -0
  1234. package/dist/devices/sprut.d.ts.map +1 -0
  1235. package/dist/devices/sprut.js +328 -0
  1236. package/dist/devices/sprut.js.map +1 -0
  1237. package/dist/devices/stello.d.ts +3 -0
  1238. package/dist/devices/stello.d.ts.map +1 -0
  1239. package/dist/devices/stello.js +142 -0
  1240. package/dist/devices/stello.js.map +1 -0
  1241. package/dist/devices/stelpro.d.ts +3 -0
  1242. package/dist/devices/stelpro.d.ts.map +1 -0
  1243. package/dist/devices/stelpro.js +376 -0
  1244. package/dist/devices/stelpro.js.map +1 -0
  1245. package/dist/devices/sunricher.d.ts +30 -0
  1246. package/dist/devices/sunricher.d.ts.map +1 -0
  1247. package/dist/devices/sunricher.js +2337 -0
  1248. package/dist/devices/sunricher.js.map +1 -0
  1249. package/dist/devices/superled.d.ts +3 -0
  1250. package/dist/devices/superled.d.ts.map +1 -0
  1251. package/dist/devices/superled.js +47 -0
  1252. package/dist/devices/superled.js.map +1 -0
  1253. package/dist/devices/swann.d.ts +3 -0
  1254. package/dist/devices/swann.d.ts.map +1 -0
  1255. package/dist/devices/swann.js +69 -0
  1256. package/dist/devices/swann.js.map +1 -0
  1257. package/dist/devices/sylvania.d.ts +3 -0
  1258. package/dist/devices/sylvania.d.ts.map +1 -0
  1259. package/dist/devices/sylvania.js +223 -0
  1260. package/dist/devices/sylvania.js.map +1 -0
  1261. package/dist/devices/tapestry.d.ts +3 -0
  1262. package/dist/devices/tapestry.d.ts.map +1 -0
  1263. package/dist/devices/tapestry.js +52 -0
  1264. package/dist/devices/tapestry.js.map +1 -0
  1265. package/dist/devices/task_lighting.d.ts +3 -0
  1266. package/dist/devices/task_lighting.d.ts.map +1 -0
  1267. package/dist/devices/task_lighting.js +47 -0
  1268. package/dist/devices/task_lighting.js.map +1 -0
  1269. package/dist/devices/tci.d.ts +3 -0
  1270. package/dist/devices/tci.d.ts.map +1 -0
  1271. package/dist/devices/tci.js +68 -0
  1272. package/dist/devices/tci.js.map +1 -0
  1273. package/dist/devices/tcl.d.ts +3 -0
  1274. package/dist/devices/tcl.d.ts.map +1 -0
  1275. package/dist/devices/tcl.js +47 -0
  1276. package/dist/devices/tcl.js.map +1 -0
  1277. package/dist/devices/tech.d.ts +3 -0
  1278. package/dist/devices/tech.d.ts.map +1 -0
  1279. package/dist/devices/tech.js +213 -0
  1280. package/dist/devices/tech.js.map +1 -0
  1281. package/dist/devices/technicolor.d.ts +3 -0
  1282. package/dist/devices/technicolor.d.ts.map +1 -0
  1283. package/dist/devices/technicolor.js +85 -0
  1284. package/dist/devices/technicolor.js.map +1 -0
  1285. package/dist/devices/terncy.d.ts +3 -0
  1286. package/dist/devices/terncy.d.ts.map +1 -0
  1287. package/dist/devices/terncy.js +192 -0
  1288. package/dist/devices/terncy.js.map +1 -0
  1289. package/dist/devices/the_light_group.d.ts +3 -0
  1290. package/dist/devices/the_light_group.d.ts.map +1 -0
  1291. package/dist/devices/the_light_group.js +145 -0
  1292. package/dist/devices/the_light_group.js.map +1 -0
  1293. package/dist/devices/third_reality.d.ts +3 -0
  1294. package/dist/devices/third_reality.d.ts.map +1 -0
  1295. package/dist/devices/third_reality.js +1067 -0
  1296. package/dist/devices/third_reality.js.map +1 -0
  1297. package/dist/devices/tis_control.d.ts +3 -0
  1298. package/dist/devices/tis_control.d.ts.map +1 -0
  1299. package/dist/devices/tis_control.js +47 -0
  1300. package/dist/devices/tis_control.js.map +1 -0
  1301. package/dist/devices/titan_products.d.ts +3 -0
  1302. package/dist/devices/titan_products.d.ts.map +1 -0
  1303. package/dist/devices/titan_products.js +58 -0
  1304. package/dist/devices/titan_products.js.map +1 -0
  1305. package/dist/devices/tlwglobal.d.ts +3 -0
  1306. package/dist/devices/tlwglobal.d.ts.map +1 -0
  1307. package/dist/devices/tlwglobal.js +64 -0
  1308. package/dist/devices/tlwglobal.js.map +1 -0
  1309. package/dist/devices/tnce.d.ts +3 -0
  1310. package/dist/devices/tnce.d.ts.map +1 -0
  1311. package/dist/devices/tnce.js +54 -0
  1312. package/dist/devices/tnce.js.map +1 -0
  1313. package/dist/devices/tplink.d.ts +3 -0
  1314. package/dist/devices/tplink.d.ts.map +1 -0
  1315. package/dist/devices/tplink.js +77 -0
  1316. package/dist/devices/tplink.js.map +1 -0
  1317. package/dist/devices/trust.d.ts +3 -0
  1318. package/dist/devices/trust.d.ts.map +1 -0
  1319. package/dist/devices/trust.js +180 -0
  1320. package/dist/devices/trust.js.map +1 -0
  1321. package/dist/devices/tubeszb.d.ts +3 -0
  1322. package/dist/devices/tubeszb.d.ts.map +1 -0
  1323. package/dist/devices/tubeszb.js +56 -0
  1324. package/dist/devices/tubeszb.js.map +1 -0
  1325. package/dist/devices/tuya.d.ts +3 -0
  1326. package/dist/devices/tuya.d.ts.map +1 -0
  1327. package/dist/devices/tuya.js +24771 -0
  1328. package/dist/devices/tuya.js.map +1 -0
  1329. package/dist/devices/ubisys.d.ts +3 -0
  1330. package/dist/devices/ubisys.d.ts.map +1 -0
  1331. package/dist/devices/ubisys.js +1295 -0
  1332. package/dist/devices/ubisys.js.map +1 -0
  1333. package/dist/devices/uhome.d.ts +3 -0
  1334. package/dist/devices/uhome.d.ts.map +1 -0
  1335. package/dist/devices/uhome.js +60 -0
  1336. package/dist/devices/uhome.js.map +1 -0
  1337. package/dist/devices/universal_electronics_inc.d.ts +3 -0
  1338. package/dist/devices/universal_electronics_inc.d.ts.map +1 -0
  1339. package/dist/devices/universal_electronics_inc.js +156 -0
  1340. package/dist/devices/universal_electronics_inc.js.map +1 -0
  1341. package/dist/devices/vav.d.ts +3 -0
  1342. package/dist/devices/vav.d.ts.map +1 -0
  1343. package/dist/devices/vav.js +57 -0
  1344. package/dist/devices/vav.js.map +1 -0
  1345. package/dist/devices/vbled.d.ts +3 -0
  1346. package/dist/devices/vbled.d.ts.map +1 -0
  1347. package/dist/devices/vbled.js +47 -0
  1348. package/dist/devices/vbled.js.map +1 -0
  1349. package/dist/devices/vesternet.d.ts +3 -0
  1350. package/dist/devices/vesternet.d.ts.map +1 -0
  1351. package/dist/devices/vesternet.js +355 -0
  1352. package/dist/devices/vesternet.js.map +1 -0
  1353. package/dist/devices/viessmann.d.ts +3 -0
  1354. package/dist/devices/viessmann.d.ts.map +1 -0
  1355. package/dist/devices/viessmann.js +120 -0
  1356. package/dist/devices/viessmann.js.map +1 -0
  1357. package/dist/devices/villeroy_boch.d.ts +3 -0
  1358. package/dist/devices/villeroy_boch.d.ts.map +1 -0
  1359. package/dist/devices/villeroy_boch.js +54 -0
  1360. package/dist/devices/villeroy_boch.js.map +1 -0
  1361. package/dist/devices/vimar.d.ts +3 -0
  1362. package/dist/devices/vimar.d.ts.map +1 -0
  1363. package/dist/devices/vimar.js +140 -0
  1364. package/dist/devices/vimar.js.map +1 -0
  1365. package/dist/devices/visonic.d.ts +3 -0
  1366. package/dist/devices/visonic.d.ts.map +1 -0
  1367. package/dist/devices/visonic.js +134 -0
  1368. package/dist/devices/visonic.js.map +1 -0
  1369. package/dist/devices/vrey.d.ts +3 -0
  1370. package/dist/devices/vrey.d.ts.map +1 -0
  1371. package/dist/devices/vrey.js +48 -0
  1372. package/dist/devices/vrey.js.map +1 -0
  1373. package/dist/devices/vsmart.d.ts +3 -0
  1374. package/dist/devices/vsmart.d.ts.map +1 -0
  1375. package/dist/devices/vsmart.js +442 -0
  1376. package/dist/devices/vsmart.js.map +1 -0
  1377. package/dist/devices/wally.d.ts +3 -0
  1378. package/dist/devices/wally.d.ts.map +1 -0
  1379. package/dist/devices/wally.js +60 -0
  1380. package/dist/devices/wally.js.map +1 -0
  1381. package/dist/devices/waxman.d.ts +3 -0
  1382. package/dist/devices/waxman.d.ts.map +1 -0
  1383. package/dist/devices/waxman.js +83 -0
  1384. package/dist/devices/waxman.js.map +1 -0
  1385. package/dist/devices/weiser.d.ts +3 -0
  1386. package/dist/devices/weiser.d.ts.map +1 -0
  1387. package/dist/devices/weiser.js +54 -0
  1388. package/dist/devices/weiser.js.map +1 -0
  1389. package/dist/devices/weten.d.ts +3 -0
  1390. package/dist/devices/weten.d.ts.map +1 -0
  1391. package/dist/devices/weten.js +83 -0
  1392. package/dist/devices/weten.js.map +1 -0
  1393. package/dist/devices/wirenboard.d.ts +3 -0
  1394. package/dist/devices/wirenboard.d.ts.map +1 -0
  1395. package/dist/devices/wirenboard.js +715 -0
  1396. package/dist/devices/wirenboard.js.map +1 -0
  1397. package/dist/devices/wisdom.d.ts +3 -0
  1398. package/dist/devices/wisdom.d.ts.map +1 -0
  1399. package/dist/devices/wisdom.js +47 -0
  1400. package/dist/devices/wisdom.js.map +1 -0
  1401. package/dist/devices/wmun.d.ts +3 -0
  1402. package/dist/devices/wmun.d.ts.map +1 -0
  1403. package/dist/devices/wmun.js +61 -0
  1404. package/dist/devices/wmun.js.map +1 -0
  1405. package/dist/devices/woolley.d.ts +3 -0
  1406. package/dist/devices/woolley.d.ts.map +1 -0
  1407. package/dist/devices/woolley.js +96 -0
  1408. package/dist/devices/woolley.js.map +1 -0
  1409. package/dist/devices/woox.d.ts +3 -0
  1410. package/dist/devices/woox.d.ts.map +1 -0
  1411. package/dist/devices/woox.js +194 -0
  1412. package/dist/devices/woox.js.map +1 -0
  1413. package/dist/devices/wyze.d.ts +3 -0
  1414. package/dist/devices/wyze.d.ts.map +1 -0
  1415. package/dist/devices/wyze.js +59 -0
  1416. package/dist/devices/wyze.js.map +1 -0
  1417. package/dist/devices/xal.d.ts +3 -0
  1418. package/dist/devices/xal.d.ts.map +1 -0
  1419. package/dist/devices/xal.js +61 -0
  1420. package/dist/devices/xal.js.map +1 -0
  1421. package/dist/devices/xenon.d.ts +4 -0
  1422. package/dist/devices/xenon.d.ts.map +1 -0
  1423. package/dist/devices/xenon.js +65 -0
  1424. package/dist/devices/xenon.js.map +1 -0
  1425. package/dist/devices/xinghuoyuan.d.ts +3 -0
  1426. package/dist/devices/xinghuoyuan.d.ts.map +1 -0
  1427. package/dist/devices/xinghuoyuan.js +47 -0
  1428. package/dist/devices/xinghuoyuan.js.map +1 -0
  1429. package/dist/devices/xyzroe.d.ts +3 -0
  1430. package/dist/devices/xyzroe.d.ts.map +1 -0
  1431. package/dist/devices/xyzroe.js +511 -0
  1432. package/dist/devices/xyzroe.js.map +1 -0
  1433. package/dist/devices/yale.d.ts +3 -0
  1434. package/dist/devices/yale.d.ts.map +1 -0
  1435. package/dist/devices/yale.js +686 -0
  1436. package/dist/devices/yale.js.map +1 -0
  1437. package/dist/devices/yandex.d.ts +3 -0
  1438. package/dist/devices/yandex.d.ts.map +1 -0
  1439. package/dist/devices/yandex.js +677 -0
  1440. package/dist/devices/yandex.js.map +1 -0
  1441. package/dist/devices/ynoa.d.ts +3 -0
  1442. package/dist/devices/ynoa.d.ts.map +1 -0
  1443. package/dist/devices/ynoa.js +116 -0
  1444. package/dist/devices/ynoa.js.map +1 -0
  1445. package/dist/devices/yokis.d.ts +3 -0
  1446. package/dist/devices/yokis.d.ts.map +1 -0
  1447. package/dist/devices/yokis.js +2972 -0
  1448. package/dist/devices/yokis.js.map +1 -0
  1449. package/dist/devices/yookee.d.ts +3 -0
  1450. package/dist/devices/yookee.d.ts.map +1 -0
  1451. package/dist/devices/yookee.js +59 -0
  1452. package/dist/devices/yookee.js.map +1 -0
  1453. package/dist/devices/ysrsai.d.ts +3 -0
  1454. package/dist/devices/ysrsai.d.ts.map +1 -0
  1455. package/dist/devices/ysrsai.js +68 -0
  1456. package/dist/devices/ysrsai.js.map +1 -0
  1457. package/dist/devices/zbeacon.d.ts +3 -0
  1458. package/dist/devices/zbeacon.d.ts.map +1 -0
  1459. package/dist/devices/zbeacon.js +54 -0
  1460. package/dist/devices/zbeacon.js.map +1 -0
  1461. package/dist/devices/zemismart.d.ts +3 -0
  1462. package/dist/devices/zemismart.d.ts.map +1 -0
  1463. package/dist/devices/zemismart.js +1061 -0
  1464. package/dist/devices/zemismart.js.map +1 -0
  1465. package/dist/devices/zen.d.ts +3 -0
  1466. package/dist/devices/zen.d.ts.map +1 -0
  1467. package/dist/devices/zen.js +93 -0
  1468. package/dist/devices/zen.js.map +1 -0
  1469. package/dist/devices/zigbeetlc.d.ts +3 -0
  1470. package/dist/devices/zigbeetlc.d.ts.map +1 -0
  1471. package/dist/devices/zigbeetlc.js +374 -0
  1472. package/dist/devices/zigbeetlc.js.map +1 -0
  1473. package/dist/devices/zipato.d.ts +3 -0
  1474. package/dist/devices/zipato.d.ts.map +1 -0
  1475. package/dist/devices/zipato.js +47 -0
  1476. package/dist/devices/zipato.js.map +1 -0
  1477. package/dist/devices/zunzunbee.d.ts +3 -0
  1478. package/dist/devices/zunzunbee.d.ts.map +1 -0
  1479. package/dist/devices/zunzunbee.js +97 -0
  1480. package/dist/devices/zunzunbee.js.map +1 -0
  1481. package/dist/index.d.ts +19 -0
  1482. package/dist/index.d.ts.map +1 -0
  1483. package/dist/index.js.map +1 -0
  1484. package/dist/indexer.d.ts +5 -0
  1485. package/dist/indexer.d.ts.map +1 -0
  1486. package/dist/indexer.js +135 -0
  1487. package/dist/indexer.js.map +1 -0
  1488. package/dist/lib/adurosmart.d.ts +15 -0
  1489. package/dist/lib/adurosmart.d.ts.map +1 -0
  1490. package/dist/lib/adurosmart.js +669 -0
  1491. package/dist/lib/adurosmart.js.map +1 -0
  1492. package/dist/lib/bosch.d.ts +353 -0
  1493. package/dist/lib/bosch.d.ts.map +1 -0
  1494. package/dist/lib/bosch.js +3163 -0
  1495. package/dist/lib/bosch.js.map +1 -0
  1496. package/dist/lib/color.d.ts +272 -0
  1497. package/dist/lib/color.d.ts.map +1 -0
  1498. package/dist/lib/color.js +766 -0
  1499. package/dist/lib/color.js.map +1 -0
  1500. package/dist/lib/constants.d.ts +78 -0
  1501. package/dist/lib/constants.d.ts.map +1 -0
  1502. package/dist/lib/constants.js +317 -0
  1503. package/dist/lib/constants.js.map +1 -0
  1504. package/dist/lib/develco.d.ts +50 -0
  1505. package/dist/lib/develco.d.ts.map +1 -0
  1506. package/dist/lib/develco.js +433 -0
  1507. package/dist/lib/develco.js.map +1 -0
  1508. package/dist/lib/ewelink.d.ts +30 -0
  1509. package/dist/lib/ewelink.d.ts.map +1 -0
  1510. package/dist/lib/ewelink.js +722 -0
  1511. package/dist/lib/ewelink.js.map +1 -0
  1512. package/dist/lib/exposes.d.ts +376 -0
  1513. package/dist/lib/exposes.d.ts.map +1 -0
  1514. package/dist/lib/exposes.js +1136 -0
  1515. package/dist/lib/exposes.js.map +1 -0
  1516. package/dist/lib/generateDefinition.d.ts +10 -0
  1517. package/dist/lib/generateDefinition.d.ts.map +1 -0
  1518. package/dist/lib/generateDefinition.js +773 -0
  1519. package/dist/lib/generateDefinition.js.map +1 -0
  1520. package/dist/lib/heiman.d.ts +92 -0
  1521. package/dist/lib/heiman.d.ts.map +1 -0
  1522. package/dist/lib/heiman.js +211 -0
  1523. package/dist/lib/heiman.js.map +1 -0
  1524. package/dist/lib/ikea.d.ts +106 -0
  1525. package/dist/lib/ikea.d.ts.map +1 -0
  1526. package/dist/lib/ikea.js +984 -0
  1527. package/dist/lib/ikea.js.map +1 -0
  1528. package/dist/lib/kelvinToXy.d.ts +8 -0
  1529. package/dist/lib/kelvinToXy.d.ts.map +1 -0
  1530. package/dist/lib/kelvinToXy.js +1913 -0
  1531. package/dist/lib/kelvinToXy.js.map +1 -0
  1532. package/dist/lib/ledvance.d.ts +20 -0
  1533. package/dist/lib/ledvance.d.ts.map +1 -0
  1534. package/dist/lib/ledvance.js +100 -0
  1535. package/dist/lib/ledvance.js.map +1 -0
  1536. package/dist/lib/legacy.d.ts +5197 -0
  1537. package/dist/lib/legacy.d.ts.map +1 -0
  1538. package/dist/lib/legacy.js +6865 -0
  1539. package/dist/lib/legacy.js.map +1 -0
  1540. package/dist/lib/legrand.d.ts +132 -0
  1541. package/dist/lib/legrand.d.ts.map +1 -0
  1542. package/dist/lib/legrand.js +404 -0
  1543. package/dist/lib/legrand.js.map +1 -0
  1544. package/dist/lib/light.d.ts +9 -0
  1545. package/dist/lib/light.d.ts.map +1 -0
  1546. package/dist/lib/light.js +144 -0
  1547. package/dist/lib/light.js.map +1 -0
  1548. package/dist/lib/logger.d.ts +4 -0
  1549. package/dist/lib/logger.d.ts.map +1 -0
  1550. package/dist/lib/logger.js +14 -0
  1551. package/dist/lib/logger.js.map +1 -0
  1552. package/dist/lib/lumi.d.ts +1093 -0
  1553. package/dist/lib/lumi.d.ts.map +1 -0
  1554. package/dist/lib/lumi.js +6479 -0
  1555. package/dist/lib/lumi.js.map +1 -0
  1556. package/dist/lib/modernExtend.d.ts +436 -0
  1557. package/dist/lib/modernExtend.d.ts.map +1 -0
  1558. package/dist/lib/modernExtend.js +2702 -0
  1559. package/dist/lib/modernExtend.js.map +1 -0
  1560. package/dist/lib/namron.d.ts +56 -0
  1561. package/dist/lib/namron.d.ts.map +1 -0
  1562. package/dist/lib/namron.js +433 -0
  1563. package/dist/lib/namron.js.map +1 -0
  1564. package/dist/lib/nodon.d.ts +3 -0
  1565. package/dist/lib/nodon.d.ts.map +1 -0
  1566. package/dist/lib/nodon.js +130 -0
  1567. package/dist/lib/nodon.js.map +1 -0
  1568. package/dist/lib/philips.d.ts +321 -0
  1569. package/dist/lib/philips.d.ts.map +1 -0
  1570. package/dist/lib/philips.js +876 -0
  1571. package/dist/lib/philips.js.map +1 -0
  1572. package/dist/lib/reporting.d.ts +57 -0
  1573. package/dist/lib/reporting.d.ts.map +1 -0
  1574. package/dist/lib/reporting.js +294 -0
  1575. package/dist/lib/reporting.js.map +1 -0
  1576. package/dist/lib/sonoff.d.ts +30 -0
  1577. package/dist/lib/sonoff.d.ts.map +1 -0
  1578. package/dist/lib/sonoff.js +91 -0
  1579. package/dist/lib/sonoff.js.map +1 -0
  1580. package/dist/lib/store.d.ts +7 -0
  1581. package/dist/lib/store.d.ts.map +1 -0
  1582. package/dist/lib/store.js +59 -0
  1583. package/dist/lib/store.js.map +1 -0
  1584. package/dist/lib/sunricher.d.ts +29 -0
  1585. package/dist/lib/sunricher.d.ts.map +1 -0
  1586. package/dist/lib/sunricher.js +838 -0
  1587. package/dist/lib/sunricher.js.map +1 -0
  1588. package/dist/lib/tuya.d.ts +998 -0
  1589. package/dist/lib/tuya.d.ts.map +1 -0
  1590. package/dist/lib/tuya.js +3043 -0
  1591. package/dist/lib/tuya.js.map +1 -0
  1592. package/dist/lib/types.d.ts +429 -0
  1593. package/dist/lib/types.d.ts.map +1 -0
  1594. package/dist/lib/types.js +3 -0
  1595. package/dist/lib/types.js.map +1 -0
  1596. package/dist/lib/ubisys.d.ts +107 -0
  1597. package/dist/lib/ubisys.d.ts.map +1 -0
  1598. package/dist/lib/ubisys.js +576 -0
  1599. package/dist/lib/ubisys.js.map +1 -0
  1600. package/dist/lib/utils.d.ts +95 -0
  1601. package/dist/lib/utils.d.ts.map +1 -0
  1602. package/dist/lib/utils.js +736 -0
  1603. package/dist/lib/utils.js.map +1 -0
  1604. package/dist/lib/zosung.d.ts +52 -0
  1605. package/dist/lib/zosung.d.ts.map +1 -0
  1606. package/dist/lib/zosung.js +264 -0
  1607. package/dist/lib/zosung.js.map +1 -0
  1608. package/dist/models-index.json +1 -0
  1609. package/package.json +2 -8
@@ -0,0 +1,3043 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.clusters = exports.modernExtend = exports.fz = exports.tz = exports.valueConverter = exports.valueConverterBasic = exports.Bitmap = exports.BacklightColorEnum = exports.enum = exports.Enum = exports.whitelabel = exports.fingerprint = exports.configureBindBasic = exports.configureMcuVersionRequest = exports.configureQuery = exports.configureMagicPacket = exports.skip = exports.exposes = exports.TuyaWeatherID = exports.F3ProTuyaWeatherCondition = exports.M8ProTuyaWeatherCondition = exports.dataTypes = void 0;
37
+ exports.convertBufferToNumber = convertBufferToNumber;
38
+ exports.convertDecimalValueTo4ByteHexArray = convertDecimalValueTo4ByteHexArray;
39
+ exports.dpValueFromString = dpValueFromString;
40
+ exports.sendDataPointValue = sendDataPointValue;
41
+ exports.sendDataPointBool = sendDataPointBool;
42
+ exports.sendDataPointEnum = sendDataPointEnum;
43
+ exports.sendDataPointRaw = sendDataPointRaw;
44
+ exports.sendDataPointBitmap = sendDataPointBitmap;
45
+ exports.sendDataPointStringBuffer = sendDataPointStringBuffer;
46
+ exports.getHandlersForDP = getHandlersForDP;
47
+ const zigbee_herdsman_1 = require("@willieee802/zigbee-herdsman");
48
+ const fz = __importStar(require("../converters/fromZigbee"));
49
+ const tz = __importStar(require("../converters/toZigbee"));
50
+ const constants = __importStar(require("./constants"));
51
+ const exposes = __importStar(require("./exposes"));
52
+ const logger_1 = require("./logger");
53
+ const modernExtend = __importStar(require("./modernExtend"));
54
+ const globalStore = __importStar(require("./store"));
55
+ const utils = __importStar(require("./utils"));
56
+ const utils_1 = require("./utils");
57
+ // import {Color} from './color';
58
+ const NS = "zhc:tuya";
59
+ const e = exposes.presets;
60
+ const ea = exposes.access;
61
+ exports.dataTypes = {
62
+ raw: 0, // [ bytes ]
63
+ bool: 1, // [0/1]
64
+ number: 2, // [ 4 byte value ]
65
+ string: 3, // [ N byte string ]
66
+ enum: 4, // [ 0-255 ]
67
+ bitmap: 5, // [ 1,2,4 bytes ] as bits
68
+ };
69
+ exports.M8ProTuyaWeatherCondition = {
70
+ sunny: 100,
71
+ heavy_rain: 101,
72
+ cloudy: 102,
73
+ sandstorm: 103,
74
+ light_snow: 104,
75
+ snow: 105,
76
+ freezing_fog: 106,
77
+ rainstorm: 107,
78
+ shower: 108,
79
+ dust: 109,
80
+ spit: 112,
81
+ sleet: 113,
82
+ yin: 114,
83
+ freezing_rain: 115,
84
+ rain: 118,
85
+ fog: 121,
86
+ heavy_shower: 123,
87
+ heavy_snow: 124,
88
+ heavy_downpour: 125,
89
+ blizzard: 126,
90
+ hailstone: 127,
91
+ snow_shower: 130,
92
+ haze: 140,
93
+ thunder_shower: 143,
94
+ };
95
+ exports.F3ProTuyaWeatherCondition = {
96
+ heavy_rain: 101,
97
+ thunderstorm: 102,
98
+ dust_storm: 103,
99
+ light_snow: 104,
100
+ snow: 105,
101
+ freezing_fog: 106,
102
+ shower: 108,
103
+ floating_dust: 109,
104
+ thunder_and_lighting: 110,
105
+ light_shower: 111,
106
+ rain: 112,
107
+ rain_and_snow: 113,
108
+ dust_bowl: 114,
109
+ ice_pellets: 115,
110
+ strong_dust_storms: 116,
111
+ sandy: 117,
112
+ light_to_moderate_rain: 118,
113
+ mostly_sunny: 119,
114
+ sunny: 120,
115
+ haze: 121,
116
+ heavy_shower: 123,
117
+ heavy_snow: 124,
118
+ very_heavy_rain: 125,
119
+ blizzard: 126,
120
+ ice_pod: 127,
121
+ light_to_moderate_snow: 128,
122
+ few_clouds: 129,
123
+ light_snow_showers: 130,
124
+ moderate_snow: 131,
125
+ cloudy: 132,
126
+ icy_needles: 133,
127
+ thunderstorm_with_ice_pods: 136,
128
+ freezing_rain: 137,
129
+ snow_shower: 138,
130
+ light_rain: 139,
131
+ thunder: 140,
132
+ moderate_rain: 141,
133
+ moderate_to_heavy_rain: 144,
134
+ };
135
+ var TuyaWeatherID;
136
+ (function (TuyaWeatherID) {
137
+ TuyaWeatherID[TuyaWeatherID["Temperature"] = 1] = "Temperature";
138
+ TuyaWeatherID[TuyaWeatherID["Humidity"] = 2] = "Humidity";
139
+ TuyaWeatherID[TuyaWeatherID["Condition"] = 3] = "Condition";
140
+ })(TuyaWeatherID || (exports.TuyaWeatherID = TuyaWeatherID = {}));
141
+ function convertBufferToNumber(chunks) {
142
+ let value = 0;
143
+ for (let i = 0; i < chunks.length; i++) {
144
+ value = value << 8;
145
+ value += chunks[i];
146
+ }
147
+ return value;
148
+ }
149
+ function convertStringToHexArray(value) {
150
+ const asciiKeys = [];
151
+ for (let i = 0; i < value.length; i++) {
152
+ asciiKeys.push(value[i].charCodeAt(0));
153
+ }
154
+ return asciiKeys;
155
+ }
156
+ function getDataValue(dpValue) {
157
+ let dataString = "";
158
+ switch (dpValue.datatype) {
159
+ case exports.dataTypes.raw:
160
+ return dpValue.data;
161
+ case exports.dataTypes.bool:
162
+ return dpValue.data[0] === 1;
163
+ case exports.dataTypes.number:
164
+ return convertBufferToNumber(dpValue.data);
165
+ case exports.dataTypes.string:
166
+ // Don't use .map here, doesn't work: https://github.com/Koenkk/zigbee-herdsman-converters/pull/1799/files#r530377091
167
+ for (let i = 0; i < dpValue.data.length; ++i) {
168
+ dataString += String.fromCharCode(dpValue.data[i]);
169
+ }
170
+ return dataString;
171
+ case exports.dataTypes.enum:
172
+ return dpValue.data[0];
173
+ case exports.dataTypes.bitmap:
174
+ return convertBufferToNumber(dpValue.data);
175
+ }
176
+ }
177
+ function convertDecimalValueTo4ByteHexArray(value) {
178
+ const hexValue = Number(value).toString(16).padStart(8, "0");
179
+ const chunk1 = hexValue.substring(0, 2);
180
+ const chunk2 = hexValue.substring(2, 4);
181
+ const chunk3 = hexValue.substring(4, 6);
182
+ const chunk4 = hexValue.substring(6);
183
+ return [chunk1, chunk2, chunk3, chunk4].map((hexVal) => Number.parseInt(hexVal, 16));
184
+ }
185
+ function convertDecimalValueTo2ByteHexArray(value) {
186
+ const hexValue = Number(value).toString(16).padStart(4, "0");
187
+ const chunk1 = hexValue.substring(0, 2);
188
+ const chunk2 = hexValue.substring(2);
189
+ return [chunk1, chunk2].map((hexVal) => Number.parseInt(hexVal, 16));
190
+ }
191
+ // Return `seq` - transaction ID for handling concrete response
192
+ async function sendDataPoints(entity, dpValues, cmd = "dataRequest", seq) {
193
+ if (seq === undefined) {
194
+ seq = globalStore.getValue(entity, "sequence", 0);
195
+ globalStore.putValue(entity, "sequence", (seq + 1) % 0xffff);
196
+ }
197
+ await entity.command("manuSpecificTuya", cmd, { seq, dpValues }, { disableDefaultResponse: true });
198
+ return seq;
199
+ }
200
+ function dpValueFromNumberValue(dp, value) {
201
+ return { dp, datatype: exports.dataTypes.number, data: Buffer.from(convertDecimalValueTo4ByteHexArray(value)) };
202
+ }
203
+ function dpValueFromBool(dp, value) {
204
+ return { dp, datatype: exports.dataTypes.bool, data: Buffer.from([value ? 1 : 0]) };
205
+ }
206
+ function dpValueFromEnum(dp, value) {
207
+ return { dp, datatype: exports.dataTypes.enum, data: Buffer.from([value]) };
208
+ }
209
+ function dpValueFromString(dp, string) {
210
+ return { dp, datatype: exports.dataTypes.string, data: Buffer.from(convertStringToHexArray(string)) };
211
+ }
212
+ function dpValueFromRaw(dp, rawBuffer) {
213
+ return { dp, datatype: exports.dataTypes.raw, data: rawBuffer };
214
+ }
215
+ function dpValueFromBitmap(dp, bitmapBuffer) {
216
+ return { dp, datatype: exports.dataTypes.bitmap, data: Buffer.from([bitmapBuffer]) };
217
+ }
218
+ async function sendDataPointValue(entity, dp, value, cmd, seq) {
219
+ return await sendDataPoints(entity, [dpValueFromNumberValue(dp, value)], cmd, seq);
220
+ }
221
+ async function sendDataPointBool(entity, dp, value, cmd, seq) {
222
+ return await sendDataPoints(entity, [dpValueFromBool(dp, value)], cmd, seq);
223
+ }
224
+ async function sendDataPointEnum(entity, dp, value, cmd, seq) {
225
+ return await sendDataPoints(entity, [dpValueFromEnum(dp, value)], cmd, seq);
226
+ }
227
+ async function sendDataPointRaw(entity, dp, value, cmd, seq) {
228
+ return await sendDataPoints(entity, [dpValueFromRaw(dp, value)], cmd, seq);
229
+ }
230
+ async function sendDataPointBitmap(entity, dp, value, cmd, seq) {
231
+ return await sendDataPoints(entity, [dpValueFromBitmap(dp, value)], cmd, seq);
232
+ }
233
+ async function sendDataPointStringBuffer(entity, dp, value, cmd, seq) {
234
+ return await sendDataPoints(entity, [dpValueFromString(dp, value)], cmd, seq);
235
+ }
236
+ const tuyaExposes = {
237
+ lightType: () => e.enum("light_type", ea.STATE_SET, ["led", "incandescent", "halogen"]).withDescription("Type of light attached to the device"),
238
+ lightBrightnessWithMinMax: () => e
239
+ .light_brightness()
240
+ .withMinBrightness()
241
+ .withMaxBrightness()
242
+ .setAccess("state", ea.STATE_SET)
243
+ .setAccess("brightness", ea.STATE_SET)
244
+ .setAccess("min_brightness", ea.STATE_SET)
245
+ .setAccess("max_brightness", ea.STATE_SET),
246
+ lightBrightness: () => e.light_brightness().setAccess("state", ea.STATE_SET).setAccess("brightness", ea.STATE_SET),
247
+ countdown: () => e
248
+ .numeric("countdown", ea.STATE_SET)
249
+ .withValueMin(0)
250
+ .withValueMax(43200)
251
+ .withValueStep(1)
252
+ .withUnit("s")
253
+ .withDescription("Countdown to turn device off after a certain time"),
254
+ switch: () => e.switch().setAccess("state", ea.STATE_SET),
255
+ selfTest: () => e.binary("self_test", ea.STATE_SET, true, false).withDescription("Indicates whether the device is being self-tested"),
256
+ selfTestResult: () => e.enum("self_test_result", ea.STATE, ["checking", "success", "failure", "others"]).withDescription("Result of the self-test"),
257
+ faultAlarm: () => e.binary("fault_alarm", ea.STATE, true, false).withDescription("Indicates whether a fault was detected"),
258
+ silence: () => e.binary("silence", ea.STATE_SET, true, false).withDescription("Silence the alarm"),
259
+ frostProtection: (extraNote = "") => e
260
+ .binary("frost_protection", ea.STATE_SET, "ON", "OFF")
261
+ .withDescription(`When Anti-Freezing function is activated, the temperature in the house is kept at 8 °C.${extraNote}`),
262
+ errorStatus: () => e.numeric("error_status", ea.STATE).withDescription("Error status"),
263
+ scheduleAllDays: (access, example) => ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"].map((day) => e.text(`schedule_${day}`, access).withDescription(`Schedule for ${day}, example: "${example}"`)),
264
+ temperatureUnit: () => e.enum("temperature_unit", ea.STATE_SET, ["celsius", "fahrenheit"]).withDescription("Temperature unit"),
265
+ temperatureCalibration: () => e
266
+ .numeric("temperature_calibration", ea.STATE_SET)
267
+ .withValueMin(-2.0)
268
+ .withValueMax(2.0)
269
+ .withValueStep(0.1)
270
+ .withUnit("°C")
271
+ .withDescription("Temperature calibration"),
272
+ humidityCalibration: () => e
273
+ .numeric("humidity_calibration", ea.STATE_SET)
274
+ .withValueMin(-30)
275
+ .withValueMax(30)
276
+ .withValueStep(1)
277
+ .withUnit("%")
278
+ .withDescription("Humidity calibration"),
279
+ soilCalibration: () => e
280
+ .numeric("soil_calibration", ea.STATE_SET)
281
+ .withValueMin(-30)
282
+ .withValueMax(30)
283
+ .withValueStep(1)
284
+ .withUnit("%")
285
+ .withDescription("Soil Humidity calibration"),
286
+ temperatureSampling: () => e
287
+ .numeric("temperature_sampling", ea.STATE_SET)
288
+ .withValueMin(5)
289
+ .withValueMax(3600)
290
+ .withValueStep(1)
291
+ .withUnit("s")
292
+ .withDescription("Air temperature and humidity sampling"),
293
+ soilSampling: () => e
294
+ .numeric("soil_sampling", ea.STATE_SET)
295
+ .withValueMin(5)
296
+ .withValueMax(3600)
297
+ .withValueStep(1)
298
+ .withUnit("s")
299
+ .withDescription("Soil humidity sampling"),
300
+ soilWarning: () => e
301
+ .numeric("soil_warning", ea.STATE_SET)
302
+ .withValueMin(0)
303
+ .withValueMax(100)
304
+ .withValueStep(1)
305
+ .withUnit("%")
306
+ .withDescription("Soil water shortage humidity value"),
307
+ gasValue: () => e.numeric("gas_value", ea.STATE).withDescription("Measured gas concentration"),
308
+ energyWithPhase: (phase) => e.numeric(`energy_${phase}`, ea.STATE).withUnit("kWh").withDescription(`Sum of consumed energy (phase ${phase.toUpperCase()})`),
309
+ energyProducedWithPhase: (phase) => e.numeric(`energy_produced_${phase}`, ea.STATE).withUnit("kWh").withDescription(`Sum of produced energy (phase ${phase.toUpperCase()})`),
310
+ energyFlowWithPhase: (phase, more) => e
311
+ .enum(`energy_flow_${phase}`, ea.STATE, ["consuming", "producing", ...more])
312
+ .withDescription(`Direction of energy (phase ${phase.toUpperCase()})`),
313
+ voltageWithPhase: (phase) => e.numeric(`voltage_${phase}`, ea.STATE).withUnit("V").withDescription(`Measured electrical potential value (phase ${phase.toUpperCase()})`),
314
+ powerWithPhase: (phase) => e.numeric(`power_${phase}`, ea.STATE).withUnit("W").withDescription(`Instantaneous measured power (phase ${phase.toUpperCase()})`),
315
+ currentWithPhase: (phase) => e
316
+ .numeric(`current_${phase}`, ea.STATE)
317
+ .withUnit("A")
318
+ .withDescription(`Instantaneous measured electrical current (phase ${phase.toUpperCase()})`),
319
+ powerFactorWithPhase: (phase) => e
320
+ .numeric(`power_factor_${phase}`, ea.STATE)
321
+ .withUnit("%")
322
+ .withDescription(`Instantaneous measured power factor (phase ${phase.toUpperCase()})`),
323
+ switchType: () => e.enum("switch_type", ea.ALL, ["toggle", "state", "momentary"]).withDescription("Type of the switch").withCategory("config"),
324
+ switchTypeCurtain: () => e
325
+ .enum("switch_type_curtain", ea.ALL, ["flip-switch", "sync-switch", "button-switch", "button2-switch"])
326
+ .withDescription("External switch type")
327
+ .withCategory("config"),
328
+ switchTypeButton: () => e.enum("switch_type_button", ea.ALL, ["release", "press"]).withDescription("Determines when the button actuates").withCategory("config"),
329
+ backlightModeLowMediumHigh: () => e.enum("backlight_mode", ea.ALL, ["low", "medium", "high"]).withDescription("Intensity of the backlight").withCategory("config"),
330
+ backlightModeOffNormalInverted: () => e.enum("backlight_mode", ea.ALL, ["off", "normal", "inverted"]).withDescription("Mode of the backlight").withCategory("config"),
331
+ backlightModeOffOn: () => e.binary("backlight_mode", ea.ALL, "ON", "OFF").withDescription("Mode of the backlight").withCategory("config"),
332
+ indicatorMode: () => e.enum("indicator_mode", ea.ALL, ["off", "off/on", "on/off", "on"]).withDescription("LED indicator mode").withCategory("config"),
333
+ indicatorModeNoneRelayPos: () => e.enum("indicator_mode", ea.ALL, ["none", "relay", "pos"]).withDescription("Mode of the indicator light").withCategory("config"),
334
+ powerOutageMemory: () => e.enum("power_outage_memory", ea.ALL, ["on", "off", "restore"]).withDescription("Recover state after power outage").withCategory("config"),
335
+ batteryState: () => e.enum("battery_state", ea.STATE, ["low", "medium", "high"]).withDescription("State of the battery"),
336
+ doNotDisturb: () => e
337
+ .binary("do_not_disturb", ea.STATE_SET, true, false)
338
+ .withDescription("Do not disturb mode, when enabled this function will keep the light OFF after a power outage")
339
+ .withCategory("config"),
340
+ colorPowerOnBehavior: () => e
341
+ .enum("color_power_on_behavior", ea.STATE_SET, ["initial", "previous", "customized"])
342
+ .withDescription("Power on behavior state")
343
+ .withCategory("config"),
344
+ powerOnBehavior: () => e.enum("power_on_behavior", ea.ALL, ["off", "on", "previous"]).withDescription("Power on behavior state").withCategory("config"),
345
+ switchMode: () => e
346
+ .enum("switch_mode", ea.STATE_SET, ["switch", "scene"])
347
+ .withDescription("Sets the mode of the switch to act as a switch or as a scene")
348
+ .withCategory("config"),
349
+ switchMode2: () => e
350
+ .enum("switch_mode", ea.STATE_SET, ["switch", "curtain"])
351
+ .withDescription("Sets the mode of the switch to act as a switch or as a curtain controller")
352
+ .withCategory("config"),
353
+ lightMode: () => e.enum("light_mode", ea.STATE_SET, ["normal", "on", "off", "flash"]).withDescription(`'Sets the indicator mode of l1.
354
+ Normal: Orange while off and white while on.
355
+ On: Always white. Off: Always orange.
356
+ Flash: Flashes white when triggered.
357
+ Note: Orange light will turn off after light off delay, white light always stays on. Light mode updates on next state change.'`),
358
+ // Inching can be enabled for multiple endpoints (1 to 6) but it is always controlled on endpoint 1
359
+ // So instead of pinning the values to each endpoint, it is easier to keep the structure stand alone.
360
+ inchingSwitch: (quantity) => {
361
+ const x = e
362
+ .composite("inching_control_set", "inching_control_set", ea.SET)
363
+ .withDescription("Device Inching function Settings. The device will automatically turn off " + "after each turn on for a specified period of time.");
364
+ for (let i = 1; i <= quantity; i++) {
365
+ x.withFeature(e
366
+ .binary("inching_control", ea.SET, "ENABLE", "DISABLE")
367
+ .withDescription(`Enable/disable inching function for endpoint ${i}.`)
368
+ .withLabel(`Inching for Endpoint ${i}`)
369
+ .withProperty(`inching_control_${i}`)).withFeature(e
370
+ .numeric("inching_time", ea.SET)
371
+ .withDescription(`Delay time for executing a inching action for endpoint ${i}.`)
372
+ .withLabel(`Inching time for endpoint ${i}`)
373
+ .withProperty(`inching_time_${i}`)
374
+ .withUnit("seconds")
375
+ .withValueMin(1)
376
+ .withValueMax(65535)
377
+ .withValueStep(1));
378
+ }
379
+ return x;
380
+ },
381
+ };
382
+ exports.exposes = tuyaExposes;
383
+ exports.skip = {
384
+ // Prevent state from being published when already ON and brightness is also published.
385
+ // This prevents 100% -> X% brightness jumps when the switch is already on
386
+ // https://github.com/Koenkk/zigbee2mqtt/issues/13800#issuecomment-1263592783
387
+ stateOnAndBrightnessPresent: (meta) => {
388
+ if (Array.isArray(meta.mapped))
389
+ throw new Error("Not supported");
390
+ const convertedKey = meta.mapped.meta.multiEndpoint && meta.endpoint_name ? `state_${meta.endpoint_name}` : "state";
391
+ return meta.message.brightness != null && meta.state[convertedKey] === meta.message.state;
392
+ },
393
+ };
394
+ const configureMagicPacket = async (device, coordinatorEndpoint) => {
395
+ await utils.ignoreUnsupportedAttribute(async () => {
396
+ await device.endpoints[0].read("genBasic", ["manufacturerName", "zclVersion", "appVersion", "modelId", "powerSource", 0xfffe]);
397
+ }, "Tuya configureMagicPacket");
398
+ };
399
+ exports.configureMagicPacket = configureMagicPacket;
400
+ const configureQuery = async (device, coordinatorEndpoint) => {
401
+ // Required to get the device to start reporting
402
+ await device.getEndpoint(1).command("manuSpecificTuya", "dataQuery", {});
403
+ };
404
+ exports.configureQuery = configureQuery;
405
+ const configureMcuVersionRequest = async (device, coordinatorEndpoint) => {
406
+ await device.getEndpoint(1).command("manuSpecificTuya", "mcuVersionRequest", { seq: 0x0002 });
407
+ };
408
+ exports.configureMcuVersionRequest = configureMcuVersionRequest;
409
+ const configureBindBasic = async (device, coordinatorEndpoint) => {
410
+ await device.getEndpoint(1).bind("genBasic", coordinatorEndpoint);
411
+ };
412
+ exports.configureBindBasic = configureBindBasic;
413
+ const fingerprint = (modelID, manufacturerNames) => {
414
+ return manufacturerNames.map((manufacturerName) => {
415
+ return { modelID, manufacturerName };
416
+ });
417
+ };
418
+ exports.fingerprint = fingerprint;
419
+ const whitelabel = (vendor, model, description, manufacturerNames) => {
420
+ const fingerprint = manufacturerNames.map((manufacturerName) => {
421
+ return { manufacturerName };
422
+ });
423
+ return { vendor, model, description, fingerprint };
424
+ };
425
+ exports.whitelabel = whitelabel;
426
+ class Base {
427
+ value;
428
+ constructor(value) {
429
+ this.value = value;
430
+ }
431
+ valueOf() {
432
+ return this.value;
433
+ }
434
+ }
435
+ class Enum extends Base {
436
+ }
437
+ exports.Enum = Enum;
438
+ const enumConstructor = (value) => new Enum(value);
439
+ exports.enum = enumConstructor;
440
+ exports.BacklightColorEnum = {
441
+ red: enumConstructor(0),
442
+ blue: enumConstructor(1),
443
+ green: enumConstructor(2),
444
+ white: enumConstructor(3),
445
+ yellow: enumConstructor(4),
446
+ magenta: enumConstructor(5),
447
+ cyan: enumConstructor(6),
448
+ warm_white: enumConstructor(7),
449
+ };
450
+ class Bitmap extends Base {
451
+ }
452
+ exports.Bitmap = Bitmap;
453
+ exports.valueConverterBasic = {
454
+ lookup: (map, fallbackValue) => {
455
+ return {
456
+ to: (v, meta) => utils.getFromLookup(v, typeof map === "function" ? map(meta.options, meta.device) : map),
457
+ from: (v, _meta, options) => {
458
+ const m = typeof map === "function" ? map(options, _meta.device) : map;
459
+ const value = Object.entries(m).find((i) => i[1].valueOf() === v);
460
+ if (!value) {
461
+ if (fallbackValue !== undefined)
462
+ return fallbackValue;
463
+ throw new Error(`Value '${v}' is not allowed, expected one of ${Object.values(m).map((i) => i.valueOf())}`);
464
+ }
465
+ return value[0];
466
+ },
467
+ };
468
+ },
469
+ scale: (min1, max1, min2, max2) => {
470
+ return {
471
+ to: (v) => utils.mapNumberRange(v, min1, max1, min2, max2),
472
+ from: (v) => utils.mapNumberRange(v, min2, max2, min1, max1),
473
+ };
474
+ },
475
+ raw: () => {
476
+ return { to: (v) => v, from: (v) => v };
477
+ },
478
+ divideBy: (value) => {
479
+ return { to: (v) => v * value, from: (v) => v / value };
480
+ },
481
+ divideByFromOnly: (value) => {
482
+ return { to: (v) => v, from: (v) => v / value };
483
+ },
484
+ divideByWithLimits: (value, min, max) => {
485
+ return {
486
+ to: (v) => (v > max ? max * value : v < min ? min * value : v * value),
487
+ from: (v) => (v / value > max ? max : v / value < min ? min : v / value),
488
+ };
489
+ },
490
+ trueFalse: (valueTrue) => {
491
+ return { from: (v) => v === valueTrue.valueOf() };
492
+ },
493
+ };
494
+ exports.valueConverter = {
495
+ trueFalse0: exports.valueConverterBasic.trueFalse(0),
496
+ trueFalse1: exports.valueConverterBasic.trueFalse(1),
497
+ trueFalseInvert: {
498
+ to: (v) => !v,
499
+ from: (v) => !v,
500
+ },
501
+ trueFalseEnum0: exports.valueConverterBasic.trueFalse(new Enum(0)),
502
+ trueFalseEnum1: exports.valueConverterBasic.trueFalse(new Enum(1)),
503
+ onOff: exports.valueConverterBasic.lookup({ ON: true, OFF: false }),
504
+ powerOnBehavior: exports.valueConverterBasic.lookup({ off: 0, on: 1, previous: 2 }),
505
+ powerOnBehaviorEnum: exports.valueConverterBasic.lookup({ off: new Enum(0), on: new Enum(1), previous: new Enum(2) }),
506
+ switchType: exports.valueConverterBasic.lookup({ momentary: new Enum(0), toggle: new Enum(1), state: new Enum(2) }),
507
+ switchTypeCurtain: exports.valueConverterBasic.lookup({
508
+ "flip-switch": new Enum(0),
509
+ "sync-switch": new Enum(1),
510
+ "button-switch": new Enum(2),
511
+ "button2-switch": new Enum(3),
512
+ }),
513
+ switchTypeButton: exports.valueConverterBasic.lookup({
514
+ release: new Enum(0),
515
+ press: new Enum(1),
516
+ }),
517
+ switchType2: exports.valueConverterBasic.lookup({ toggle: new Enum(0), state: new Enum(1), momentary: new Enum(2) }),
518
+ backlightModeOffNormalInverted: exports.valueConverterBasic.lookup({ off: new Enum(0), normal: new Enum(1), inverted: new Enum(2) }),
519
+ backlightModeOffLowMediumHigh: exports.valueConverterBasic.lookup({ off: new Enum(0), low: new Enum(1), medium: new Enum(2), high: new Enum(3) }),
520
+ lightType: exports.valueConverterBasic.lookup({ led: 0, incandescent: 1, halogen: 2 }),
521
+ countdown: exports.valueConverterBasic.raw(),
522
+ scale0_254to0_1000: exports.valueConverterBasic.scale(0, 254, 0, 1000),
523
+ scale0_1to0_1000: exports.valueConverterBasic.scale(0, 1, 0, 1000),
524
+ temperatureUnit: exports.valueConverterBasic.lookup({ celsius: 0, fahrenheit: 1 }),
525
+ temperatureUnitEnum: exports.valueConverterBasic.lookup({ celsius: new Enum(0), fahrenheit: new Enum(1) }),
526
+ batteryState: exports.valueConverterBasic.lookup({ low: 0, medium: 1, high: 2 }),
527
+ divideBy2: exports.valueConverterBasic.divideBy(2),
528
+ divideBy10: exports.valueConverterBasic.divideBy(10),
529
+ divideBy100: exports.valueConverterBasic.divideBy(100),
530
+ divideBy1000: exports.valueConverterBasic.divideBy(1000),
531
+ divideBy10FromOnly: exports.valueConverterBasic.divideByFromOnly(10),
532
+ switchMode: exports.valueConverterBasic.lookup({ switch: new Enum(0), scene: new Enum(1) }),
533
+ switchMode2: exports.valueConverterBasic.lookup({ switch: new Enum(0), curtain: new Enum(1) }),
534
+ lightMode: exports.valueConverterBasic.lookup({ normal: new Enum(0), on: new Enum(1), off: new Enum(2), flash: new Enum(3) }),
535
+ raw: exports.valueConverterBasic.raw(),
536
+ localTemperatureCalibration: {
537
+ from: (value) => (value > 4000 ? value - 4096 : value),
538
+ to: (value) => (value < 0 ? 4096 + value : value),
539
+ },
540
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
541
+ localTemperatureCalibration_256: {
542
+ from: (value) => (value > 200 ? value - 256 : value),
543
+ to: (value) => (value < 0 ? 256 + value : value),
544
+ },
545
+ waterConsumption: {
546
+ from: (v) => {
547
+ const buf = Buffer.isBuffer(v) ? v : Buffer.from(v || []);
548
+ if (buf.length >= 8) {
549
+ const value = (buf.readUInt8(4) << 24) + (buf.readUInt8(5) << 16) + (buf.readUInt8(6) << 8) + buf.readUInt8(7);
550
+ return value / 1000;
551
+ }
552
+ return 0;
553
+ },
554
+ },
555
+ setLimit: {
556
+ to: (v) => {
557
+ if (!v)
558
+ throw new Error("Limit cannot be unset, use factory_reset");
559
+ return v;
560
+ },
561
+ from: (v) => v,
562
+ },
563
+ coverPosition: {
564
+ to: (v, meta) => {
565
+ return meta.options.invert_cover ? 100 - v : v;
566
+ },
567
+ from: (v, meta, options, publish) => {
568
+ const position = options.invert_cover ? 100 - v : v;
569
+ publish({ state: position === 0 ? "CLOSE" : "OPEN" });
570
+ return position;
571
+ },
572
+ },
573
+ coverPositionInverted: {
574
+ to: (v, meta) => {
575
+ return meta.options.invert_cover ? v : 100 - v;
576
+ },
577
+ from: (v, meta, options, publish) => {
578
+ const position = options.invert_cover ? v : 100 - v;
579
+ publish({ state: position === 0 ? "CLOSE" : "OPEN" });
580
+ return position;
581
+ },
582
+ },
583
+ tubularMotorDirection: exports.valueConverterBasic.lookup({ normal: new Enum(0), reversed: new Enum(1) }),
584
+ plus1: {
585
+ from: (v) => v + 1,
586
+ to: (v) => v - 1,
587
+ },
588
+ static: (value) => {
589
+ return {
590
+ from: (v) => {
591
+ return value;
592
+ },
593
+ };
594
+ },
595
+ phaseVariant1: {
596
+ from: (v) => {
597
+ const buffer = Buffer.from(v, "base64");
598
+ return { voltage: (buffer[14] | (buffer[13] << 8)) / 10, current: (buffer[12] | (buffer[11] << 8)) / 1000 };
599
+ },
600
+ },
601
+ phaseVariant2: {
602
+ from: (v) => {
603
+ const buf = Buffer.from(v, "base64");
604
+ return { voltage: (buf[1] | (buf[0] << 8)) / 10, current: (buf[4] | (buf[3] << 8)) / 1000, power: buf[7] | (buf[6] << 8) };
605
+ },
606
+ },
607
+ phaseVariant2WithPhase: (phase) => {
608
+ return {
609
+ from: (v) => {
610
+ // Support negative power readings
611
+ // https://github.com/Koenkk/zigbee2mqtt/issues/18603#issuecomment-2277697295
612
+ const buf = Buffer.from(v, "base64");
613
+ let power = buf[7] | (buf[6] << 8);
614
+ if (power > 0x7fff) {
615
+ power = (0x999a - power) * -1;
616
+ }
617
+ return {
618
+ [`voltage_${phase}`]: (buf[1] | (buf[0] << 8)) / 10,
619
+ [`current_${phase}`]: (buf[4] | (buf[3] << 8)) / 1000,
620
+ [`power_${phase}`]: power,
621
+ };
622
+ },
623
+ };
624
+ },
625
+ phaseVariant3: {
626
+ from: (v) => {
627
+ const buf = Buffer.from(v, "base64");
628
+ return {
629
+ voltage: ((buf[0] << 8) | buf[1]) / 10,
630
+ current: ((buf[2] << 16) | (buf[3] << 8) | buf[4]) / 1000,
631
+ power: (buf[5] << 16) | (buf[6] << 8) | buf[7],
632
+ };
633
+ },
634
+ },
635
+ power: {
636
+ from: (v) => {
637
+ // Support negative readings
638
+ // https://github.com/Koenkk/zigbee2mqtt/issues/18603
639
+ return v > 0x0fffffff ? (0x1999999c - v) * -1 : v;
640
+ },
641
+ },
642
+ threshold: {
643
+ from: (v) => {
644
+ const buffer = Buffer.from(v, "base64");
645
+ const stateLookup = { 0: "not_set", 1: "over_current_threshold", 3: "over_voltage_threshold" };
646
+ const protectionLookup = { 0: "OFF", 1: "ON" };
647
+ return {
648
+ threshold_1_protection: protectionLookup[buffer[1]],
649
+ threshold_1: stateLookup[buffer[0]],
650
+ threshold_1_value: buffer[3] | (buffer[2] << 8),
651
+ threshold_2_protection: protectionLookup[buffer[5]],
652
+ threshold_2: stateLookup[buffer[4]],
653
+ threshold_2_value: buffer[7] | (buffer[6] << 8),
654
+ };
655
+ },
656
+ },
657
+ threshold_2: {
658
+ to: async (v, meta) => {
659
+ const entity = meta.device.endpoints[0];
660
+ const onOffLookup = { on: 1, off: 0 };
661
+ const sendCommand = utils.getMetaValue(entity, meta.mapped, "tuyaSendCommand", undefined, "dataRequest");
662
+ if (meta.message.overload_breaker) {
663
+ const threshold = meta.state.overload_threshold;
664
+ const buf = Buffer.from([
665
+ 3,
666
+ utils.getFromLookup(meta.message.overload_breaker, onOffLookup),
667
+ 0,
668
+ utils.toNumber(threshold, "overload_threshold"),
669
+ ]);
670
+ await sendDataPointRaw(entity, 17, buf, sendCommand, 1);
671
+ }
672
+ else if (meta.message.overload_threshold) {
673
+ const state = meta.state.overload_breaker;
674
+ const buf = Buffer.from([
675
+ 3,
676
+ utils.getFromLookup(state, onOffLookup),
677
+ 0,
678
+ utils.toNumber(meta.message.overload_threshold, "overload_threshold"),
679
+ ]);
680
+ await sendDataPointRaw(entity, 17, buf, sendCommand, 1);
681
+ }
682
+ else if (meta.message.leakage_threshold) {
683
+ const state = meta.state.leakage_breaker;
684
+ const buf = Buffer.alloc(8);
685
+ buf.writeUInt8(4, 4);
686
+ buf.writeUInt8(utils.getFromLookup(state, onOffLookup), 5);
687
+ buf.writeUInt16BE(utils.toNumber(meta.message.leakage_threshold, "leakage_threshold"), 6);
688
+ await sendDataPointRaw(entity, 17, buf, sendCommand, 1);
689
+ }
690
+ else if (meta.message.leakage_breaker) {
691
+ const threshold = meta.state.leakage_threshold;
692
+ const buf = Buffer.alloc(8);
693
+ buf.writeUInt8(4, 4);
694
+ buf.writeUInt8(utils.getFromLookup(meta.message.leakage_breaker, onOffLookup), 5);
695
+ buf.writeUInt16BE(utils.toNumber(threshold, "leakage_threshold"), 6);
696
+ await sendDataPointRaw(entity, 17, buf, sendCommand, 1);
697
+ }
698
+ else if (meta.message.high_temperature_threshold) {
699
+ const state = meta.state.high_temperature_breaker;
700
+ const buf = Buffer.alloc(12);
701
+ buf.writeUInt8(5, 8);
702
+ buf.writeUInt8(utils.getFromLookup(state, onOffLookup), 9);
703
+ buf.writeUInt16BE(utils.toNumber(meta.message.high_temperature_threshold, "high_temperature_threshold"), 10);
704
+ await sendDataPointRaw(entity, 17, buf, sendCommand, 1);
705
+ }
706
+ else if (meta.message.high_temperature_breaker) {
707
+ const threshold = meta.state.high_temperature_threshold;
708
+ const buf = Buffer.alloc(12);
709
+ buf.writeUInt8(5, 8);
710
+ buf.writeUInt8(utils.getFromLookup(meta.message.high_temperature_breaker, onOffLookup), 9);
711
+ buf.writeUInt16BE(utils.toNumber(threshold, "high_temperature_threshold"), 10);
712
+ await sendDataPointRaw(entity, 17, buf, sendCommand, 1);
713
+ }
714
+ },
715
+ from: (v) => {
716
+ const data = Buffer.from(v, "base64");
717
+ const result = {};
718
+ const lookup = { 0: "OFF", 1: "ON" };
719
+ const alarmLookup = { 3: "overload", 4: "leakage", 5: "high_temperature" };
720
+ const len = data.length;
721
+ let i = 0;
722
+ while (i < len) {
723
+ if (Object.hasOwn(alarmLookup, data[i])) {
724
+ const alarm = alarmLookup[data[i]];
725
+ const state = lookup[data[i + 1]];
726
+ const threshold = data[i + 3] | (data[i + 2] << 8);
727
+ result[`${alarm}_breaker`] = state;
728
+ result[`${alarm}_threshold`] = threshold;
729
+ }
730
+ i += 4;
731
+ }
732
+ return result;
733
+ },
734
+ },
735
+ threshold_3: {
736
+ to: async (v, meta) => {
737
+ const entity = meta.device.endpoints[0];
738
+ const onOffLookup = { on: 1, off: 0 };
739
+ const sendCommand = utils.getMetaValue(entity, meta.mapped, "tuyaSendCommand", undefined, "dataRequest");
740
+ if (meta.message.over_current_threshold) {
741
+ const state = meta.state.over_current_breaker;
742
+ const buf = Buffer.from([
743
+ 1,
744
+ utils.getFromLookup(state, onOffLookup, 0),
745
+ 0,
746
+ utils.toNumber(meta.message.over_current_threshold, "over_current_threshold"),
747
+ ]);
748
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
749
+ }
750
+ else if (meta.message.over_current_breaker) {
751
+ const threshold = meta.state.over_current_threshold;
752
+ const buf = Buffer.from([
753
+ 1,
754
+ utils.getFromLookup(meta.message.over_current_breaker, onOffLookup, 0),
755
+ 0,
756
+ utils.toNumber(threshold, "over_current_threshold"),
757
+ ]);
758
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
759
+ }
760
+ else if (meta.message.over_voltage_threshold) {
761
+ const state = meta.state.over_voltage_breaker;
762
+ const buf = Buffer.alloc(8);
763
+ buf.writeUInt8(3, 4);
764
+ buf.writeUInt8(utils.getFromLookup(state, onOffLookup, 0), 5);
765
+ buf.writeUInt16BE(utils.toNumber(meta.message.over_voltage_threshold, "over_voltage_threshold"), 6);
766
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
767
+ }
768
+ else if (meta.message.over_voltage_breaker) {
769
+ const threshold = meta.state.over_voltage_threshold;
770
+ const buf = Buffer.alloc(8);
771
+ buf.writeUInt8(3, 4);
772
+ buf.writeUInt8(utils.getFromLookup(meta.message.over_voltage_breaker, onOffLookup, 0), 5);
773
+ buf.writeUInt16BE(utils.toNumber(threshold, "over_voltage_threshold"), 6);
774
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
775
+ }
776
+ else if (meta.message.under_voltage_threshold) {
777
+ const state = meta.state.under_voltage_breaker;
778
+ const buf = Buffer.alloc(12);
779
+ buf.writeUInt8(4, 8);
780
+ buf.writeUInt8(utils.getFromLookup(state, onOffLookup, 0), 9);
781
+ buf.writeUInt16BE(utils.toNumber(meta.message.under_voltage_threshold, "under_voltage_threshold"), 10);
782
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
783
+ }
784
+ else if (meta.message.under_voltage_breaker) {
785
+ const threshold = meta.state.under_voltage_threshold;
786
+ const buf = Buffer.alloc(12);
787
+ buf.writeUInt8(4, 8);
788
+ buf.writeUInt8(utils.getFromLookup(meta.message.under_voltage_breaker, onOffLookup, 0), 9);
789
+ buf.writeUInt16BE(utils.toNumber(threshold, "under_voltage_threshold"), 10);
790
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
791
+ }
792
+ else if (meta.message.insufficient_balance_threshold) {
793
+ const state = meta.state.insufficient_balance_breaker;
794
+ const buf = Buffer.alloc(16);
795
+ buf.writeUInt8(8, 12);
796
+ buf.writeUInt8(utils.getFromLookup(state, onOffLookup, 0), 13);
797
+ buf.writeUInt16BE(utils.toNumber(meta.message.insufficient_balance_threshold, "insufficient_balance_threshold"), 14);
798
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
799
+ }
800
+ else if (meta.message.insufficient_balance_breaker) {
801
+ const threshold = meta.state.insufficient_balance_threshold;
802
+ const buf = Buffer.alloc(16);
803
+ buf.writeUInt8(8, 12);
804
+ buf.writeUInt8(utils.getFromLookup(meta.message.insufficient_balance_breaker, onOffLookup, 0), 13);
805
+ buf.writeUInt16BE(utils.toNumber(threshold, "insufficient_balance_threshold"), 14);
806
+ await sendDataPointRaw(entity, 18, buf, sendCommand, 1);
807
+ }
808
+ },
809
+ from: (v) => {
810
+ const data = Buffer.from(v, "base64");
811
+ const result = {};
812
+ const lookup = { 0: "OFF", 1: "ON" };
813
+ const alarmLookup = { 1: "over_current", 3: "over_voltage", 4: "under_voltage", 8: "insufficient_balance" };
814
+ const len = data.length;
815
+ let i = 0;
816
+ while (i < len) {
817
+ if (Object.hasOwn(alarmLookup, data[i])) {
818
+ const alarm = alarmLookup[data[i]];
819
+ const state = lookup[data[i + 1]];
820
+ const threshold = data[i + 3] | (data[i + 2] << 8);
821
+ result[`${alarm}_breaker`] = state;
822
+ result[`${alarm}_threshold`] = threshold;
823
+ }
824
+ i += 4;
825
+ }
826
+ return result;
827
+ },
828
+ },
829
+ selfTestResult: exports.valueConverterBasic.lookup({ checking: 0, success: 1, failure: 2, others: 3 }),
830
+ lockUnlock: exports.valueConverterBasic.lookup({ LOCK: true, UNLOCK: false }),
831
+ localTempCalibration1: {
832
+ from: (v) => {
833
+ if (v > 55)
834
+ v -= 0x100000000;
835
+ return v / 10;
836
+ },
837
+ to: (v) => {
838
+ if (v > 0)
839
+ return v * 10;
840
+ if (v < 0)
841
+ return v * 10 + 0x100000000;
842
+ return v;
843
+ },
844
+ },
845
+ localTempCalibration2: {
846
+ from: (v) => v,
847
+ to: (v) => {
848
+ if (v < 0)
849
+ return v + 0x100000000;
850
+ return v;
851
+ },
852
+ },
853
+ localTempCalibration3: {
854
+ from: (v) => {
855
+ if (v > 0x7fffffff)
856
+ v -= 0x100000000;
857
+ return v / 10;
858
+ },
859
+ to: (v) => {
860
+ if (v > 0)
861
+ return v * 10;
862
+ if (v < 0)
863
+ return v * 10 + 0x100000000;
864
+ return v;
865
+ },
866
+ },
867
+ thermostatHolidayStartStop: {
868
+ from: (v) => {
869
+ const start = {
870
+ year: v.slice(0, 4),
871
+ month: v.slice(4, 6),
872
+ day: v.slice(6, 8),
873
+ hours: v.slice(8, 10),
874
+ minutes: v.slice(10, 12),
875
+ };
876
+ const end = {
877
+ year: v.slice(12, 16),
878
+ month: v.slice(16, 18),
879
+ day: v.slice(18, 20),
880
+ hours: v.slice(20, 22),
881
+ minutes: v.slice(22, 24),
882
+ };
883
+ const startStr = `${start.year}/${start.month}/${start.day} ${start.hours}:${start.minutes}`;
884
+ const endStr = `${end.year}/${end.month}/${end.day} ${end.hours}:${end.minutes}`;
885
+ return `${startStr} | ${endStr}`;
886
+ },
887
+ to: (v) => {
888
+ const numberPattern = /\d+/g;
889
+ // @ts-expect-error ignore
890
+ return v.match(numberPattern).join([]).toString();
891
+ },
892
+ },
893
+ thermostatHolidayStartStopUnixTS: {
894
+ // converts 8-byte big-endian 2 times Unix timestamps array to "YYYY/MM/DD HH:MM | YYYY/MM/DD HH:MM" string
895
+ from: (v) => {
896
+ if (!v || v.length !== 8)
897
+ return "";
898
+ // Convert first 4 bytes → start Unix timestamp
899
+ const startUnixTS = (v[0] << 24) | (v[1] << 16) | (v[2] << 8) | v[3];
900
+ // Convert next 4 bytes → end Unix timestamp
901
+ const endUnixTS = (v[4] << 24) | (v[5] << 16) | (v[6] << 8) | v[7];
902
+ const fmt = (date) => {
903
+ const year = date.getUTCFullYear();
904
+ const month = String(date.getUTCMonth() + 1).padStart(2, "0"); // +1 as JavaScript months are zero-based
905
+ const day = String(date.getUTCDate()).padStart(2, "0");
906
+ const hours = String(date.getUTCHours()).padStart(2, "0");
907
+ const minutes = String(date.getUTCMinutes()).padStart(2, "0");
908
+ return `${year}/${month}/${day} ${hours}:${minutes}`;
909
+ };
910
+ return `${fmt(new Date(startUnixTS * 1000))} | ${fmt(new Date(endUnixTS * 1000))}`;
911
+ },
912
+ to: (v) => {
913
+ // converts from string "YYYY/MM/DD HH:MM | YYYY/MM/DD HH:MM" to 8-byte array
914
+ const [startDate, endDate] = v.split("|").map((s) => s.trim());
915
+ const parse = (s) => {
916
+ const [datePart, timePart] = s.split(" ");
917
+ const [y, m, d] = datePart.split("/").map(Number);
918
+ const [h, min] = timePart.split(":").map(Number);
919
+ const unix = Math.floor(Date.UTC(y, m - 1, d, h, min) / 1000);
920
+ return [(unix >> 24) & 0xff, (unix >> 16) & 0xff, (unix >> 8) & 0xff, unix & 0xff];
921
+ };
922
+ return [...parse(startDate), ...parse(endDate)]; // ... to unpack arrays into elements
923
+ },
924
+ },
925
+ thermostatScheduleDaySingleDP: {
926
+ from: (v) => {
927
+ // day split to 10 min segments = total 144 segments
928
+ const maxPeriodsInDay = 10;
929
+ const periodSize = 3;
930
+ const schedule = [];
931
+ for (let i = 0; i < maxPeriodsInDay; i++) {
932
+ const time = v[i * periodSize];
933
+ const totalMinutes = time * 10;
934
+ const hours = totalMinutes / 60;
935
+ const rHours = Math.floor(hours);
936
+ const minutes = (hours - rHours) * 60;
937
+ const rMinutes = Math.round(minutes);
938
+ const strHours = rHours.toString().padStart(2, "0");
939
+ const strMinutes = rMinutes.toString().padStart(2, "0");
940
+ const tempHexArray = [v[i * periodSize + 1], v[i * periodSize + 2]];
941
+ const tempRaw = Buffer.from(tempHexArray).readUIntBE(0, tempHexArray.length);
942
+ const temp = tempRaw / 10;
943
+ schedule.push(`${strHours}:${strMinutes}/${temp}`);
944
+ if (rHours === 24)
945
+ break;
946
+ }
947
+ return schedule.join(" ");
948
+ },
949
+ to: (v, meta) => {
950
+ const dayByte = {
951
+ monday: 1,
952
+ tuesday: 2,
953
+ wednesday: 4,
954
+ thursday: 8,
955
+ friday: 16,
956
+ saturday: 32,
957
+ sunday: 64,
958
+ };
959
+ const weekDay = v.week_day;
960
+ utils.assertString(weekDay, "week_day");
961
+ if (Object.keys(dayByte).indexOf(weekDay) === -1) {
962
+ throw new Error(`Invalid "week_day" property value: ${weekDay}`);
963
+ }
964
+ let weekScheduleType = "separate";
965
+ if (meta.state?.working_day) {
966
+ weekScheduleType = String(meta.state.working_day);
967
+ }
968
+ const payload = [];
969
+ switch (weekScheduleType) {
970
+ case "mon_sun":
971
+ payload.push(127);
972
+ break;
973
+ case "mon_fri+sat+sun":
974
+ if (["saturday", "sunday"].indexOf(weekDay) === -1) {
975
+ payload.push(31);
976
+ break;
977
+ }
978
+ payload.push(dayByte[weekDay]);
979
+ break;
980
+ case "separate":
981
+ payload.push(dayByte[weekDay]);
982
+ break;
983
+ default:
984
+ throw new Error('Invalid "working_day" property, need to set it before');
985
+ }
986
+ // day split to 10 min segments = total 144 segments
987
+ const maxPeriodsInDay = 10;
988
+ utils.assertString(v.schedule, "schedule");
989
+ const schedule = v.schedule.split(" ");
990
+ const schedulePeriods = schedule.length;
991
+ if (schedulePeriods > 10)
992
+ throw new Error(`There cannot be more than 10 periods in the schedule: ${v}`);
993
+ if (schedulePeriods < 2)
994
+ throw new Error(`There cannot be less than 2 periods in the schedule: ${v}`);
995
+ // biome-ignore lint/suspicious/noImplicitAnyLet: ignored using `--suppress`
996
+ let prevHour;
997
+ for (const period of schedule) {
998
+ const timeTemp = period.split("/");
999
+ const hm = timeTemp[0].split(":", 2);
1000
+ const h = Number.parseInt(hm[0], 10);
1001
+ const m = Number.parseInt(hm[1], 10);
1002
+ const temp = Number.parseFloat(timeTemp[1]);
1003
+ if (h < 0 || h > 24 || m < 0 || m >= 60 || m % 10 !== 0 || temp < 5 || temp > 30 || temp % 0.5 !== 0) {
1004
+ throw new Error(`Invalid hour, minute or temperature of: ${period}`);
1005
+ }
1006
+ if (prevHour > h) {
1007
+ throw new Error(`The hour of the next segment can't be less than the previous one: ${prevHour} > ${h}`);
1008
+ }
1009
+ prevHour = h;
1010
+ const segment = (h * 60 + m) / 10;
1011
+ const tempHexArray = convertDecimalValueTo2ByteHexArray(temp * 10);
1012
+ payload.push(segment, ...tempHexArray);
1013
+ }
1014
+ // Add "technical" periods to be valid payload
1015
+ for (let i = 0; i < maxPeriodsInDay - schedulePeriods; i++) {
1016
+ // by default it sends 9000b2, it's 24 hours and 18 degrees
1017
+ payload.push(144, 0, 180);
1018
+ }
1019
+ return payload;
1020
+ },
1021
+ },
1022
+ thermostatScheduleDayMultiDP: {
1023
+ from: (v) => exports.valueConverter.thermostatScheduleDayMultiDPWithTransitionCount().from(v),
1024
+ to: (v) => exports.valueConverter.thermostatScheduleDayMultiDPWithTransitionCount().to(v),
1025
+ },
1026
+ thermostatScheduleDayMultiDPWithTransitionCount: (transitionCount = 4) => {
1027
+ return {
1028
+ from: (v) => {
1029
+ const schedule = [];
1030
+ for (let index = 1; index < transitionCount * 4 - 1; index = index + 4) {
1031
+ schedule.push(
1032
+ // @ts-expect-error
1033
+ `${String(Number.parseInt(v[index + 0], 10)).padStart(2, "0")}:${String(Number.parseInt(v[index + 1], 10)).padStart(2, "0")}/${(Number.parseFloat((v[index + 2] << 8) + v[index + 3]) / 10.0).toFixed(1)}`);
1034
+ }
1035
+ return schedule.join(" ");
1036
+ },
1037
+ to: (v) => {
1038
+ const payload = [0];
1039
+ const transitions = v.split(" ");
1040
+ if (transitions.length !== transitionCount) {
1041
+ throw new Error(`Invalid schedule: there should be ${transitionCount} transitions`);
1042
+ }
1043
+ for (const transition of transitions) {
1044
+ const timeTemp = transition.split("/");
1045
+ if (timeTemp.length !== 2) {
1046
+ throw new Error(`Invalid schedule: wrong transition format: ${transition}`);
1047
+ }
1048
+ const hourMin = timeTemp[0].split(":");
1049
+ const hour = Number.parseInt(hourMin[0], 10);
1050
+ const min = Number.parseInt(hourMin[1], 10);
1051
+ const temperature = Math.floor(Number.parseFloat(timeTemp[1]) * 10);
1052
+ if (hour < 0 || hour > 24 || min < 0 || min > 60 || temperature < 50 || temperature > 350) {
1053
+ throw new Error(`Invalid hour, minute or temperature of: ${transition}`);
1054
+ }
1055
+ payload.push(hour, min, (temperature & 0xff00) >> 8, temperature & 0xff);
1056
+ }
1057
+ return payload;
1058
+ },
1059
+ };
1060
+ },
1061
+ thermostatScheduleDayMultiDPWithDayNumber: (dayNum, transitionCount = 4) => {
1062
+ return {
1063
+ from: (v) => exports.valueConverter.thermostatScheduleDayMultiDPWithTransitionCount(transitionCount).from(v),
1064
+ to: (v) => {
1065
+ const data = exports.valueConverter.thermostatScheduleDayMultiDPWithTransitionCount(transitionCount).to(v);
1066
+ data[0] = dayNum;
1067
+ return data;
1068
+ },
1069
+ };
1070
+ },
1071
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
1072
+ thermostatScheduleDayMultiDP_TRV602Z: {
1073
+ from: (v) => {
1074
+ const schedule = [];
1075
+ for (let index = 1; index < 24; index = index + 4) {
1076
+ const firstByte = (Number.parseInt(v[index + 0], 10) - 192) << 8;
1077
+ const secondByte = Number.parseInt(v[index + 1], 10);
1078
+ const minutesSinceMidnight = firstByte | secondByte;
1079
+ const hour = Math.floor(minutesSinceMidnight / 60);
1080
+ const minutes = minutesSinceMidnight % 60;
1081
+ schedule.push(`${String(hour).padStart(2, "0")}:${String(minutes).padStart(2, "0")}/${(Number.parseFloat(v[index + 3]) / 10.0).toFixed(1)}`);
1082
+ }
1083
+ return schedule.join(" ");
1084
+ },
1085
+ to: (v) => {
1086
+ const payload = [];
1087
+ const transitions = v.split(" ");
1088
+ if (transitions.length !== 6) {
1089
+ throw new Error("Invalid schedule: there should be 6 transitions");
1090
+ }
1091
+ for (const transition of transitions) {
1092
+ const timeTemp = transition.split("/");
1093
+ if (timeTemp.length !== 2) {
1094
+ throw new Error(`Invalid schedule: wrong transition format: ${transition}`);
1095
+ }
1096
+ const hourMin = timeTemp[0].split(":");
1097
+ const hour = Number.parseInt(hourMin[0], 10);
1098
+ const min = Number.parseInt(hourMin[1], 10);
1099
+ const temperature = Math.floor(Number.parseFloat(timeTemp[1]) * 10);
1100
+ if (hour < 0 || hour > 24 || min < 0 || min > 60 || temperature < 50 || temperature > 300) {
1101
+ throw new Error(`Invalid hour, minute or temperature of: ${transition}`);
1102
+ }
1103
+ const minutesSinceMidnight = hour * 60 + min;
1104
+ const firstByte = ((minutesSinceMidnight & 3840) >> 8) + 192;
1105
+ const secondByte = minutesSinceMidnight & 255;
1106
+ payload.push(firstByte, secondByte, 64, temperature);
1107
+ }
1108
+ return payload;
1109
+ },
1110
+ },
1111
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
1112
+ thermostatScheduleDayMultiDP_TRV602Z_WithDayNumber: (dayNum) => {
1113
+ return {
1114
+ from: (v) => exports.valueConverter.thermostatScheduleDayMultiDP_TRV602Z.from(v),
1115
+ to: (v) => {
1116
+ const data = exports.valueConverter.thermostatScheduleDayMultiDP_TRV602Z.to(v);
1117
+ data.unshift(dayNum);
1118
+ return data;
1119
+ },
1120
+ };
1121
+ },
1122
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
1123
+ thermostatScheduleDayMultiDP_TRV603WZ: {
1124
+ // Custom schedule value converter for TRV603-WZ 8 pair schedule per day
1125
+ // Structure:
1126
+ // [0] metadata (unknown purpose, preserved)
1127
+ // [1] count = number of subsequent bytes (must be even: pairs*2)
1128
+ // [2..] alternating (timeByte, thermByte) pairs.
1129
+ // Encoding rules:
1130
+ // timeByte = hour * 10 + (minute / 10) (minute must be multiple of 10)
1131
+ // thermByte = 2 * temperatureC (temperature in 0.5°C steps)
1132
+ // Decoded textual schedule format:
1133
+ // "HH:MM/TT.T HH:MM/TT.T HH:MM/TT.T HH:MM/TT.T HH:MM/TT.T HH:MM/TT.T HH:MM/TT.T HH:MM/TT.T"
1134
+ from: (v) => {
1135
+ if (!v || v.length < 4)
1136
+ return "";
1137
+ // const meta = v[0]; // (always 7?)
1138
+ const count = v[1];
1139
+ const segments = [];
1140
+ for (let i = 0; i < count; i += 2) {
1141
+ const timeByte = v[2 + i];
1142
+ const thermByte = v[2 + i + 1];
1143
+ const hour = Math.floor(timeByte / 10);
1144
+ const minutes = (timeByte % 10) * 10;
1145
+ const thermC = thermByte / 2;
1146
+ segments.push(`${String(hour).padStart(2, "0")}:${String(minutes).padStart(2, "0")}/${thermC.toFixed(1)}`);
1147
+ }
1148
+ return segments.join(" ");
1149
+ },
1150
+ to: (v) => {
1151
+ const parts = v.split(/\s+/).filter(Boolean);
1152
+ const payload = [];
1153
+ const meta = 7; // keep observed metadata value;
1154
+ payload.push(meta); // index 0
1155
+ payload.push(parts.length * 2); // index 1: count of subsequent bytes
1156
+ for (const segment of parts) {
1157
+ // Segment format: HH:MM/TT.T (e.g. 06:30/21.0 or 17:30/21.5)
1158
+ const match = segment.match(/^(\d{2}):(\d{2})\/(\d{1,2}(?:\.5|\.0)?)$/);
1159
+ if (!match)
1160
+ throw new Error(`Invalid schedule segment "${segment}", expected format "HH:MM/TT.T"`);
1161
+ const hour = Number(match[1]);
1162
+ if (hour < 0 || hour >= 24)
1163
+ throw new Error(`Invalid hour "${hour}" in schedule segment "${segment}", must be 0-23`);
1164
+ const minute = Number(match[2]);
1165
+ if (minute < 0 || minute > 59)
1166
+ throw new Error(`Invalid minute "${minute}" in schedule segment "${segment}", must be 0-59`);
1167
+ const thermC = Number(match[3]);
1168
+ const timeByte = hour * 10 + minute / 10;
1169
+ const thermByte = Math.round(thermC * 2);
1170
+ payload.push(timeByte, thermByte);
1171
+ }
1172
+ return payload;
1173
+ },
1174
+ },
1175
+ thermostatSchedule: {
1176
+ from: (value) => {
1177
+ const buffer = Buffer.from(value, "base64");
1178
+ const schedules = [];
1179
+ const scheduleLength = 12;
1180
+ for (let offset = 0; offset < buffer.length; offset += scheduleLength) {
1181
+ const b = buffer.slice(offset, offset + scheduleLength);
1182
+ // temperature
1183
+ const raw = b.readUInt16BE(3);
1184
+ const temperatureF = (raw - 0x8000) / 10;
1185
+ // time in minutes from midnight
1186
+ const startMinutes = b.readUInt16BE(5);
1187
+ const endMinutes = b.readUInt16BE(7);
1188
+ function minutesToTime(m) {
1189
+ return {
1190
+ hour: Math.floor(m / 60),
1191
+ minute: m % 60,
1192
+ };
1193
+ }
1194
+ const daysMask = b[9];
1195
+ schedules.push({
1196
+ enabled: (b[1] & 0x80) !== 0,
1197
+ work_mode: b[2] === 0x02 ? "cooling" : "heating",
1198
+ temperature_f: temperatureF,
1199
+ start: minutesToTime(startMinutes),
1200
+ end: minutesToTime(endMinutes),
1201
+ week_days: {
1202
+ sunday: !!(daysMask & 0x01),
1203
+ monday: !!(daysMask & 0x02),
1204
+ tuesday: !!(daysMask & 0x04),
1205
+ wednesday: !!(daysMask & 0x08),
1206
+ thursday: !!(daysMask & 0x10),
1207
+ friday: !!(daysMask & 0x20),
1208
+ saturday: !!(daysMask & 0x40),
1209
+ },
1210
+ });
1211
+ }
1212
+ return schedules;
1213
+ },
1214
+ to: (schedules) => {
1215
+ const scheduleLength = 12;
1216
+ const buffers = [];
1217
+ for (const schedule of schedules) {
1218
+ const b = Buffer.alloc(scheduleLength, 0x00);
1219
+ if (schedule.enabled) {
1220
+ b[1] |= 0x80;
1221
+ }
1222
+ b[2] = schedule.work_mode === "cooling" ? 0x02 : 0x00;
1223
+ const temperatureF = schedule.temperature_f;
1224
+ const rawTemperature = Math.round(temperatureF * 10) + 0x8000;
1225
+ b.writeUInt16BE(rawTemperature & 0xffff, 3);
1226
+ const startMinutes = schedule.start.hour * 60 + schedule.start.minute;
1227
+ b.writeUInt16BE(startMinutes, 5);
1228
+ const endMinutes = schedule.end.hour * 60 + schedule.end.minute;
1229
+ b.writeUInt16BE(endMinutes, 7);
1230
+ let daysMask = 0;
1231
+ if (schedule.week_days.sunday)
1232
+ daysMask |= 0x01;
1233
+ if (schedule.week_days.monday)
1234
+ daysMask |= 0x02;
1235
+ if (schedule.week_days.tuesday)
1236
+ daysMask |= 0x04;
1237
+ if (schedule.week_days.wednesday)
1238
+ daysMask |= 0x08;
1239
+ if (schedule.week_days.thursday)
1240
+ daysMask |= 0x10;
1241
+ if (schedule.week_days.friday)
1242
+ daysMask |= 0x20;
1243
+ if (schedule.week_days.saturday)
1244
+ daysMask |= 0x40;
1245
+ b[9] = daysMask;
1246
+ b[10] = 0x02;
1247
+ let sum = 0;
1248
+ for (let i = 0; i <= 9; i++) {
1249
+ sum += b[i];
1250
+ }
1251
+ b[11] = sum & 0xff;
1252
+ buffers.push(b);
1253
+ }
1254
+ return Buffer.concat(buffers).toString("base64");
1255
+ },
1256
+ },
1257
+ tv02Preset: () => {
1258
+ return {
1259
+ from: (v) => {
1260
+ if (v === 0)
1261
+ return "auto";
1262
+ if (v === 1)
1263
+ return "manual";
1264
+ return "holiday"; // 2 and 3 are holiday
1265
+ },
1266
+ to: (v, meta) => {
1267
+ if (v === "auto")
1268
+ return new Enum(0);
1269
+ if (v === "manual")
1270
+ return new Enum(1);
1271
+ if (v === "holiday") {
1272
+ // https://github.com/Koenkk/zigbee2mqtt/issues/20486
1273
+ if (meta.device.manufacturerName === "_TZE200_mudxchsu")
1274
+ return new Enum(2);
1275
+ return new Enum(3);
1276
+ }
1277
+ throw new Error(`Unsupported preset '${v}'`);
1278
+ },
1279
+ };
1280
+ },
1281
+ /** @deprecated left for compatibility, use {@link thermostatSystemModeAndPresetMap} */
1282
+ thermostatSystemModeAndPreset: (toKey) => {
1283
+ return {
1284
+ from: (v) => {
1285
+ utils.assertNumber(v, "system_mode");
1286
+ const presetLookup = { 0: "auto", 1: "manual", 2: "off", 3: "on" };
1287
+ const systemModeLookup = { 0: "auto", 1: "auto", 2: "off", 3: "heat" };
1288
+ return { preset: presetLookup[v], system_mode: systemModeLookup[v] };
1289
+ },
1290
+ to: (v) => {
1291
+ const presetLookup = { auto: new Enum(0), manual: new Enum(1), off: new Enum(2), on: new Enum(3) };
1292
+ const systemModeLookup = { auto: new Enum(1), off: new Enum(2), heat: new Enum(3) };
1293
+ const lookup = toKey === "preset" ? presetLookup : systemModeLookup;
1294
+ return utils.getFromLookup(v, lookup);
1295
+ },
1296
+ };
1297
+ },
1298
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
1299
+ ZWT198_schedule: {
1300
+ from: (value, meta, options) => {
1301
+ const programmingMode = [];
1302
+ for (let i = 0; i < 8; i++) {
1303
+ const start = i * 4;
1304
+ const time = `${value[start].toString().padStart(2, "0")}:${value[start + 1].toString().padStart(2, "0")}`;
1305
+ const temp = (value[start + 2] * 256 + value[start + 3]) / 10;
1306
+ const tempStr = `${temp.toFixed(1)}°C`;
1307
+ programmingMode.push(`${time}/${tempStr}`);
1308
+ }
1309
+ return {
1310
+ schedule_weekday: programmingMode.slice(0, 6).join(" "),
1311
+ schedule_holiday: programmingMode.slice(6, 8).join(" "),
1312
+ };
1313
+ },
1314
+ to: async (v, meta) => {
1315
+ const dpId = 109;
1316
+ const payload = [];
1317
+ let weekdayFormat;
1318
+ let holidayFormat;
1319
+ if (meta.message.schedule_weekday != null) {
1320
+ weekdayFormat = v;
1321
+ holidayFormat = meta.state.schedule_holiday;
1322
+ }
1323
+ else {
1324
+ weekdayFormat = meta.state.schedule_weekday;
1325
+ holidayFormat = v;
1326
+ }
1327
+ function scheduleToRaw(key, input, number, payload, meta) {
1328
+ const items = input.trim().split(/\s+/);
1329
+ if (items.length !== number) {
1330
+ throw new Error(`Wrong number of items for ${key} :${items.length}`);
1331
+ }
1332
+ for (let i = 0; i < number; i++) {
1333
+ const timeTemperature = items[i].split("/");
1334
+ if (timeTemperature.length !== 2) {
1335
+ throw new Error(`Invalid schedule: wrong transition format: ${items[i]}`);
1336
+ }
1337
+ const hourMinute = timeTemperature[0].split(":", 2);
1338
+ const hour = Number.parseInt(hourMinute[0], 10);
1339
+ const minute = Number.parseInt(hourMinute[1], 10);
1340
+ const temperature = Number.parseFloat(timeTemperature[1]);
1341
+ if (!utils.isNumber(hour) ||
1342
+ !utils.isNumber(temperature) ||
1343
+ !utils.isNumber(minute) ||
1344
+ hour < 0 ||
1345
+ hour >= 24 ||
1346
+ minute < 0 ||
1347
+ minute >= 60 ||
1348
+ temperature < 5 ||
1349
+ temperature >= 35) {
1350
+ throw new Error(`Invalid hour, minute or temperature (5<t<35) in ${key} of: \`${items[i]}\`; Format is \`hh:m/cc.c\` or \`hh:mm/cc.c°C\``);
1351
+ }
1352
+ const temperature10 = Math.round(temperature * 10);
1353
+ payload.push(hour, minute, (temperature10 >> 8) & 0xff, temperature10 & 0xff);
1354
+ }
1355
+ return;
1356
+ }
1357
+ scheduleToRaw("schedule_weekday", weekdayFormat, 6, payload, meta);
1358
+ scheduleToRaw("schedule_holiday", holidayFormat, 2, payload, meta);
1359
+ const entity = meta.device.endpoints[0];
1360
+ const sendCommand = utils.getMetaValue(entity, meta.mapped, "tuyaSendCommand", undefined, "dataRequest");
1361
+ await sendDataPointRaw(entity, dpId, Buffer.from(payload), sendCommand, 1);
1362
+ },
1363
+ },
1364
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
1365
+ PO_BOCO_ELEC_schedule: (day) => ({
1366
+ to: (v) => {
1367
+ const payload = [80 + day];
1368
+ const modeMapping = {
1369
+ off: 5,
1370
+ antifrost: 4,
1371
+ eco: 3,
1372
+ "comfort_-2": 2,
1373
+ "comfort_-1": 1,
1374
+ comfort: 0,
1375
+ };
1376
+ const items = v.split(" / ");
1377
+ items.forEach((item) => {
1378
+ if (Object.keys(modeMapping).includes(item)) {
1379
+ payload.push(modeMapping[item]);
1380
+ }
1381
+ else {
1382
+ const time = item.split(":");
1383
+ const hours = Number.parseInt(time[0], 10);
1384
+ const minutes = Math.floor(Number.parseInt(time[1], 10) / 5);
1385
+ const total = hours * 12 + minutes;
1386
+ if (total > 0)
1387
+ payload.push(total);
1388
+ }
1389
+ });
1390
+ return payload;
1391
+ },
1392
+ from: (v) => {
1393
+ const payload = [];
1394
+ const modeMapping = {
1395
+ 5: "off",
1396
+ 4: "antifrost",
1397
+ 3: "eco",
1398
+ 2: "comfort_-2",
1399
+ 1: "comfort_-1",
1400
+ 0: "comfort",
1401
+ };
1402
+ for (let index = 1; index < v.length; index++) {
1403
+ const item = v[index];
1404
+ if (index % 2) {
1405
+ if (item > 5)
1406
+ break;
1407
+ const mode = modeMapping[item];
1408
+ payload.push(mode);
1409
+ }
1410
+ else {
1411
+ const nextItem = v[index + 1];
1412
+ if (nextItem > 5)
1413
+ break;
1414
+ const date = new Date();
1415
+ date.setHours(0, item * 5);
1416
+ const hours = date.getHours().toString().padStart(2, "0");
1417
+ const minutes = date.getMinutes().toString().padStart(2, "0");
1418
+ payload.push(`${hours}:${minutes}`);
1419
+ }
1420
+ }
1421
+ return payload.join(" / ");
1422
+ },
1423
+ }),
1424
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
1425
+ PO_BOCO_ELEC_holiday: {
1426
+ to: (v) => {
1427
+ const payload = [];
1428
+ const regex = /(?<startYear>\d{4})\/(?<startMonth>\d{2})\/(?<startDay>\d{2})\s(?<startHours>\d{2}):(?<startMinutes>\d{2}) \| (?<endYear>\d{4})\/(?<endMonth>\d{2})\/(?<endDay>\d{2})\s(?<endHours>\d{2}):(?<endMinutes>\d{2}) \| (?<mode>off|antifrost|eco|comfort_-2|comfort_-1|comfort)$/g;
1429
+ const regexResult = regex.exec(v);
1430
+ if (!regexResult)
1431
+ throw new Error("Invalid syntax. Should be" +
1432
+ "`startYear/startMonth/startDay startHours:startMinutes | endYear/endMonth/endDay endHours:endMinutes | mode`. " +
1433
+ "For example: `2024/12/12 09:00 | 2024/12/14 10:00 | comfort`");
1434
+ const { startYear, startMonth, startDay, startHours, startMinutes, endYear, endMonth, endDay, endHours, endMin, mode } = regexResult.groups;
1435
+ const startDate = new Date(Number.parseInt(startYear, 10), Number.parseInt(startMonth, 10) - 1, Number.parseInt(startDay, 10), Number.parseInt(startHours, 10), Number.parseInt(startMinutes, 10));
1436
+ const endDate = new Date(Number.parseInt(endYear, 10), Number.parseInt(endMonth, 10) - 1, Number.parseInt(endDay, 10), Number.parseInt(endHours, 10), Number.parseInt(startMinutes, 10));
1437
+ const diffHours = Math.abs(startDate.getTime() - endDate.getTime()) / 36e5;
1438
+ const modeMapping = {
1439
+ off: 5,
1440
+ antifrost: 4,
1441
+ eco: 3,
1442
+ "comfort_-2": 2,
1443
+ "comfort_-1": 1,
1444
+ comfort: 0,
1445
+ };
1446
+ if (endMin)
1447
+ logger_1.logger.warning("The end date minutes will be ignore.", NS);
1448
+ if (diffHours > 255)
1449
+ throw new Error("You cannot set an interval superior at 255 hours.");
1450
+ if (startDate.getTime() > endDate.getTime())
1451
+ throw new Error("You cannot set a negative interval.");
1452
+ payload.push(Number.parseInt(startYear.slice(2), 10), Number.parseInt(startMonth, 10), Number.parseInt(startDay, 10), Number.parseInt(startHours, 10), Number.parseInt(startMinutes, 10), modeMapping[mode], 0, diffHours);
1453
+ return payload;
1454
+ },
1455
+ from: (v) => {
1456
+ const startYear = `2${v[0].toString().padStart(3, "0")}`;
1457
+ const startMonth = v[1].toString().padStart(2, "0");
1458
+ const startDay = v[2].toString().padStart(2, "0");
1459
+ const startHours = v[3].toString().padStart(2, "0");
1460
+ const startMinutes = v[4].toString().padStart(2, "0");
1461
+ const mode = v[5];
1462
+ const diffHours = v[7];
1463
+ const modeMapping = {
1464
+ 5: "off",
1465
+ 4: "antifrost",
1466
+ 3: "eco",
1467
+ 2: "comfort_-2",
1468
+ 1: "comfort_-1",
1469
+ 0: "comfort",
1470
+ };
1471
+ const endDate = new Date(Number.parseInt(startYear, 10), Number.parseInt(startMonth, 10) - 1, Number.parseInt(startDay, 10), Number.parseInt(startHours, 10), Number.parseInt(startMinutes, 10));
1472
+ endDate.setHours(endDate.getHours() + diffHours);
1473
+ const endYear = endDate.getFullYear().toString();
1474
+ const endMonth = (endDate.getMonth() + 1).toString().padStart(2, "0");
1475
+ const endDay = endDate.getDate().toString().padStart(2, "0");
1476
+ const endHours = endDate.getHours().toString().padStart(2, "0");
1477
+ return (`${startYear}/${startMonth}/${startDay} ${startHours}:${startMinutes}` +
1478
+ ` | ${endYear}/${endMonth}/${endDay} ${endHours}:${startMinutes}` +
1479
+ ` | ${modeMapping[mode]}`);
1480
+ },
1481
+ },
1482
+ TV02SystemMode: {
1483
+ to: async (v, meta) => {
1484
+ const entity = meta.device.endpoints[0];
1485
+ if (meta.message.system_mode) {
1486
+ if (meta.message.system_mode === "off") {
1487
+ await sendDataPointBool(entity, 107, true, "dataRequest", 1);
1488
+ }
1489
+ else {
1490
+ await sendDataPointEnum(entity, 2, 1, "dataRequest", 1); // manual
1491
+ }
1492
+ }
1493
+ else if (meta.message.heating_stop) {
1494
+ if (meta.message.heating_stop === "ON") {
1495
+ await sendDataPointBool(entity, 107, true, "dataRequest", 1);
1496
+ }
1497
+ else {
1498
+ await sendDataPointEnum(entity, 2, 1, "dataRequest", 1); // manual
1499
+ }
1500
+ }
1501
+ },
1502
+ from: (v) => {
1503
+ return { system_mode: v === false ? "heat" : "off", heating_stop: v === false ? "OFF" : "ON" };
1504
+ },
1505
+ },
1506
+ TV02FrostProtection: {
1507
+ to: async (v, meta) => {
1508
+ const entity = meta.device.endpoints[0];
1509
+ if (v === "ON") {
1510
+ await sendDataPointBool(entity, 10, true, "dataRequest", 1);
1511
+ }
1512
+ else {
1513
+ await sendDataPointEnum(entity, 2, 1, "dataRequest", 1); // manual
1514
+ }
1515
+ },
1516
+ from: (v) => {
1517
+ return { frost_protection: v === false ? "OFF" : "ON" };
1518
+ },
1519
+ },
1520
+ inverse: { to: (v) => !v, from: (v) => !v },
1521
+ onOffNotStrict: { from: (v) => (v ? "ON" : "OFF"), to: (v) => v === "ON" },
1522
+ errorOrBatteryLow: {
1523
+ from: (v) => {
1524
+ if (v === 0)
1525
+ return { battery_low: false };
1526
+ if (v === 1)
1527
+ return { battery_low: true };
1528
+ return { error: v };
1529
+ },
1530
+ },
1531
+ // https://developer.tuya.com/en/docs/connect-subdevices-to-gateways/tuya-zigbee-multiple-switch-access-standard?id=K9ik6zvnqr09m
1532
+ inchingSwitch: {
1533
+ to: (value) => {
1534
+ let result = "";
1535
+ for (let i = 1; i <= 6; i++) {
1536
+ if (value[`inching_control_${i}`] === undefined || value[`inching_time_${i}`] === undefined)
1537
+ continue;
1538
+ let state = value[`inching_control_${i}`] === "ENABLE" ? 1 : 0;
1539
+ if (i !== 1) {
1540
+ // Second endpoint onwards base number is determined by 2 powered by endpoint number less 1
1541
+ state += 2 ** (i - 1);
1542
+ }
1543
+ const secs = Number.parseInt(value[`inching_time_${i}`], 10);
1544
+ const byte1 = secs >> 8; // Equivalent to Math.truc(secs / 256)
1545
+ const byte2 = secs % 256;
1546
+ const ascii = String.fromCharCode(state, byte1, byte2);
1547
+ result += Buffer.from(ascii).toString("base64");
1548
+ }
1549
+ return result;
1550
+ },
1551
+ from: (value) => {
1552
+ // break the value into 4 char encoded char which will give 3 char when decoded
1553
+ const data = {};
1554
+ for (let i = 0; i < value.length; i += 4) {
1555
+ const b64asc = value.substring(i, i + 4);
1556
+ const str = Buffer.from(b64asc, "base64").toString("utf8");
1557
+ const cca0 = str.charCodeAt(0);
1558
+ const cca1 = str.charCodeAt(1);
1559
+ const cca2 = str.charCodeAt(2);
1560
+ let tmp = 0;
1561
+ let status = "";
1562
+ // first value indicates the endpoint and if it is on or off
1563
+ // 0-1 - 1st endpoint, 2-3 - 2nd endpoint, ...
1564
+ switch (cca0) {
1565
+ case 0:
1566
+ data.inching_control_1 = "DISABLE";
1567
+ data.inching_time_1 = (cca1 << 8) + cca2;
1568
+ break;
1569
+ case 1:
1570
+ data.inching_control_1 = "ENABLE";
1571
+ data.inching_time_1 = (cca1 << 8) + cca2;
1572
+ break;
1573
+ default:
1574
+ // endpoint #
1575
+ tmp = Math.trunc(Math.log2(cca0)) + 1;
1576
+ status = cca0 % 2 ? "ENABLE" : "DISABLE";
1577
+ data[`inching_control_${tmp}`] = status;
1578
+ data[`inching_time_${tmp}`] = (cca1 << 8) + cca2;
1579
+ }
1580
+ }
1581
+ return data;
1582
+ },
1583
+ },
1584
+ /** @param toMap the key is 'system_mode' or 'preset' related value */
1585
+ thermostatSystemModeAndPresetMap: ({ fromMap = {}, toMap = {}, }) => {
1586
+ return {
1587
+ from: (v) => {
1588
+ utils.assertNumber(v, "system_mode");
1589
+ return { running_mode: fromMap[v].deviceMode, system_mode: fromMap[v].systemMode, preset: fromMap[v].preset };
1590
+ },
1591
+ to: (v) => {
1592
+ return utils.getFromLookup(v, toMap);
1593
+ },
1594
+ };
1595
+ },
1596
+ utf16BEHexString: {
1597
+ // String -> hex (UTF-16BE)
1598
+ to: (v) => {
1599
+ const s = v.trim();
1600
+ return Buffer.from(s, "utf16le").swap16().toString("hex");
1601
+ },
1602
+ // hex (UTF-16BE) -> String
1603
+ from: (hex) => {
1604
+ if (!hex)
1605
+ return "";
1606
+ const s = hex.trim();
1607
+ if ((s.length & 1) !== 0)
1608
+ return "";
1609
+ return Buffer.from(s, "hex").swap16().toString("utf16le").trim();
1610
+ },
1611
+ },
1612
+ };
1613
+ const tuyaTz = {
1614
+ power_on_behavior_1: {
1615
+ key: ["power_on_behavior", "power_outage_memory"],
1616
+ convertSet: async (entity, key, value, meta) => {
1617
+ // Deprecated: remove power_outage_memory
1618
+ const moesStartUpOnOff = utils.getFromLookup(value, key === "power_on_behavior" ? { off: 0, on: 1, previous: 2 } : { off: 0, on: 1, restore: 2 });
1619
+ await entity.write("genOnOff", { moesStartUpOnOff });
1620
+ return { state: { [key]: value } };
1621
+ },
1622
+ convertGet: async (entity, key, meta) => {
1623
+ await entity.read("genOnOff", ["moesStartUpOnOff"]);
1624
+ },
1625
+ },
1626
+ power_on_behavior_2: {
1627
+ key: ["power_on_behavior"],
1628
+ convertSet: async (entity, key, value, meta) => {
1629
+ const powerOnBehavior = utils.getFromLookup(value, { off: 0, on: 1, previous: 2 });
1630
+ await entity.write("manuSpecificTuya3", { powerOnBehavior });
1631
+ return { state: { [key]: value } };
1632
+ },
1633
+ convertGet: async (entity, key, meta) => {
1634
+ await entity.read("manuSpecificTuya3", ["powerOnBehavior"]);
1635
+ },
1636
+ },
1637
+ switch_type: {
1638
+ key: ["switch_type"],
1639
+ convertSet: async (entity, key, value, meta) => {
1640
+ const switchType = utils.getFromLookup(value, { toggle: 0, state: 1, momentary: 2 });
1641
+ await entity.write("manuSpecificTuya3", { switchType }, { disableDefaultResponse: true });
1642
+ return { state: { [key]: value } };
1643
+ },
1644
+ convertGet: async (entity, key, meta) => {
1645
+ await entity.read("manuSpecificTuya3", ["switchType"]);
1646
+ },
1647
+ },
1648
+ switch_type_curtain: {
1649
+ key: ["switch_type_curtain"],
1650
+ convertSet: async (entity, key, value, meta) => {
1651
+ const switchType = utils.getFromLookup(value, { "flip-switch": 0, "sync-switch": 1, "button-switch": 2, "button2-switch": 3 });
1652
+ await entity.write("manuSpecificTuya3", { switchType }, { disableDefaultResponse: true });
1653
+ return { state: { [key]: value } };
1654
+ },
1655
+ convertGet: async (entity, key, meta) => {
1656
+ await entity.read("manuSpecificTuya3", ["switchType"]);
1657
+ },
1658
+ },
1659
+ switch_type_button: {
1660
+ key: ["switch_type_button"],
1661
+ convertSet: async (entity, key, value, meta) => {
1662
+ const switchType = utils.getFromLookup(value, { release: 0, press: 1 });
1663
+ await entity.write("manuSpecificTuya3", { switchType }, { disableDefaultResponse: true });
1664
+ return { state: { [key]: value } };
1665
+ },
1666
+ convertGet: async (entity, key, meta) => {
1667
+ await entity.read("manuSpecificTuya3", ["switchType"]);
1668
+ },
1669
+ },
1670
+ backlight_indicator_mode_1: {
1671
+ key: ["backlight_mode", "indicator_mode"],
1672
+ convertSet: async (entity, key, value, meta) => {
1673
+ const tuyaBacklightMode = utils.getFromLookup(value, key === "backlight_mode" ? { low: 0, medium: 1, high: 2, off: 0, normal: 1, inverted: 2 } : { off: 0, "off/on": 1, "on/off": 2, on: 3 });
1674
+ await entity.write("genOnOff", { tuyaBacklightMode });
1675
+ return { state: { [key]: value } };
1676
+ },
1677
+ convertGet: async (entity, key, meta) => {
1678
+ await entity.read("genOnOff", ["tuyaBacklightMode"]);
1679
+ },
1680
+ },
1681
+ backlight_indicator_mode_2: {
1682
+ key: ["backlight_mode"],
1683
+ convertSet: async (entity, key, value, meta) => {
1684
+ const tuyaBacklightSwitch = utils.getFromLookup(value, { off: 0, on: 1 });
1685
+ await entity.write("genOnOff", { tuyaBacklightSwitch });
1686
+ return { state: { [key]: value } };
1687
+ },
1688
+ convertGet: async (entity, key, meta) => {
1689
+ await entity.read("genOnOff", ["tuyaBacklightSwitch"]);
1690
+ },
1691
+ },
1692
+ backlight_indicator_mode_none_relay_pos: {
1693
+ // In this mode, backlight and indicator are saperately controlled so we need two keys.
1694
+ // We use "tuyaBacklightSwitch" for backlight's on/off control and "tuyaBacklightMode" for indicator's none/relay/pos control.
1695
+ key: ["backlight_mode", "indicator_mode"],
1696
+ convertSet: async (entity, key, value, meta) => {
1697
+ const lookup = key === "backlight_mode" ? { off: 0, on: 1 } : { none: 0, relay: 1, pos: 2 };
1698
+ const result = utils.getFromLookup(value, lookup);
1699
+ if (key === "backlight_mode") {
1700
+ await entity.write("genOnOff", { tuyaBacklightSwitch: result });
1701
+ }
1702
+ else {
1703
+ await entity.write("genOnOff", { tuyaBacklightMode: result });
1704
+ }
1705
+ return { state: { [key]: value } };
1706
+ },
1707
+ convertGet: async (entity, key, meta) => {
1708
+ const attribute = key === "backlight_mode" ? "tuyaBacklightSwitch" : "tuyaBacklightMode";
1709
+ await entity.read("genOnOff", [attribute]);
1710
+ },
1711
+ },
1712
+ child_lock: {
1713
+ key: ["child_lock"],
1714
+ convertSet: async (entity, key, value, meta) => {
1715
+ const v = utils.getFromLookup(value, { lock: true, unlock: false });
1716
+ await entity.write("genOnOff", { 32768: { value: v, type: 0x10 } });
1717
+ },
1718
+ },
1719
+ min_brightness_attribute: {
1720
+ key: ["min_brightness"],
1721
+ convertSet: async (entity, key, value, meta) => {
1722
+ const number = utils.toNumber(value, "min_brightness");
1723
+ const minValueHex = number.toString(16);
1724
+ const maxValueHex = "ff";
1725
+ const minMaxValue = Number.parseInt(`${minValueHex}${maxValueHex}`, 16);
1726
+ const payload = { 64512: { value: minMaxValue, type: 0x21 } };
1727
+ await entity.write("genLevelCtrl", payload, { disableDefaultResponse: true });
1728
+ return { state: { min_brightness: number } };
1729
+ },
1730
+ convertGet: async (entity, key, meta) => {
1731
+ await entity.read("genLevelCtrl", [0xfc00]);
1732
+ },
1733
+ },
1734
+ min_brightness_command: {
1735
+ key: ["min_brightness"],
1736
+ convertSet: async (entity, key, value, meta) => {
1737
+ utils.assertNumber(value, key);
1738
+ const payload = { minimum: value };
1739
+ await entity.command("lightingColorCtrl", "tuyaSetMinimumBrightness", payload);
1740
+ return { state: { min_brightness: value } };
1741
+ },
1742
+ // The response contains the value but as the data type, randomly
1743
+ // causing malformed messages
1744
+ // convertGet: async (entity, key, meta) => {
1745
+ // await entity.read('lightingColorCtrl', [0xf102]);
1746
+ // },
1747
+ },
1748
+ color_power_on_behavior: {
1749
+ key: ["color_power_on_behavior"],
1750
+ convertSet: async (entity, key, value, meta) => {
1751
+ const v = utils.getFromLookup(value, { initial: 0, previous: 1, customized: 2 });
1752
+ await entity.command("lightingColorCtrl", "tuyaOnStartUp", { mode: v * 256, data: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0] });
1753
+ return { state: { color_power_on_behavior: value } };
1754
+ },
1755
+ },
1756
+ datapoints: {
1757
+ convertSet: async (entity, key, value, meta) => {
1758
+ // A set converter is only called once; therefore we need to loop
1759
+ const state = {};
1760
+ if (Array.isArray(meta.mapped))
1761
+ throw new Error("Not supported for groups");
1762
+ const datapoints = meta.mapped.meta?.tuyaDatapoints;
1763
+ if (!datapoints)
1764
+ throw new Error("No datapoints map defined");
1765
+ for (const [attr, value] of Object.entries(meta.message)) {
1766
+ const convertedKey = meta.mapped.meta.multiEndpoint && meta.endpoint_name && !attr.startsWith(`${key}_`) ? `${attr}_${meta.endpoint_name}` : attr;
1767
+ const dpEntry = datapoints.find((d) => d[1] === convertedKey);
1768
+ if (!dpEntry?.[1] || !dpEntry?.[2].to) {
1769
+ throw new Error(`No datapoint defined for '${attr}'`);
1770
+ }
1771
+ if (dpEntry[3]?.skip?.(meta))
1772
+ continue;
1773
+ const dpId = dpEntry[0];
1774
+ const convertedValue = await dpEntry[2].to(value, meta);
1775
+ const sendCommand = utils.getMetaValue(entity, meta.mapped, "tuyaSendCommand", undefined, "dataRequest");
1776
+ if (convertedValue === undefined) {
1777
+ // conversion done inside converter, ignore.
1778
+ }
1779
+ else if (typeof convertedValue === "boolean") {
1780
+ await sendDataPointBool(entity, dpId, convertedValue, sendCommand, 1);
1781
+ }
1782
+ else if (typeof convertedValue === "number") {
1783
+ await sendDataPointValue(entity, dpId, convertedValue, sendCommand, 1);
1784
+ }
1785
+ else if (typeof convertedValue === "string") {
1786
+ await sendDataPointStringBuffer(entity, dpId, convertedValue, sendCommand, 1);
1787
+ }
1788
+ else if (Array.isArray(convertedValue)) {
1789
+ await sendDataPointRaw(entity, dpId, Buffer.from(convertedValue), sendCommand, 1);
1790
+ }
1791
+ else if (convertedValue instanceof Enum) {
1792
+ await sendDataPointEnum(entity, dpId, convertedValue.valueOf(), sendCommand, 1);
1793
+ }
1794
+ else if (convertedValue instanceof Bitmap) {
1795
+ await sendDataPointBitmap(entity, dpId, convertedValue.valueOf(), sendCommand, 1);
1796
+ }
1797
+ else {
1798
+ throw new Error(`Don't know how to send type '${typeof convertedValue}'`);
1799
+ }
1800
+ if (dpEntry[3] && dpEntry[3].optimistic === false)
1801
+ continue;
1802
+ state[attr] = value;
1803
+ }
1804
+ return { state };
1805
+ },
1806
+ },
1807
+ do_not_disturb: {
1808
+ key: ["do_not_disturb"],
1809
+ convertSet: async (entity, key, value, meta) => {
1810
+ await entity.command("lightingColorCtrl", "tuyaDoNotDisturb", { enable: value ? 1 : 0 });
1811
+ return { state: { do_not_disturb: value } };
1812
+ },
1813
+ },
1814
+ on_off_countdown: {
1815
+ // Note: This is the Tuya on-off countdown feature documented for switches and smart plugs
1816
+ // using the Zigbee 'onWithTimedOff' command in a non-standard way.
1817
+ // There is also an alternative on-off countdown implementation mostly for for Tuya Lighting
1818
+ // products that uses private commands and attributes. However, those devices should also
1819
+ // provide datapoints so there is little reason to provide support.
1820
+ key: ["state", "countdown"],
1821
+ convertSet: async (entity, key, value, meta) => {
1822
+ const state = meta.message.state != null ? (utils.isString(meta.message.state) ? meta.message.state.toLowerCase() : undefined) : undefined;
1823
+ const countdown = meta.message.countdown != null ? meta.message.countdown : undefined;
1824
+ const result = {};
1825
+ if (countdown !== undefined) {
1826
+ // OnTime is a 16bit register and so might very well work up to 0xFFFF seconds but
1827
+ // the Tuya documentation says that the maximum is 43200 (so 12 hours).
1828
+ if (!Number.isInteger(countdown) || countdown < 0 || countdown > 12 * 3600) {
1829
+ throw new Error("countdown must be an integer between 1 and 43200 (12 hours) or 0 to cancel");
1830
+ }
1831
+ }
1832
+ // The order of the commands matters because 'on/off/toggle' cancels 'onWithTimedOff'.
1833
+ if (state !== undefined) {
1834
+ utils.validateValue(state, ["toggle", "off", "on"]);
1835
+ await entity.command("genOnOff", state, {}, utils.getOptions(meta.mapped, entity));
1836
+ if (state === "toggle") {
1837
+ const currentState = meta.state[`state${meta.endpoint_name ? `_${meta.endpoint_name}` : ""}`];
1838
+ if (currentState) {
1839
+ result.state = currentState === "OFF" ? "ON" : "OFF";
1840
+ }
1841
+ }
1842
+ else {
1843
+ result.state = state.toUpperCase();
1844
+ }
1845
+ // A side effect of setting the state is to cancel any running coundown.
1846
+ result.countdown = 0;
1847
+ }
1848
+ if (countdown !== undefined) {
1849
+ // offwaittime is probably not used but according to the Tuya documentation, it should
1850
+ // be set to the same value than ontime.
1851
+ await entity.command("genOnOff", "onWithTimedOff", { ctrlbits: 0, ontime: countdown, offwaittime: countdown }, utils.getOptions(meta.mapped, entity));
1852
+ if (result.state !== undefined) {
1853
+ result.countdown = countdown;
1854
+ }
1855
+ }
1856
+ return { state: result };
1857
+ },
1858
+ convertGet: async (entity, key, meta) => {
1859
+ if (key === "state") {
1860
+ await entity.read("genOnOff", ["onOff"]);
1861
+ }
1862
+ else if (key === "countdown") {
1863
+ await entity.read("genOnOff", ["onTime"]);
1864
+ }
1865
+ },
1866
+ },
1867
+ inchingSwitch: {
1868
+ key: ["inching_control_set"],
1869
+ convertSet: async (entity, key, value, meta) => {
1870
+ const endpoint = meta.device.getEndpoint(1);
1871
+ await endpoint.command("manuSpecificTuya4", "setInchingSwitch",
1872
+ // TODO: correct? seems it would take the `!(values instanceof Buffer)` codepath of ZH before
1873
+ { payload: Buffer.from(exports.valueConverter.inchingSwitch.to(value)) }, utils.getOptions(meta.mapped, endpoint));
1874
+ return { state: { inching_control_set: value } };
1875
+ },
1876
+ },
1877
+ };
1878
+ exports.tz = tuyaTz;
1879
+ const tuyaFz = {
1880
+ brightness: {
1881
+ cluster: "genLevelCtrl",
1882
+ type: ["attributeReport", "readResponse"],
1883
+ convert: (model, msg, publish, options, meta) => {
1884
+ if (msg.data["61440"] !== undefined) {
1885
+ const property = utils.postfixWithEndpointName("brightness", msg, model, meta);
1886
+ return { [property]: utils.mapNumberRange(msg.data["61440"], 0, 1000, 0, 255) };
1887
+ }
1888
+ },
1889
+ },
1890
+ power_on_behavior_1: {
1891
+ cluster: "genOnOff",
1892
+ type: ["attributeReport", "readResponse"],
1893
+ convert: (model, msg, publish, options, meta) => {
1894
+ if (msg.data.moesStartUpOnOff !== undefined) {
1895
+ const lookup = { 0: "off", 1: "on", 2: "previous" };
1896
+ const property = utils.postfixWithEndpointName("power_on_behavior", msg, model, meta);
1897
+ return { [property]: lookup[msg.data.moesStartUpOnOff] };
1898
+ }
1899
+ },
1900
+ },
1901
+ power_on_behavior_2: {
1902
+ cluster: "manuSpecificTuya3",
1903
+ type: ["attributeReport", "readResponse"],
1904
+ convert: (model, msg, publish, options, meta) => {
1905
+ const attribute = "powerOnBehavior";
1906
+ const lookup = { 0: "off", 1: "on", 2: "previous" };
1907
+ if (msg.data[attribute] !== undefined) {
1908
+ const property = utils.postfixWithEndpointName("power_on_behavior", msg, model, meta);
1909
+ return { [property]: lookup[msg.data[attribute]] };
1910
+ }
1911
+ },
1912
+ },
1913
+ power_outage_memory: {
1914
+ cluster: "genOnOff",
1915
+ type: ["attributeReport", "readResponse"],
1916
+ convert: (model, msg, publish, options, meta) => {
1917
+ if (msg.data.moesStartUpOnOff !== undefined) {
1918
+ const lookup = { 0: "off", 1: "on", 2: "restore" };
1919
+ const property = utils.postfixWithEndpointName("power_outage_memory", msg, model, meta);
1920
+ return { [property]: lookup[msg.data.moesStartUpOnOff] };
1921
+ }
1922
+ },
1923
+ },
1924
+ switch_type: {
1925
+ cluster: "manuSpecificTuya3",
1926
+ type: ["attributeReport", "readResponse"],
1927
+ convert: (model, msg, publish, options, meta) => {
1928
+ if (msg.data.switchType !== undefined) {
1929
+ const lookup = { 0: "toggle", 1: "state", 2: "momentary" };
1930
+ utils.assertNumber(msg.data.switchType);
1931
+ return { switch_type: lookup[msg.data.switchType] };
1932
+ }
1933
+ },
1934
+ },
1935
+ switch_type_curtain: {
1936
+ cluster: "manuSpecificTuya3",
1937
+ type: ["attributeReport", "readResponse"],
1938
+ convert: (model, msg, publish, options, meta) => {
1939
+ if (msg.data.switchType !== undefined) {
1940
+ const lookup = { 0: "flip-switch", 1: "sync-switch", 2: "button-switch", 3: "button2-switch" };
1941
+ utils.assertNumber(msg.data.switchType);
1942
+ return { switch_type_curtain: lookup[msg.data.switchType] };
1943
+ }
1944
+ },
1945
+ },
1946
+ switch_type_button: {
1947
+ cluster: "manuSpecificTuya3",
1948
+ type: ["attributeReport", "readResponse"],
1949
+ convert: (model, msg, publish, options, meta) => {
1950
+ if (msg.data.switchType !== undefined) {
1951
+ const lookup = { 0: "release", 1: "press" };
1952
+ utils.assertNumber(msg.data.switchType);
1953
+ return { switch_type_button: lookup[msg.data.switchType] };
1954
+ }
1955
+ },
1956
+ },
1957
+ backlight_mode_low_medium_high: {
1958
+ cluster: "genOnOff",
1959
+ type: ["attributeReport", "readResponse"],
1960
+ convert: (model, msg, publish, options, meta) => {
1961
+ if (msg.data.tuyaBacklightMode !== undefined) {
1962
+ const value = msg.data.tuyaBacklightMode;
1963
+ const backlightLookup = { 0: "low", 1: "medium", 2: "high" };
1964
+ return { backlight_mode: backlightLookup[value] };
1965
+ }
1966
+ },
1967
+ },
1968
+ backlight_mode_off_normal_inverted: {
1969
+ cluster: "genOnOff",
1970
+ type: ["attributeReport", "readResponse"],
1971
+ convert: (model, msg, publish, options, meta) => {
1972
+ if (msg.data.tuyaBacklightMode !== undefined) {
1973
+ return { backlight_mode: utils.getFromLookup(msg.data.tuyaBacklightMode, { 0: "off", 1: "normal", 2: "inverted" }) };
1974
+ }
1975
+ },
1976
+ },
1977
+ backlight_mode_off_on: {
1978
+ cluster: "genOnOff",
1979
+ type: ["attributeReport", "readResponse"],
1980
+ convert: (model, msg, publish, options, meta) => {
1981
+ if (msg.data.tuyaBacklightSwitch !== undefined) {
1982
+ return { backlight_mode: utils.getFromLookup(msg.data.tuyaBacklightSwitch, { 0: "OFF", 1: "ON" }) };
1983
+ }
1984
+ },
1985
+ },
1986
+ indicator_mode: {
1987
+ cluster: "genOnOff",
1988
+ type: ["attributeReport", "readResponse"],
1989
+ convert: (model, msg, publish, options, meta) => {
1990
+ if (msg.data.tuyaBacklightMode !== undefined) {
1991
+ return { indicator_mode: utils.getFromLookup(msg.data.tuyaBacklightMode, { 0: "off", 1: "off/on", 2: "on/off", 3: "on" }) };
1992
+ }
1993
+ },
1994
+ },
1995
+ indicator_mode_none_relay_pos: {
1996
+ cluster: "genOnOff",
1997
+ type: ["attributeReport", "readResponse"],
1998
+ convert: (model, msg, publish, options, meta) => {
1999
+ if (msg.data.tuyaBacklightMode !== undefined) {
2000
+ return { indicator_mode: utils.getFromLookup(msg.data.tuyaBacklightMode, { 0: "none", 1: "relay", 2: "pos" }) };
2001
+ }
2002
+ },
2003
+ },
2004
+ child_lock: {
2005
+ cluster: "genOnOff",
2006
+ type: ["attributeReport", "readResponse"],
2007
+ convert: (model, msg, publish, options, meta) => {
2008
+ if (msg.data["32768"] !== undefined) {
2009
+ const value = msg.data["32768"];
2010
+ return { child_lock: value ? "LOCK" : "UNLOCK" };
2011
+ }
2012
+ },
2013
+ },
2014
+ min_brightness_attribute: {
2015
+ cluster: "genLevelCtrl",
2016
+ type: ["attributeReport", "readResponse"],
2017
+ convert: (model, msg, publish, options, meta) => {
2018
+ if (msg.data[0xfc00] !== undefined) {
2019
+ const property = utils.postfixWithEndpointName("min_brightness", msg, model, meta);
2020
+ const value = Number.parseInt(msg.data[0xfc00].toString(16).slice(0, 2), 16);
2021
+ return { [property]: value };
2022
+ }
2023
+ },
2024
+ },
2025
+ datapoints: {
2026
+ cluster: "manuSpecificTuya",
2027
+ type: ["commandDataResponse", "commandDataReport", "commandActiveStatusReport", "commandActiveStatusReportAlt"],
2028
+ convert: (model, msg, publish, options, meta) => {
2029
+ if (utils.hasAlreadyProcessedMessage(msg, model))
2030
+ return;
2031
+ const result = {};
2032
+ if (!model.meta || !model.meta.tuyaDatapoints)
2033
+ throw new Error("No datapoints map defined");
2034
+ const datapoints = model.meta.tuyaDatapoints;
2035
+ for (const dpValue of msg.data.dpValues) {
2036
+ const dpId = dpValue.dp;
2037
+ const dpEntry = datapoints.find((d) => d[0] === dpId);
2038
+ const value = getDataValue(dpValue);
2039
+ if (dpEntry?.[2]?.from) {
2040
+ if (dpEntry[1]) {
2041
+ result[dpEntry[1]] = dpEntry[2].from(value, meta, options, publish, msg);
2042
+ }
2043
+ else {
2044
+ Object.assign(result, dpEntry[2].from(value, meta, options, publish, msg));
2045
+ }
2046
+ }
2047
+ else {
2048
+ logger_1.logger.debug(`Datapoint ${dpId} not defined for '${meta.device.manufacturerName}' with value ${value}`, NS);
2049
+ }
2050
+ }
2051
+ return result;
2052
+ },
2053
+ },
2054
+ on_off_action: {
2055
+ cluster: "genOnOff",
2056
+ type: "commandTuyaAction",
2057
+ convert: (model, msg, publish, options, meta) => {
2058
+ if (utils.hasAlreadyProcessedMessage(msg, model, msg.data[0]))
2059
+ return;
2060
+ const clickMapping = { 0: "single", 1: "double", 2: "hold" };
2061
+ const buttonMapping = { 1: "1", 2: "2", 3: "3", 4: "4", 5: "5", 6: "6", 7: "7", 8: "8" };
2062
+ // TS004F has single endpoint, TS0041A/TS0041 can have multiple but have just one button
2063
+ const button = msg.device.endpoints.length === 1 || ["TS0041A", "TS0041"].includes(msg.device.modelID) ? "" : `${buttonMapping[msg.endpoint.ID]}_`;
2064
+ return { action: `${button}${clickMapping[msg.data.value]}` };
2065
+ },
2066
+ },
2067
+ on_off_countdown: {
2068
+ // While a countdown is in progress, the device will report onTime at all multiples of 60.
2069
+ // More reportings can be configured for 'onTime` but they will happen independently of
2070
+ // the builtin 60s reporting.
2071
+ cluster: "genOnOff",
2072
+ type: ["attributeReport", "readResponse"],
2073
+ convert: (model, msg, publish, options, meta) => {
2074
+ if (msg.data.onTime !== undefined) {
2075
+ const payload = {};
2076
+ const property = utils.postfixWithEndpointName("countdown", msg, model, meta);
2077
+ const countdown = msg.data.onTime;
2078
+ payload[property] = countdown;
2079
+ return payload;
2080
+ }
2081
+ },
2082
+ },
2083
+ inchingSwitch: {
2084
+ cluster: "manuSpecificTuya4",
2085
+ type: ["attributeReport", "readResponse"],
2086
+ convert: (model, msg, publish, options, meta) => {
2087
+ if (msg.data.inching !== undefined) {
2088
+ const payload = {};
2089
+ const value = exports.valueConverter.inchingSwitch.from(msg.data.inching);
2090
+ payload.inching_control_set = value;
2091
+ return payload;
2092
+ }
2093
+ },
2094
+ },
2095
+ // biome-ignore lint/style/useNamingConvention: ignored using `--suppress`
2096
+ TS011F_electrical_measurement: {
2097
+ ...fz.electrical_measurement,
2098
+ convert: (model, msg, publish, options, meta) => {
2099
+ const result = fz.electrical_measurement.convert(model, msg, publish, options, meta) ?? {};
2100
+ const lookup = {
2101
+ power: "activePower",
2102
+ current: "rmsCurrent",
2103
+ voltage: "rmsVoltage",
2104
+ };
2105
+ // Wait 5 seconds before reporting a 0 value as this could be an invalid measurement.
2106
+ // https://github.com/Koenkk/zigbee2mqtt/issues/16709#issuecomment-1509599046
2107
+ if (result) {
2108
+ for (const key of ["power", "current", "voltage"]) {
2109
+ if (key in result) {
2110
+ const value = result[key];
2111
+ clearTimeout(globalStore.getValue(msg.endpoint, key));
2112
+ if (value === 0) {
2113
+ const configuredReporting = msg.endpoint.configuredReportings.find((c) => c.cluster.name === "haElectricalMeasurement" && c.attribute.name === lookup[key]);
2114
+ const time = (configuredReporting ? configuredReporting.minimumReportInterval : 5) * 2 + 1;
2115
+ globalStore.putValue(msg.endpoint, key, setTimeout(() => {
2116
+ const payload = { [key]: value };
2117
+ // Device takes a lot of time to report power 0 in some cases. When current == 0 we can assume power == 0
2118
+ // https://github.com/Koenkk/zigbee2mqtt/discussions/19680#discussioncomment-7868445
2119
+ if (key === "current") {
2120
+ payload.power = 0;
2121
+ }
2122
+ publish(payload);
2123
+ }, time * 1000));
2124
+ delete result[key];
2125
+ }
2126
+ }
2127
+ }
2128
+ }
2129
+ // Device takes a lot of time to report power 0 in some cases. When the state is OFF we can assume power == 0
2130
+ // https://github.com/Koenkk/zigbee2mqtt/discussions/19680#discussioncomment-7868445
2131
+ if (meta.state.state === "OFF") {
2132
+ result.power = 0;
2133
+ }
2134
+ return result;
2135
+ },
2136
+ },
2137
+ };
2138
+ exports.fz = tuyaFz;
2139
+ function getHandlersForDP(name, dp, type, converter, readOnly, skip, endpoint, useGlobalSequence) {
2140
+ const keyName = endpoint ? `${name}_${endpoint}` : name;
2141
+ const fromZigbee = [
2142
+ {
2143
+ cluster: "manuSpecificTuya",
2144
+ type: ["commandDataResponse", "commandDataReport", "commandActiveStatusReport", "commandActiveStatusReportAlt"],
2145
+ convert: (model, msg, publish, options, meta) => {
2146
+ const dpValue = msg.data.dpValues.find((d) => d.dp === dp);
2147
+ if (dpValue) {
2148
+ return { [keyName]: converter.from(getDataValue(dpValue)) };
2149
+ }
2150
+ },
2151
+ },
2152
+ ];
2153
+ const toZigbee = readOnly
2154
+ ? undefined
2155
+ : [
2156
+ {
2157
+ key: [name],
2158
+ endpoints: endpoint ? [endpoint] : undefined,
2159
+ convertSet: async (entity, key, value, meta) => {
2160
+ // A set converter is only called once; therefore we need to loop
2161
+ const state = {};
2162
+ if (Array.isArray(meta.mapped))
2163
+ throw new Error("Not supported for groups");
2164
+ for (const [attr, value] of Object.entries(meta.message)) {
2165
+ const convertedKey = meta.mapped.meta?.multiEndpoint && meta.endpoint_name && !attr.startsWith(`${key}_`)
2166
+ ? `${attr}_${meta.endpoint_name}`
2167
+ : attr;
2168
+ // logger.debug(`key: ${key}, convertedKey: ${convertedKey}, keyName: ${keyName}`);
2169
+ if (convertedKey !== keyName)
2170
+ continue;
2171
+ if (skip?.(meta))
2172
+ continue;
2173
+ const convertedValue = await converter.to(value, meta);
2174
+ const sendCommand = utils.getMetaValue(entity, meta.mapped, "tuyaSendCommand", undefined, "dataRequest");
2175
+ const seq = useGlobalSequence ? undefined : 1;
2176
+ // logger.debug(`dp: ${dp}, value: ${value}, convertedValue: ${convertedValue}`);
2177
+ if (convertedValue === undefined) {
2178
+ // conversion done inside converter, ignore.
2179
+ }
2180
+ else if (type === exports.dataTypes.bool) {
2181
+ await sendDataPointBool(entity, dp, convertedValue, sendCommand, seq);
2182
+ }
2183
+ else if (type === exports.dataTypes.number) {
2184
+ await sendDataPointValue(entity, dp, convertedValue, sendCommand, seq);
2185
+ }
2186
+ else if (type === exports.dataTypes.string) {
2187
+ await sendDataPointStringBuffer(entity, dp, convertedValue, sendCommand, seq);
2188
+ }
2189
+ else if (type === exports.dataTypes.raw) {
2190
+ await sendDataPointRaw(entity, dp, Buffer.from(convertedValue), sendCommand, seq);
2191
+ }
2192
+ else if (type === exports.dataTypes.enum) {
2193
+ await sendDataPointEnum(entity, dp, convertedValue, sendCommand, seq);
2194
+ }
2195
+ else if (type === exports.dataTypes.bitmap) {
2196
+ await sendDataPointBitmap(entity, dp, convertedValue, sendCommand, seq);
2197
+ }
2198
+ else {
2199
+ throw new Error(`Don't know how to send type '${typeof convertedValue}'`);
2200
+ }
2201
+ state[key] = value;
2202
+ }
2203
+ return { state };
2204
+ },
2205
+ },
2206
+ ];
2207
+ return [fromZigbee, toZigbee];
2208
+ }
2209
+ const tuyaModernExtend = {
2210
+ electricityMeasurementPoll(args = {}) {
2211
+ const { electricalMeasurement = true, metering = false, optionDescription = undefined } = args;
2212
+ let option = exposes.options.measurement_poll_interval();
2213
+ if (optionDescription !== undefined) {
2214
+ option = option.withDescription(optionDescription);
2215
+ }
2216
+ return modernExtend.poll({
2217
+ key: "measurement",
2218
+ option,
2219
+ defaultIntervalSeconds: 60,
2220
+ poll: async (device) => {
2221
+ const endpoint = device.getEndpoint(1);
2222
+ if (typeof electricalMeasurement === "boolean" ? electricalMeasurement : electricalMeasurement(device)) {
2223
+ await endpoint.read("haElectricalMeasurement", ["rmsVoltage", "rmsCurrent", "activePower"]);
2224
+ }
2225
+ if (typeof metering === "boolean" ? metering : metering(device)) {
2226
+ await endpoint.read("seMetering", ["currentSummDelivered"]);
2227
+ }
2228
+ },
2229
+ });
2230
+ },
2231
+ dpTHZBSettings() {
2232
+ const exp = e
2233
+ .composite("auto_settings", "auto_settings", ea.STATE_SET)
2234
+ .withDescription("Automatically switch ON/OFF, make sure manual mode is turned OFF otherwise auto settings are not applied.")
2235
+ .withFeature(e.binary("enabled", ea.STATE_SET, true, false).withDescription("Enable auto settings"))
2236
+ .withFeature(e.enum("temp_greater_then", ea.STATE_SET, ["ON", "OFF"]).withDescription("Greater action"))
2237
+ .withFeature(e
2238
+ .numeric("temp_greater_value", ea.STATE_SET)
2239
+ .withValueMin(-20)
2240
+ .withValueMax(80)
2241
+ .withValueStep(0.1)
2242
+ .withUnit("°C")
2243
+ .withDescription("Temperature greater than value"))
2244
+ .withFeature(e.enum("temp_lower_then", ea.STATE_SET, ["ON", "OFF"]).withDescription("Lower action"))
2245
+ .withFeature(e
2246
+ .numeric("temp_lower_value", ea.STATE_SET)
2247
+ .withValueMin(-20)
2248
+ .withValueMax(80)
2249
+ .withValueStep(0.1)
2250
+ .withUnit("°C")
2251
+ .withDescription("Temperature lower than value"));
2252
+ const handlers = getHandlersForDP("auto_settings", 0x77, exports.dataTypes.string, {
2253
+ from: (value) => {
2254
+ const buffer = Buffer.from(value, "hex");
2255
+ if (buffer.length > 0) {
2256
+ return {
2257
+ enabled: buffer.readUint16LE(0) === 0x80,
2258
+ temp_greater_value: buffer.readInt32LE(2) / 10,
2259
+ temp_greater_then: buffer.readUint8(6) ? "ON" : "OFF",
2260
+ temp_lower_value: buffer.readInt32LE(8) / 10,
2261
+ temp_lower_then: buffer.readUint8(12) ? "ON" : "OFF",
2262
+ };
2263
+ }
2264
+ },
2265
+ to: async (value, meta) => {
2266
+ const buffer = Buffer.alloc(13);
2267
+ buffer.writeUint16LE(value.enabled ? 0x80 : 0x00, 0);
2268
+ buffer.writeInt32LE(value.temp_greater_value * 10, 2);
2269
+ buffer.writeUInt8(value.temp_greater_then === "ON" ? 1 : 0, 6);
2270
+ buffer.writeUInt8(1, 7);
2271
+ buffer.writeInt32LE(value.temp_lower_value * 10, 8);
2272
+ buffer.writeUInt8(value.temp_lower_then === "ON" ? 1 : 0, 12);
2273
+ // Disable manual mode, otherwise auto settings is not applied.
2274
+ await sendDataPointEnum(meta.device.endpoints[0], 0x65, 0, "sendData", 1);
2275
+ return buffer.toString("hex");
2276
+ },
2277
+ });
2278
+ return {
2279
+ exposes: [exp],
2280
+ fromZigbee: handlers[0],
2281
+ toZigbee: handlers[1],
2282
+ isModernExtend: true,
2283
+ };
2284
+ },
2285
+ tuyaBase(args = {}) {
2286
+ const { dp = false, queryOnDeviceAnnounce = false, queryOnConfigure = false, bindBasicOnConfigure = false, queryIntervalSeconds = undefined, mcuVersionRequestOnConfigure = false,
2287
+ // Allow force updating for device with a very bad clock
2288
+ // Every hour when a message is received the time will be updated.
2289
+ forceTimeUpdates = false, timeStart = "off",
2290
+ // Disable by default as with many Tuya devices it doesn't work well.
2291
+ // https://github.com/Koenkk/zigbee2mqtt/issues/28367#issuecomment-3363460429
2292
+ respondToMcuVersionResponse = false, } = args;
2293
+ const fzConverter = {
2294
+ type: [
2295
+ "commandMcuSyncTime",
2296
+ "commandMcuVersionResponse",
2297
+ "commandMcuGatewayConnectionStatus",
2298
+ "commandDataResponse",
2299
+ "commandDataReport",
2300
+ "commandActiveStatusReport",
2301
+ "commandActiveStatusReportAlt",
2302
+ ],
2303
+ cluster: "manuSpecificTuya",
2304
+ convert: (model, msg, publish, options, meta) => {
2305
+ let forceTimeUpdate = false;
2306
+ if (forceTimeUpdates) {
2307
+ const nextLocalTimeUpdate = globalStore.getValue(msg.device, "nextLocalTimeUpdate");
2308
+ forceTimeUpdate = nextLocalTimeUpdate == null || nextLocalTimeUpdate < Date.now();
2309
+ }
2310
+ if (timeStart !== "off" && (msg.type === "commandMcuSyncTime" || forceTimeUpdate)) {
2311
+ globalStore.putValue(msg.device, "nextLocalTimeUpdate", Date.now() + 3600 * 1000);
2312
+ const offset = timeStart === "2000" ? constants.OneJanuary2000 : 0;
2313
+ const utcTime = Math.round((Date.now() - offset) / 1000);
2314
+ const localTime = utcTime - new Date().getTimezoneOffset() * 60;
2315
+ const payload = {
2316
+ payloadSize: 8,
2317
+ payload: [...convertDecimalValueTo4ByteHexArray(utcTime), ...convertDecimalValueTo4ByteHexArray(localTime)],
2318
+ };
2319
+ msg.endpoint
2320
+ .command("manuSpecificTuya", "mcuSyncTime", payload, {})
2321
+ .catch((error) => logger_1.logger.error(`Failed to sync time with '${msg.device.ieeeAddr}' (${error})`, NS));
2322
+ }
2323
+ else if (respondToMcuVersionResponse && msg.type === "commandMcuVersionResponse") {
2324
+ msg.endpoint
2325
+ .command("manuSpecificTuya", "mcuVersionRequest", { seq: 0x0002 })
2326
+ .catch((error) => logger_1.logger.error(`Failed respond to version response '${msg.device.ieeeAddr}' (${error})`, NS));
2327
+ }
2328
+ else if (msg.type === "commandMcuGatewayConnectionStatus") {
2329
+ // "payload" can have the following values:
2330
+ // 0x00: The gateway is not connected to the internet.
2331
+ // 0x01: The gateway is connected to the internet.
2332
+ // 0x02: The request timed out after three seconds.
2333
+ msg.endpoint
2334
+ .command("manuSpecificTuya", "mcuGatewayConnectionStatus", { payloadSize: 1, payload: 1 }, {})
2335
+ .catch((error) => logger_1.logger.error(`Failed respond to gateway connection status '${msg.device.ieeeAddr}' (${error})`, NS));
2336
+ }
2337
+ },
2338
+ };
2339
+ const result = {
2340
+ configure: [exports.configureMagicPacket],
2341
+ isModernExtend: true,
2342
+ fromZigbee: [fzConverter],
2343
+ toZigbee: [],
2344
+ };
2345
+ if (queryOnConfigure) {
2346
+ result.configure.push(exports.configureQuery);
2347
+ }
2348
+ if (mcuVersionRequestOnConfigure) {
2349
+ result.configure.push(exports.configureMcuVersionRequest);
2350
+ }
2351
+ if (bindBasicOnConfigure) {
2352
+ result.configure.push(exports.configureBindBasic);
2353
+ }
2354
+ if (queryOnDeviceAnnounce || queryIntervalSeconds !== undefined) {
2355
+ result.onEvent = [
2356
+ (event) => {
2357
+ // Some devices require a dataQuery on deviceAnnounce, otherwise they don't report any data
2358
+ if (queryOnDeviceAnnounce && event.type === "deviceAnnounce") {
2359
+ event.data.device.endpoints[0]
2360
+ .command("manuSpecificTuya", "dataQuery", {})
2361
+ .catch((error) => logger_1.logger.error(`Failed to query '${event.data.device.ieeeAddr}' on device announce (${error})`, NS));
2362
+ }
2363
+ if (queryIntervalSeconds !== undefined) {
2364
+ if (event.type === "stop") {
2365
+ clearTimeout(globalStore.getValue(event.data.ieeeAddr, "query_interval"));
2366
+ globalStore.clearValue(event.data.ieeeAddr, "query_interval");
2367
+ }
2368
+ else if (event.type === "start") {
2369
+ const setTimer = () => {
2370
+ const timer = setTimeout(() => {
2371
+ event.data.device.endpoints[0]
2372
+ .command("manuSpecificTuya", "dataQuery", {})
2373
+ .catch((error) => logger_1.logger.error(`Failed to query '${event.data.device.ieeeAddr}' on interval (${error})`, NS));
2374
+ if (globalStore.getValue(event.data.device.ieeeAddr, "query_interval") === timer) {
2375
+ setTimer();
2376
+ }
2377
+ }, queryIntervalSeconds * 1000);
2378
+ globalStore.putValue(event.data.device.ieeeAddr, "query_interval", timer);
2379
+ };
2380
+ setTimer();
2381
+ }
2382
+ }
2383
+ },
2384
+ ];
2385
+ }
2386
+ if (dp) {
2387
+ result.fromZigbee.push(tuyaFz.datapoints);
2388
+ result.toZigbee.push(tuyaTz.datapoints);
2389
+ }
2390
+ return result;
2391
+ },
2392
+ dpEnumLookup(args) {
2393
+ const { name, dp, type, lookup, description, readOnly, endpoint, expose, skip } = args;
2394
+ let exp;
2395
+ if (expose) {
2396
+ exp = expose;
2397
+ }
2398
+ else {
2399
+ exp = new exposes.Enum(name, readOnly ? ea.STATE : ea.STATE_SET, Object.keys(lookup)).withDescription(description);
2400
+ }
2401
+ if (endpoint)
2402
+ exp = exp.withEndpoint(endpoint);
2403
+ const handlers = getHandlersForDP(name, dp, type, {
2404
+ from: (value) => utils.getFromLookupByValue(value, lookup),
2405
+ to: (value) => utils.getFromLookup(value, lookup),
2406
+ }, readOnly, skip, endpoint);
2407
+ return { exposes: [exp], fromZigbee: handlers[0], toZigbee: handlers[1], isModernExtend: true };
2408
+ },
2409
+ dpBinary(args) {
2410
+ const { name, dp, type, valueOn, valueOff, description, readOnly, endpoint, expose, skip } = args;
2411
+ let exp;
2412
+ if (expose) {
2413
+ exp = expose;
2414
+ }
2415
+ else {
2416
+ exp = e.binary(name, readOnly ? ea.STATE : ea.STATE_SET, valueOn[0], valueOff[0]).withDescription(description);
2417
+ }
2418
+ if (endpoint)
2419
+ exp = exp.withEndpoint(endpoint);
2420
+ const handlers = getHandlersForDP(name, dp, type, {
2421
+ from: (value) => (value === valueOn[1] ? valueOn[0] : valueOff[0]),
2422
+ to: (value) => (value === valueOn[0] ? valueOn[1] : valueOff[1]),
2423
+ }, readOnly, skip, endpoint);
2424
+ return { exposes: [exp], fromZigbee: handlers[0], toZigbee: handlers[1], isModernExtend: true };
2425
+ },
2426
+ dpNumeric(args) {
2427
+ const { name, dp, type, description, readOnly, endpoint, unit, valueMax, valueMin, valueStep, scale, expose, skip } = args;
2428
+ let exp;
2429
+ if (expose) {
2430
+ exp = expose;
2431
+ }
2432
+ else {
2433
+ exp = e.numeric(name, readOnly ? ea.STATE : ea.STATE_SET).withDescription(description);
2434
+ }
2435
+ if (endpoint)
2436
+ exp = exp.withEndpoint(endpoint);
2437
+ if (unit)
2438
+ exp = exp.withUnit(unit);
2439
+ if (valueMin !== undefined)
2440
+ exp = exp.withValueMin(valueMin);
2441
+ if (valueMax !== undefined)
2442
+ exp = exp.withValueMax(valueMax);
2443
+ if (valueStep !== undefined)
2444
+ exp = exp.withValueStep(valueStep);
2445
+ // biome-ignore lint/suspicious/noImplicitAnyLet: ignored using `--suppress`
2446
+ let converter;
2447
+ if (scale === undefined) {
2448
+ converter = exports.valueConverterBasic.raw();
2449
+ }
2450
+ else {
2451
+ if (Array.isArray(scale)) {
2452
+ converter = exports.valueConverterBasic.scale(scale[0], scale[1], scale[2], scale[3]);
2453
+ }
2454
+ else {
2455
+ converter = exports.valueConverterBasic.divideBy(scale);
2456
+ }
2457
+ }
2458
+ const handlers = getHandlersForDP(name, dp, type, converter, readOnly, skip, endpoint);
2459
+ return { exposes: [exp], fromZigbee: handlers[0], toZigbee: handlers[1], isModernExtend: true };
2460
+ },
2461
+ dpLight(args) {
2462
+ const { state, brightness, min, max, colorTemp, endpoint } = args;
2463
+ let exp = e.light_brightness().setAccess("state", ea.STATE_SET).setAccess("brightness", ea.STATE_SET);
2464
+ // biome-ignore lint/suspicious/noExplicitAny: too messy...
2465
+ let fromZigbee = [];
2466
+ let toZigbee = [];
2467
+ let ext;
2468
+ if (min) {
2469
+ exp = exp.withMinBrightness().setAccess("min_brightness", ea.STATE_SET);
2470
+ }
2471
+ if (max) {
2472
+ exp = exp.withMaxBrightness().setAccess("max_brightness", ea.STATE_SET);
2473
+ }
2474
+ if (colorTemp) {
2475
+ exp = exp.withColorTemp(colorTemp.range).setAccess("color_temp", ea.STATE_SET);
2476
+ }
2477
+ // if (color) {
2478
+ // exp = exp.withColor(['hs']).setAccess('color_hs', ea.STATE_SET);
2479
+ // }
2480
+ if (endpoint)
2481
+ exp = exp.withEndpoint(endpoint);
2482
+ ext = tuyaModernExtend.dpBinary({
2483
+ name: "state",
2484
+ dp: state.dp,
2485
+ type: state.type,
2486
+ valueOn: state.valueOn,
2487
+ valueOff: state.valueOff,
2488
+ skip: state.skip,
2489
+ endpoint: endpoint,
2490
+ });
2491
+ fromZigbee = [...fromZigbee, ...ext.fromZigbee];
2492
+ toZigbee = [...toZigbee, ...ext.toZigbee];
2493
+ ext = tuyaModernExtend.dpNumeric({ name: "brightness", dp: brightness.dp, type: brightness.type, scale: brightness.scale, endpoint: endpoint });
2494
+ fromZigbee = [...fromZigbee, ...ext.fromZigbee];
2495
+ toZigbee = [...toZigbee, ...ext.toZigbee];
2496
+ if (min) {
2497
+ ext = tuyaModernExtend.dpNumeric({ name: "min_brightness", dp: min.dp, type: min.type, scale: min.scale, endpoint: endpoint });
2498
+ fromZigbee = [...fromZigbee, ...ext.fromZigbee];
2499
+ toZigbee = [...toZigbee, ...ext.toZigbee];
2500
+ }
2501
+ if (max) {
2502
+ ext = tuyaModernExtend.dpNumeric({ name: "max_brightness", dp: max.dp, type: max.type, scale: max.scale, endpoint: endpoint });
2503
+ fromZigbee = [...fromZigbee, ...ext.fromZigbee];
2504
+ toZigbee = [...toZigbee, ...ext.toZigbee];
2505
+ }
2506
+ if (colorTemp) {
2507
+ ext = tuyaModernExtend.dpNumeric({
2508
+ name: "color_temp",
2509
+ dp: colorTemp.dp,
2510
+ type: colorTemp.type,
2511
+ scale: colorTemp.scale,
2512
+ endpoint: endpoint,
2513
+ });
2514
+ fromZigbee = [...fromZigbee, ...ext.fromZigbee];
2515
+ toZigbee = [...toZigbee, ...ext.toZigbee];
2516
+ }
2517
+ // if (color) {
2518
+ // const handlers = getHandlersForDP('color', color.dp, color.type,
2519
+ // valueConverterBasic.color1000(), undefined, undefined, endpoint);
2520
+ // fromZigbee = [...fromZigbee, ...handlers[0]];
2521
+ // toZigbee = [...toZigbee, ...handlers[1]];
2522
+ // }
2523
+ // combine extends for one expose
2524
+ return { exposes: [exp], fromZigbee, toZigbee, isModernExtend: true };
2525
+ },
2526
+ dpTemperature(args) {
2527
+ return tuyaModernExtend.dpNumeric({ name: "temperature", type: exports.dataTypes.number, readOnly: true, scale: 10, expose: e.temperature(), ...args });
2528
+ },
2529
+ dpHumidity(args) {
2530
+ return tuyaModernExtend.dpNumeric({ name: "humidity", type: exports.dataTypes.number, readOnly: true, expose: e.humidity(), ...args });
2531
+ },
2532
+ dpBattery(args) {
2533
+ return tuyaModernExtend.dpNumeric({ name: "battery", type: exports.dataTypes.number, readOnly: true, expose: e.battery(), ...args });
2534
+ },
2535
+ dpBatteryState(args) {
2536
+ return tuyaModernExtend.dpEnumLookup({
2537
+ name: "battery_state",
2538
+ type: exports.dataTypes.number,
2539
+ lookup: { low: 0, medium: 1, high: 2 },
2540
+ readOnly: true,
2541
+ expose: tuyaExposes.batteryState(),
2542
+ ...args,
2543
+ });
2544
+ },
2545
+ dpTemperatureUnit(args) {
2546
+ return tuyaModernExtend.dpEnumLookup({
2547
+ name: "temperature_unit",
2548
+ type: exports.dataTypes.enum,
2549
+ lookup: { celsius: 0, fahrenheit: 1 },
2550
+ readOnly: true,
2551
+ expose: tuyaExposes.temperatureUnit(),
2552
+ ...args,
2553
+ });
2554
+ },
2555
+ dpContact(args, invert) {
2556
+ return tuyaModernExtend.dpBinary({
2557
+ name: "contact",
2558
+ type: exports.dataTypes.bool,
2559
+ valueOn: invert ? [true, true] : [true, false],
2560
+ valueOff: invert ? [false, false] : [false, true],
2561
+ readOnly: true,
2562
+ expose: e.contact(),
2563
+ ...args,
2564
+ });
2565
+ },
2566
+ dpAction(args) {
2567
+ const { lookup } = args;
2568
+ return tuyaModernExtend.dpEnumLookup({
2569
+ name: "action",
2570
+ type: exports.dataTypes.number,
2571
+ readOnly: true,
2572
+ expose: e.action(Object.keys(lookup)),
2573
+ ...args,
2574
+ });
2575
+ },
2576
+ dpIlluminance(args) {
2577
+ return tuyaModernExtend.dpNumeric({ name: "illuminance", type: exports.dataTypes.number, readOnly: true, expose: e.illuminance(), ...args });
2578
+ },
2579
+ dpGas(args, invert) {
2580
+ return tuyaModernExtend.dpBinary({
2581
+ name: "gas",
2582
+ type: exports.dataTypes.enum,
2583
+ valueOn: invert ? [true, 1] : [true, 0],
2584
+ valueOff: invert ? [false, 0] : [false, 1],
2585
+ readOnly: true,
2586
+ expose: e.gas(),
2587
+ ...args,
2588
+ });
2589
+ },
2590
+ dpOnOff(args) {
2591
+ const { readOnly } = args;
2592
+ return tuyaModernExtend.dpBinary({
2593
+ name: "state",
2594
+ type: exports.dataTypes.bool,
2595
+ valueOn: ["ON", true],
2596
+ valueOff: ["OFF", false],
2597
+ expose: e.switch().setAccess("state", readOnly ? ea.STATE : ea.STATE_SET),
2598
+ ...args,
2599
+ });
2600
+ },
2601
+ dpPowerOnBehavior(args) {
2602
+ const { readOnly } = args;
2603
+ let { lookup } = args;
2604
+ lookup = lookup || { off: 0, on: 1, previous: 2 };
2605
+ return tuyaModernExtend.dpEnumLookup({
2606
+ name: "power_on_behavior",
2607
+ lookup: lookup,
2608
+ type: exports.dataTypes.enum,
2609
+ expose: e.power_on_behavior(Object.keys(lookup)).withAccess(readOnly ? ea.STATE : ea.STATE_SET),
2610
+ ...args,
2611
+ });
2612
+ },
2613
+ tuyaLight(args) {
2614
+ args = { minBrightness: "none", powerOnBehavior: false, switchType: false, doNotDisturb: true, colorPowerOnBehavior: true, ...args };
2615
+ if (args.colorTemp) {
2616
+ args.colorTemp = { startup: false, ...args.colorTemp };
2617
+ }
2618
+ if (args.color) {
2619
+ args.color = { applyRedFix: true, enhancedHue: false, ...(utils.isBoolean(args.color) ? {} : args.color) };
2620
+ }
2621
+ const result = modernExtend.light({ ...args, powerOnBehavior: false });
2622
+ result.fromZigbee.push(tuyaFz.brightness);
2623
+ if (args.doNotDisturb) {
2624
+ result.toZigbee.push(tuyaTz.do_not_disturb);
2625
+ result.exposes.push(tuyaExposes.doNotDisturb());
2626
+ }
2627
+ if (args.powerOnBehavior) {
2628
+ result.fromZigbee.push(tuyaFz.power_on_behavior_2);
2629
+ result.toZigbee.push(tuyaTz.power_on_behavior_2);
2630
+ if (args.endpointNames) {
2631
+ result.exposes.push(...args.endpointNames.map((ee) => e.power_on_behavior().withEndpoint(ee)));
2632
+ }
2633
+ else {
2634
+ result.exposes.push(e.power_on_behavior());
2635
+ }
2636
+ }
2637
+ if (args.switchType) {
2638
+ result.fromZigbee.push(tuyaFz.switch_type);
2639
+ result.toZigbee.push(tuyaTz.switch_type);
2640
+ result.exposes.push(tuyaExposes.switchType());
2641
+ }
2642
+ if (args.minBrightness === "attribute") {
2643
+ result.fromZigbee.push(tuyaFz.min_brightness_attribute);
2644
+ result.toZigbee.push(tuyaTz.min_brightness_attribute);
2645
+ result.exposes = result.exposes.map((e) => (typeof e !== "function" && utils.isLightExpose(e) ? e.withMinBrightness() : e));
2646
+ }
2647
+ else if (args.minBrightness === "command") {
2648
+ result.toZigbee.push(tuyaTz.min_brightness_command);
2649
+ result.exposes = result.exposes.map((e) => typeof e !== "function" && utils.isLightExpose(e) ? e.withMinBrightness().setAccess("min_brightness", ea.STATE_SET) : e);
2650
+ }
2651
+ if (args.color && args.colorPowerOnBehavior) {
2652
+ result.toZigbee.push(tuyaTz.color_power_on_behavior);
2653
+ result.exposes.push(tuyaExposes.colorPowerOnBehavior());
2654
+ }
2655
+ result.configure.push((0, utils_1.configureSetPowerSourceWhenUnknown)("Mains (single phase)"));
2656
+ return result;
2657
+ },
2658
+ tuyaOnOff: (args = {}) => {
2659
+ const { onOffCountdown = false, indicatorMode = false, powerOutageMemory = false, childLock = false, inchingSwitch = false, backlightModeOffOn = false, powerOnBehavior2 = false, powerOnBehavior3 = false, switchType = false, } = args;
2660
+ const exposes = args.endpoints
2661
+ ? args.endpoints.map((ee) => e.switch().withEndpoint(ee))
2662
+ : [e.switch()];
2663
+ // biome-ignore lint/suspicious/noExplicitAny: generic
2664
+ const fromZigbee = [fz.on_off];
2665
+ const toZigbee = [];
2666
+ if (onOffCountdown) {
2667
+ fromZigbee.push(tuyaFz.on_off_countdown);
2668
+ toZigbee.push(tuyaTz.on_off_countdown);
2669
+ if (typeof onOffCountdown === "function") {
2670
+ exposes.push((d) => (onOffCountdown(d.manufacturerName) ? [tuyaExposes.countdown()] : []));
2671
+ }
2672
+ else if (args.endpoints) {
2673
+ exposes.push(...args.endpoints.map((ee) => tuyaExposes.countdown().withAccess(ea.ALL).withEndpoint(ee)));
2674
+ }
2675
+ else {
2676
+ exposes.push(tuyaExposes.countdown().withAccess(ea.ALL));
2677
+ }
2678
+ }
2679
+ else {
2680
+ toZigbee.push(tz.on_off);
2681
+ }
2682
+ if (powerOutageMemory) {
2683
+ // Legacy, powerOnBehavior is preferred
2684
+ fromZigbee.push(tuyaFz.power_outage_memory);
2685
+ toZigbee.push(tuyaTz.power_on_behavior_1);
2686
+ if (typeof powerOutageMemory === "function") {
2687
+ exposes.push((d) => (powerOutageMemory(d.manufacturerName) ? [tuyaExposes.powerOutageMemory()] : []));
2688
+ }
2689
+ else {
2690
+ exposes.push(tuyaExposes.powerOutageMemory());
2691
+ }
2692
+ }
2693
+ else if (powerOnBehavior2) {
2694
+ fromZigbee.push(tuyaFz.power_on_behavior_2);
2695
+ toZigbee.push(tuyaTz.power_on_behavior_2);
2696
+ const expose = args.endpoints ? args.endpoints.map((ee) => e.power_on_behavior().withEndpoint(ee)) : [e.power_on_behavior()];
2697
+ if (typeof powerOnBehavior2 === "function") {
2698
+ exposes.push((d) => (powerOnBehavior2(d.manufacturerName) ? expose : []));
2699
+ }
2700
+ else {
2701
+ exposes.push(...expose);
2702
+ }
2703
+ }
2704
+ else if (powerOnBehavior3) {
2705
+ const endpointList = args.endpoints || [];
2706
+ if (endpointList.length > 0) {
2707
+ for (const endpoint of endpointList) {
2708
+ const result = modernExtend.enumLookup({
2709
+ name: "power_on_behavior",
2710
+ lookup: { off: 0, on: 1, previous: 2 },
2711
+ cluster: "manuSpecificTuya",
2712
+ attribute: { ID: 0x4002, type: 0x30 },
2713
+ description: "Controls the behavior when the device is powered on after power loss",
2714
+ entityCategory: "config",
2715
+ endpointName: endpoint,
2716
+ });
2717
+ fromZigbee.push(...result.fromZigbee);
2718
+ toZigbee.push(...result.toZigbee);
2719
+ exposes.push(...result.exposes);
2720
+ }
2721
+ }
2722
+ else {
2723
+ const result = modernExtend.enumLookup({
2724
+ name: "power_on_behavior",
2725
+ lookup: { off: 0, on: 1, previous: 2 },
2726
+ cluster: "manuSpecificTuya",
2727
+ attribute: { ID: 0x4002, type: 0x30 },
2728
+ description: "Controls the behavior when the device is powered on after power loss",
2729
+ entityCategory: "config",
2730
+ });
2731
+ fromZigbee.push(...result.fromZigbee);
2732
+ toZigbee.push(...result.toZigbee);
2733
+ exposes.push(...result.exposes);
2734
+ }
2735
+ }
2736
+ else {
2737
+ fromZigbee.push(tuyaFz.power_on_behavior_1);
2738
+ toZigbee.push(tuyaTz.power_on_behavior_1);
2739
+ exposes.push(e.power_on_behavior());
2740
+ }
2741
+ if (switchType) {
2742
+ fromZigbee.push(tuyaFz.switch_type);
2743
+ toZigbee.push(tuyaTz.switch_type);
2744
+ if (typeof switchType === "function") {
2745
+ exposes.push((d) => (switchType(d.manufacturerName) ? [tuyaExposes.switchType()] : []));
2746
+ }
2747
+ else {
2748
+ exposes.push(tuyaExposes.switchType());
2749
+ }
2750
+ }
2751
+ if (args.switchTypeCurtain) {
2752
+ fromZigbee.push(tuyaFz.switch_type_curtain);
2753
+ toZigbee.push(tuyaTz.switch_type_curtain);
2754
+ exposes.push(tuyaExposes.switchTypeCurtain());
2755
+ }
2756
+ if (args.switchTypeButton) {
2757
+ fromZigbee.push(tuyaFz.switch_type_button);
2758
+ toZigbee.push(tuyaTz.switch_type_button);
2759
+ exposes.push(tuyaExposes.switchTypeButton());
2760
+ }
2761
+ if (backlightModeOffOn) {
2762
+ fromZigbee.push(tuyaFz.backlight_mode_off_on);
2763
+ toZigbee.push(tuyaTz.backlight_indicator_mode_2);
2764
+ if (typeof backlightModeOffOn === "function") {
2765
+ exposes.push((d) => (backlightModeOffOn(d.manufacturerName) ? [tuyaExposes.backlightModeOffOn()] : []));
2766
+ }
2767
+ else {
2768
+ exposes.push(tuyaExposes.backlightModeOffOn());
2769
+ }
2770
+ }
2771
+ if (args.backlightModeLowMediumHigh) {
2772
+ fromZigbee.push(tuyaFz.backlight_mode_low_medium_high);
2773
+ exposes.push(tuyaExposes.backlightModeLowMediumHigh());
2774
+ toZigbee.push(tuyaTz.backlight_indicator_mode_1);
2775
+ }
2776
+ if (args.backlightModeOffNormalInverted) {
2777
+ fromZigbee.push(tuyaFz.backlight_mode_off_normal_inverted);
2778
+ exposes.push(tuyaExposes.backlightModeOffNormalInverted());
2779
+ toZigbee.push(tuyaTz.backlight_indicator_mode_1);
2780
+ }
2781
+ if (indicatorMode) {
2782
+ fromZigbee.push(tuyaFz.indicator_mode);
2783
+ toZigbee.push(tuyaTz.backlight_indicator_mode_1);
2784
+ if (typeof indicatorMode === "function") {
2785
+ exposes.push((d) => (indicatorMode(d.manufacturerName) ? [tuyaExposes.indicatorMode()] : []));
2786
+ }
2787
+ else {
2788
+ exposes.push(tuyaExposes.indicatorMode());
2789
+ }
2790
+ }
2791
+ if (args.indicatorModeNoneRelayPos) {
2792
+ fromZigbee.push(tuyaFz.indicator_mode_none_relay_pos);
2793
+ exposes.push(tuyaExposes.indicatorModeNoneRelayPos());
2794
+ toZigbee.push(tuyaTz.backlight_indicator_mode_none_relay_pos);
2795
+ }
2796
+ if (args.electricalMeasurements) {
2797
+ fromZigbee.push(args.electricalMeasurementsFzConverter || fz.electrical_measurement, fz.metering);
2798
+ exposes.push(e.power(), e.current(), e.voltage(), e.energy());
2799
+ }
2800
+ if (childLock) {
2801
+ fromZigbee.push(tuyaFz.child_lock);
2802
+ toZigbee.push(tuyaTz.child_lock);
2803
+ if (typeof childLock === "function") {
2804
+ exposes.push((d) => (childLock(d.manufacturerName) ? [e.child_lock()] : []));
2805
+ }
2806
+ else {
2807
+ exposes.push(e.child_lock());
2808
+ }
2809
+ }
2810
+ if (args.switchMode) {
2811
+ if (args.endpoints) {
2812
+ args.endpoints.forEach((ep) => {
2813
+ const epExtend = tuyaModernExtend.tuyaSwitchMode({
2814
+ description: `Switch mode ${ep}`,
2815
+ endpointName: ep,
2816
+ });
2817
+ fromZigbee.push(...epExtend.fromZigbee);
2818
+ toZigbee.push(...epExtend.toZigbee);
2819
+ exposes.push(...epExtend.exposes);
2820
+ });
2821
+ }
2822
+ else {
2823
+ const extend = tuyaModernExtend.tuyaSwitchMode({ description: "Switch mode" });
2824
+ fromZigbee.push(...extend.fromZigbee);
2825
+ toZigbee.push(...extend.toZigbee);
2826
+ exposes.push(...extend.exposes);
2827
+ }
2828
+ }
2829
+ if (inchingSwitch) {
2830
+ const quantity = args.endpoints?.length ?? 1;
2831
+ fromZigbee.push(tuyaFz.inchingSwitch);
2832
+ toZigbee.push(tuyaTz.inchingSwitch);
2833
+ if (typeof inchingSwitch === "function") {
2834
+ exposes.push((d) => (inchingSwitch(d.manufacturerName) ? [tuyaExposes.inchingSwitch(quantity)] : []));
2835
+ }
2836
+ else {
2837
+ exposes.push(tuyaExposes.inchingSwitch(quantity));
2838
+ }
2839
+ }
2840
+ const configure = [(0, utils_1.configureSetPowerSourceWhenUnknown)("Mains (single phase)")];
2841
+ return { exposes, fromZigbee, toZigbee, isModernExtend: true, configure };
2842
+ },
2843
+ dpBacklightMode(args) {
2844
+ const { readOnly } = args;
2845
+ let { lookup } = args;
2846
+ lookup = lookup || { off: 0, normal: 1, inverted: 2 };
2847
+ return tuyaModernExtend.dpEnumLookup({
2848
+ name: "backlight_mode",
2849
+ lookup: lookup,
2850
+ type: exports.dataTypes.enum,
2851
+ expose: tuyaExposes.backlightModeOffNormalInverted().withAccess(readOnly ? ea.STATE : ea.STATE_SET),
2852
+ ...args,
2853
+ });
2854
+ },
2855
+ combineActions(actions) {
2856
+ let newValues = [];
2857
+ // biome-ignore lint/suspicious/noExplicitAny: too messy
2858
+ let newFromZigbee = [];
2859
+ let description;
2860
+ // collect action values and handlers
2861
+ for (const actionME of actions) {
2862
+ const { exposes, fromZigbee } = actionME;
2863
+ newValues = newValues.concat(exposes[0].values);
2864
+ description = exposes[0].description;
2865
+ newFromZigbee = newFromZigbee.concat(fromZigbee);
2866
+ }
2867
+ // create single enum-expose
2868
+ const exp = new exposes.Enum("action", ea.STATE, newValues).withDescription(description);
2869
+ return { exposes: [exp], fromZigbee: newFromZigbee, isModernExtend: true };
2870
+ },
2871
+ tuyaSwitchMode: (args) => modernExtend.enumLookup({
2872
+ name: "switch_mode",
2873
+ lookup: { switch: 0, scene: 1 },
2874
+ cluster: "manuSpecificTuya3",
2875
+ attribute: "switchMode",
2876
+ description: "Work mode for switch",
2877
+ entityCategory: "config",
2878
+ ...args,
2879
+ }),
2880
+ tuyaLedIndicator() {
2881
+ const fromZigbee = [tuyaFz.backlight_mode_off_normal_inverted];
2882
+ const exp = tuyaExposes.backlightModeOffNormalInverted();
2883
+ const toZigbee = [tuyaTz.backlight_indicator_mode_1];
2884
+ return { exposes: [exp], toZigbee, fromZigbee, isModernExtend: true };
2885
+ },
2886
+ tuyaMagicPacket() {
2887
+ return { configure: [exports.configureMagicPacket], isModernExtend: true };
2888
+ },
2889
+ tuyaOnOffAction(args) {
2890
+ return modernExtend.actionEnumLookup({
2891
+ actionLookup: { 0: "single", 1: "double", 2: "hold" },
2892
+ cluster: "genOnOff",
2893
+ commands: ["commandTuyaAction"],
2894
+ attribute: "value",
2895
+ });
2896
+ },
2897
+ tuyaOnOffActionLegacy(args) {
2898
+ // For new devices use tuyaOnOffAction instead
2899
+ const actions = args.actions.flatMap((a) => (args.endpointNames ? args.endpointNames.map((e) => `${e}_${a}`) : [a]));
2900
+ const exposes = [e.action(actions)];
2901
+ const fromZigbee = [tuyaFz.on_off_action];
2902
+ return { exposes, fromZigbee, isModernExtend: true };
2903
+ },
2904
+ dpChildLock(args) {
2905
+ return tuyaModernExtend.dpBinary({
2906
+ name: "child_lock",
2907
+ type: exports.dataTypes.bool,
2908
+ valueOn: ["LOCK", true],
2909
+ valueOff: ["UNLOCK", false],
2910
+ expose: e.child_lock(),
2911
+ ...args,
2912
+ });
2913
+ },
2914
+ tuyaWeatherForecast(args = {}) {
2915
+ const { includeCurrentWeather = true, numberOfForecastDays = 3, correctForNegativeValues = false, weatherConditionMap = exports.M8ProTuyaWeatherCondition, } = args;
2916
+ const tz_fileds = includeCurrentWeather ? ["temperature_0", "humidity_0", "condition_0"] : [];
2917
+ for (let i = 0; i < numberOfForecastDays; ++i) {
2918
+ tz_fileds.push(`temperature_${i}`);
2919
+ tz_fileds.push(`humidity_${i}`);
2920
+ tz_fileds.push(`condition_${i}`);
2921
+ }
2922
+ function _vCorr(val) {
2923
+ if (correctForNegativeValues && val < 1) {
2924
+ return val - 1;
2925
+ }
2926
+ return val;
2927
+ }
2928
+ function _prepareTuyaWeatherSyncPayload(meta, numberOfForecastDays, includeCurrentWeather) {
2929
+ let bOffset = 0;
2930
+ const buffer = Buffer.alloc(6 + (includeCurrentWeather ? 6 : 1) + numberOfForecastDays * 6);
2931
+ buffer.writeUInt8(0x11, bOffset++);
2932
+ buffer.writeUInt8(0, bOffset++);
2933
+ buffer.writeUInt8(0x12, bOffset++);
2934
+ buffer.writeUInt8(numberOfForecastDays, bOffset++);
2935
+ buffer.writeUInt8(0x13, bOffset++);
2936
+ const weather_values = { 1: [], 2: [], 3: [] };
2937
+ if (includeCurrentWeather) {
2938
+ buffer.writeUInt8(0x1, bOffset++);
2939
+ weather_values[TuyaWeatherID.Temperature].push("temperature_0" in meta.state ? _vCorr(meta.state["temperature_0"]) : 0);
2940
+ weather_values[TuyaWeatherID.Humidity].push("humidity_0" in meta.state ? meta.state["humidity_0"] : 0);
2941
+ weather_values[TuyaWeatherID.Condition].push("condition_0" in meta.state ? weatherConditionMap[meta.state["condition_0"]] : 0);
2942
+ }
2943
+ else {
2944
+ buffer.writeUInt8(0x0, bOffset++);
2945
+ }
2946
+ for (let i = 1; i <= numberOfForecastDays; ++i) {
2947
+ weather_values[TuyaWeatherID.Temperature].push(`temperature_${i}` in meta.state ? _vCorr(meta.state[`temperature_${i}`]) : 0);
2948
+ weather_values[TuyaWeatherID.Humidity].push(`humidity_${i}` in meta.state ? meta.state[`humidity${i}`] : 0);
2949
+ weather_values[TuyaWeatherID.Condition].push(`condition_${i}` in meta.state ? weatherConditionMap[meta.state[`condition_${i}`]] : 0);
2950
+ }
2951
+ for (const id of [1, 2, 3]) {
2952
+ buffer.writeUInt8(id, bOffset++);
2953
+ for (const j of weather_values[id]) {
2954
+ if (id === TuyaWeatherID.Temperature) {
2955
+ buffer.writeInt16BE(j, bOffset);
2956
+ bOffset += 2;
2957
+ }
2958
+ else if (id === TuyaWeatherID.Humidity) {
2959
+ buffer.writeInt16BE(j, bOffset);
2960
+ bOffset += 2;
2961
+ }
2962
+ else if (id === TuyaWeatherID.Condition) {
2963
+ buffer.writeUInt8(j, bOffset++);
2964
+ }
2965
+ }
2966
+ }
2967
+ buffer.writeUInt8(0, bOffset++);
2968
+ return buffer;
2969
+ }
2970
+ const fzConverter = {
2971
+ type: ["commandTuyaWeatherRequest"],
2972
+ cluster: "manuSpecificTuya",
2973
+ convert: (model, msg, publish, options, meta) => {
2974
+ if (msg.type === "commandTuyaWeatherRequest") {
2975
+ // Although the parameter is specified as "Data length" in the documentation, some devices
2976
+ // send values in this field that don't correspond to the rest of packet data. Relying on this
2977
+ // field would lead to parsing errors in those cases, thus it's required to search for constant flags.
2978
+ let bOffset = 0;
2979
+ const buffer = msg.data.payload;
2980
+ const _length = buffer.readUInt16LE(bOffset);
2981
+ bOffset += 2;
2982
+ const _version_number = buffer.readUInt8(bOffset++);
2983
+ const _location_type = buffer.readUInt8(bOffset++);
2984
+ const weather_request = [];
2985
+ let nextField = buffer.readUInt8(bOffset++);
2986
+ while (nextField !== 0x12 && nextField !== 0x13) {
2987
+ weather_request.push(nextField);
2988
+ nextField = buffer.readUInt8(bOffset++);
2989
+ }
2990
+ const number_of_forecast_days = nextField === 0x12 ? buffer.readUInt8(bOffset++) : 0;
2991
+ const _current_weather_flag = nextField === 0x12 ? buffer.readUInt8(bOffset++) : 0;
2992
+ const include_current_weather = buffer.readUInt8(bOffset++) !== 0;
2993
+ const pld = _prepareTuyaWeatherSyncPayload(meta, number_of_forecast_days, include_current_weather);
2994
+ msg.endpoint.command("manuSpecificTuya", "tuyaWeatherSync", { payload: pld });
2995
+ }
2996
+ },
2997
+ };
2998
+ const tzConverter = {
2999
+ key: tz_fileds,
3000
+ convertSet: (entity, key, value, meta) => {
3001
+ meta.state[key] = value;
3002
+ const pld = _prepareTuyaWeatherSyncPayload(meta, numberOfForecastDays, includeCurrentWeather);
3003
+ entity.command("manuSpecificTuya", "tuyaWeatherSync", { payload: pld });
3004
+ return { state: { [key]: value } };
3005
+ },
3006
+ };
3007
+ const result = {
3008
+ configure: [],
3009
+ isModernExtend: true,
3010
+ fromZigbee: [fzConverter],
3011
+ toZigbee: [tzConverter],
3012
+ };
3013
+ return result;
3014
+ },
3015
+ };
3016
+ exports.modernExtend = tuyaModernExtend;
3017
+ const tuyaClusters = {
3018
+ addTuyaCommonPrivateCluster: () => modernExtend.deviceAddCustomCluster("manuSpecificTuya4", {
3019
+ ID: 0xe000,
3020
+ attributes: {
3021
+ random_timing: { ID: 0xd001, type: zigbee_herdsman_1.Zcl.DataType.CHAR_STR, write: true },
3022
+ cycle_timing: { ID: 0xd002, type: zigbee_herdsman_1.Zcl.DataType.CHAR_STR, write: true },
3023
+ inching: { ID: 0xd003, type: zigbee_herdsman_1.Zcl.DataType.CHAR_STR, write: true },
3024
+ },
3025
+ commands: {
3026
+ setRandomTiming: {
3027
+ ID: 0xf7,
3028
+ parameters: [{ name: "payload", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.BUFFER }],
3029
+ },
3030
+ setCycleTiming: {
3031
+ ID: 0xf8,
3032
+ parameters: [{ name: "payload", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.BUFFER }],
3033
+ },
3034
+ setInchingSwitch: {
3035
+ ID: 0xfb,
3036
+ parameters: [{ name: "payload", type: zigbee_herdsman_1.Zcl.BuffaloZclDataType.BUFFER }],
3037
+ },
3038
+ },
3039
+ commandsResponse: {},
3040
+ }),
3041
+ };
3042
+ exports.clusters = tuyaClusters;
3043
+ //# sourceMappingURL=tuya.js.map