zigbee-herdsman-converters 20.12.1 → 20.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (534) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/converters/fromZigbee.d.ts.map +1 -1
  3. package/converters/fromZigbee.js +345 -334
  4. package/converters/fromZigbee.js.map +1 -1
  5. package/converters/toZigbee.d.ts +1 -1
  6. package/converters/toZigbee.d.ts.map +1 -1
  7. package/converters/toZigbee.js +80 -82
  8. package/converters/toZigbee.js.map +1 -1
  9. package/devices/ITCommander.d.ts.map +1 -1
  10. package/devices/ITCommander.js +1 -1
  11. package/devices/ITCommander.js.map +1 -1
  12. package/devices/acova.d.ts.map +1 -1
  13. package/devices/acova.js.map +1 -1
  14. package/devices/akuvox.d.ts.map +1 -1
  15. package/devices/akuvox.js.map +1 -1
  16. package/devices/aldi.d.ts.map +1 -1
  17. package/devices/aldi.js.map +1 -1
  18. package/devices/alecto.d.ts.map +1 -1
  19. package/devices/alecto.js.map +1 -1
  20. package/devices/atlantic.d.ts.map +1 -1
  21. package/devices/atlantic.js.map +1 -1
  22. package/devices/aubess.d.ts.map +1 -1
  23. package/devices/aubess.js.map +1 -1
  24. package/devices/aurora_lighting.d.ts.map +1 -1
  25. package/devices/aurora_lighting.js +2 -2
  26. package/devices/aurora_lighting.js.map +1 -1
  27. package/devices/avatto.js +0 -1
  28. package/devices/avatto.js.map +1 -1
  29. package/devices/axis.d.ts.map +1 -1
  30. package/devices/axis.js.map +1 -1
  31. package/devices/bitron.d.ts.map +1 -1
  32. package/devices/bitron.js +9 -9
  33. package/devices/bitron.js.map +1 -1
  34. package/devices/bituo_technik.d.ts.map +1 -1
  35. package/devices/bituo_technik.js +2 -2
  36. package/devices/bituo_technik.js.map +1 -1
  37. package/devices/blaupunkt.d.ts.map +1 -1
  38. package/devices/blaupunkt.js +1 -1
  39. package/devices/blaupunkt.js.map +1 -1
  40. package/devices/blitzwolf.d.ts.map +1 -1
  41. package/devices/blitzwolf.js.map +1 -1
  42. package/devices/bosch.d.ts.map +1 -1
  43. package/devices/bosch.js +25 -25
  44. package/devices/bosch.js.map +1 -1
  45. package/devices/brimate.d.ts.map +1 -1
  46. package/devices/brimate.js.map +1 -1
  47. package/devices/bseed.d.ts.map +1 -1
  48. package/devices/bseed.js.map +1 -1
  49. package/devices/bticino.d.ts.map +1 -1
  50. package/devices/bticino.js.map +1 -1
  51. package/devices/busch_jaeger.d.ts.map +1 -1
  52. package/devices/busch_jaeger.js.map +1 -1
  53. package/devices/byun.d.ts.map +1 -1
  54. package/devices/byun.js.map +1 -1
  55. package/devices/casaia.d.ts.map +1 -1
  56. package/devices/casaia.js +2 -2
  57. package/devices/casaia.js.map +1 -1
  58. package/devices/centralite.d.ts.map +1 -1
  59. package/devices/centralite.js +5 -5
  60. package/devices/centralite.js.map +1 -1
  61. package/devices/cleverio.d.ts.map +1 -1
  62. package/devices/cleverio.js.map +1 -1
  63. package/devices/ctm.d.ts.map +1 -1
  64. package/devices/ctm.js +62 -62
  65. package/devices/ctm.js.map +1 -1
  66. package/devices/current_products_corp.d.ts.map +1 -1
  67. package/devices/current_products_corp.js.map +1 -1
  68. package/devices/custom_devices_diy.d.ts.map +1 -1
  69. package/devices/custom_devices_diy.js +12 -12
  70. package/devices/custom_devices_diy.js.map +1 -1
  71. package/devices/danalock.d.ts.map +1 -1
  72. package/devices/danalock.js.map +1 -1
  73. package/devices/danfoss.d.ts.map +1 -1
  74. package/devices/danfoss.js +2 -2
  75. package/devices/danfoss.js.map +1 -1
  76. package/devices/datek.d.ts.map +1 -1
  77. package/devices/datek.js +1 -1
  78. package/devices/datek.js.map +1 -1
  79. package/devices/dawon_dns.d.ts.map +1 -1
  80. package/devices/dawon_dns.js.map +1 -1
  81. package/devices/develco.d.ts.map +1 -1
  82. package/devices/develco.js +15 -14
  83. package/devices/develco.js.map +1 -1
  84. package/devices/digi.d.ts.map +1 -1
  85. package/devices/digi.js.map +1 -1
  86. package/devices/dlink.d.ts.map +1 -1
  87. package/devices/dlink.js.map +1 -1
  88. package/devices/easyaccess.d.ts.map +1 -1
  89. package/devices/easyaccess.js.map +1 -1
  90. package/devices/easyiot.d.ts.map +1 -1
  91. package/devices/easyiot.js.map +1 -1
  92. package/devices/echostar.d.ts.map +1 -1
  93. package/devices/echostar.js.map +1 -1
  94. package/devices/ecodim.d.ts.map +1 -1
  95. package/devices/ecodim.js +1 -1
  96. package/devices/ecodim.js.map +1 -1
  97. package/devices/ecolink.d.ts.map +1 -1
  98. package/devices/ecolink.js.map +1 -1
  99. package/devices/ecozy.d.ts.map +1 -1
  100. package/devices/ecozy.js.map +1 -1
  101. package/devices/enocean.d.ts.map +1 -1
  102. package/devices/enocean.js.map +1 -1
  103. package/devices/envilar.d.ts.map +1 -1
  104. package/devices/envilar.js +2 -2
  105. package/devices/envilar.js.map +1 -1
  106. package/devices/eurotronic.d.ts.map +1 -1
  107. package/devices/eurotronic.js.map +1 -1
  108. package/devices/evanell.d.ts.map +1 -1
  109. package/devices/evanell.js.map +1 -1
  110. package/devices/evology.d.ts.map +1 -1
  111. package/devices/evology.js.map +1 -1
  112. package/devices/ewelink.d.ts.map +1 -1
  113. package/devices/ewelink.js +1 -1
  114. package/devices/ewelink.js.map +1 -1
  115. package/devices/fantem.d.ts.map +1 -1
  116. package/devices/fantem.js +2 -2
  117. package/devices/fantem.js.map +1 -1
  118. package/devices/fireangel.d.ts.map +1 -1
  119. package/devices/fireangel.js.map +1 -1
  120. package/devices/frankever.d.ts.map +1 -1
  121. package/devices/frankever.js.map +1 -1
  122. package/devices/frient.d.ts.map +1 -1
  123. package/devices/frient.js.map +1 -1
  124. package/devices/gewiss.d.ts.map +1 -1
  125. package/devices/gewiss.js.map +1 -1
  126. package/devices/giex.d.ts.map +1 -1
  127. package/devices/giex.js.map +1 -1
  128. package/devices/gledopto.js +2 -2
  129. package/devices/gledopto.js.map +1 -1
  130. package/devices/gmmts.d.ts.map +1 -1
  131. package/devices/gmmts.js +23 -23
  132. package/devices/gmmts.js.map +1 -1
  133. package/devices/gumax.d.ts +4 -0
  134. package/devices/gumax.d.ts.map +1 -0
  135. package/devices/gumax.js +15 -0
  136. package/devices/gumax.js.map +1 -0
  137. package/devices/heiman.d.ts.map +1 -1
  138. package/devices/heiman.js +2 -2
  139. package/devices/heiman.js.map +1 -1
  140. package/devices/heimgard_technologies.d.ts.map +1 -1
  141. package/devices/heimgard_technologies.js +2 -2
  142. package/devices/heimgard_technologies.js.map +1 -1
  143. package/devices/hive.js +1 -1
  144. package/devices/hive.js.map +1 -1
  145. package/devices/hommyn.d.ts.map +1 -1
  146. package/devices/hommyn.js.map +1 -1
  147. package/devices/hzc.d.ts.map +1 -1
  148. package/devices/hzc.js.map +1 -1
  149. package/devices/hzc_electric.d.ts.map +1 -1
  150. package/devices/hzc_electric.js.map +1 -1
  151. package/devices/ihorn.d.ts.map +1 -1
  152. package/devices/ihorn.js.map +1 -1
  153. package/devices/imhotepcreation.d.ts.map +1 -1
  154. package/devices/index.d.ts.map +1 -1
  155. package/devices/index.js +4 -2
  156. package/devices/index.js.map +1 -1
  157. package/devices/innr.d.ts.map +1 -1
  158. package/devices/innr.js +3 -3
  159. package/devices/innr.js.map +1 -1
  160. package/devices/inovelli.d.ts.map +1 -1
  161. package/devices/inovelli.js +38 -38
  162. package/devices/inovelli.js.map +1 -1
  163. package/devices/insta.d.ts.map +1 -1
  164. package/devices/insta.js.map +1 -1
  165. package/devices/iotperfect.d.ts.map +1 -1
  166. package/devices/iotperfect.js.map +1 -1
  167. package/devices/iris.d.ts.map +1 -1
  168. package/devices/iris.js +1 -1
  169. package/devices/iris.js.map +1 -1
  170. package/devices/javis.d.ts.map +1 -1
  171. package/devices/javis.js.map +1 -1
  172. package/devices/jxuan.d.ts.map +1 -1
  173. package/devices/jxuan.js +2 -2
  174. package/devices/jxuan.js.map +1 -1
  175. package/devices/kami.d.ts.map +1 -1
  176. package/devices/kami.js.map +1 -1
  177. package/devices/keen_home.d.ts.map +1 -1
  178. package/devices/keen_home.js.map +1 -1
  179. package/devices/kmpcil.d.ts.map +1 -1
  180. package/devices/kmpcil.js +5 -5
  181. package/devices/kmpcil.js.map +1 -1
  182. package/devices/kwikset.d.ts.map +1 -1
  183. package/devices/kwikset.js.map +1 -1
  184. package/devices/led_trading.d.ts.map +1 -1
  185. package/devices/led_trading.js +1 -8
  186. package/devices/led_trading.js.map +1 -1
  187. package/devices/legrand.d.ts.map +1 -1
  188. package/devices/legrand.js +2 -2
  189. package/devices/legrand.js.map +1 -1
  190. package/devices/lellki.d.ts.map +1 -1
  191. package/devices/lellki.js +2 -2
  192. package/devices/lellki.js.map +1 -1
  193. package/devices/letv.d.ts.map +1 -1
  194. package/devices/letv.js.map +1 -1
  195. package/devices/leviton.d.ts.map +1 -1
  196. package/devices/leviton.js +1 -1
  197. package/devices/leviton.js.map +1 -1
  198. package/devices/lidl.d.ts.map +1 -1
  199. package/devices/lidl.js +15 -15
  200. package/devices/lidl.js.map +1 -1
  201. package/devices/lifecontrol.d.ts.map +1 -1
  202. package/devices/lifecontrol.js +1 -1
  203. package/devices/lifecontrol.js.map +1 -1
  204. package/devices/linkind.d.ts.map +1 -1
  205. package/devices/linkind.js +2 -2
  206. package/devices/linkind.js.map +1 -1
  207. package/devices/linptech.d.ts.map +1 -1
  208. package/devices/linptech.js +5 -5
  209. package/devices/linptech.js.map +1 -1
  210. package/devices/livolo.d.ts.map +1 -1
  211. package/devices/livolo.js +1 -1
  212. package/devices/livolo.js.map +1 -1
  213. package/devices/lixee.d.ts.map +1 -1
  214. package/devices/lixee.js +29 -28
  215. package/devices/lixee.js.map +1 -1
  216. package/devices/ls.d.ts.map +1 -1
  217. package/devices/ls.js.map +1 -1
  218. package/devices/lumi.d.ts.map +1 -1
  219. package/devices/lumi.js +7 -7
  220. package/devices/lumi.js.map +1 -1
  221. package/devices/lupus.d.ts.map +1 -1
  222. package/devices/lupus.js +2 -2
  223. package/devices/lupus.js.map +1 -1
  224. package/devices/lutron.d.ts.map +1 -1
  225. package/devices/lutron.js.map +1 -1
  226. package/devices/lux.d.ts.map +1 -1
  227. package/devices/lux.js.map +1 -1
  228. package/devices/lytko.js +6 -6
  229. package/devices/lytko.js.map +1 -1
  230. package/devices/meazon.d.ts.map +1 -1
  231. package/devices/meazon.js.map +1 -1
  232. package/devices/mercator.d.ts.map +1 -1
  233. package/devices/mercator.js +2 -2
  234. package/devices/mercator.js.map +1 -1
  235. package/devices/miboxer.d.ts.map +1 -1
  236. package/devices/miboxer.js +1 -1
  237. package/devices/miboxer.js.map +1 -1
  238. package/devices/moes.d.ts.map +1 -1
  239. package/devices/moes.js +3 -3
  240. package/devices/moes.js.map +1 -1
  241. package/devices/multiterm.js +1 -1
  242. package/devices/multiterm.js.map +1 -1
  243. package/devices/namron.js +6 -6
  244. package/devices/namron.js.map +1 -1
  245. package/devices/neo.d.ts.map +1 -1
  246. package/devices/neo.js +1 -1
  247. package/devices/neo.js.map +1 -1
  248. package/devices/net2grid.d.ts.map +1 -1
  249. package/devices/net2grid.js.map +1 -1
  250. package/devices/netvox.d.ts.map +1 -1
  251. package/devices/netvox.js.map +1 -1
  252. package/devices/niko.d.ts.map +1 -1
  253. package/devices/niko.js +10 -10
  254. package/devices/niko.js.map +1 -1
  255. package/devices/ninja_blocks.d.ts.map +1 -1
  256. package/devices/ninja_blocks.js.map +1 -1
  257. package/devices/nodon.d.ts.map +1 -1
  258. package/devices/nodon.js +2 -2
  259. package/devices/nodon.js.map +1 -1
  260. package/devices/nous.d.ts.map +1 -1
  261. package/devices/nous.js.map +1 -1
  262. package/devices/novo.d.ts.map +1 -1
  263. package/devices/novo.js.map +1 -1
  264. package/devices/nue_3a.js +2 -2
  265. package/devices/nue_3a.js.map +1 -1
  266. package/devices/nyce.d.ts.map +1 -1
  267. package/devices/nyce.js.map +1 -1
  268. package/devices/onesti.d.ts.map +1 -1
  269. package/devices/onesti.js.map +1 -1
  270. package/devices/openlumi.d.ts.map +1 -1
  271. package/devices/openlumi.js.map +1 -1
  272. package/devices/orvibo.d.ts.map +1 -1
  273. package/devices/orvibo.js +9 -0
  274. package/devices/orvibo.js.map +1 -1
  275. package/devices/oujiabao.d.ts.map +1 -1
  276. package/devices/oujiabao.js.map +1 -1
  277. package/devices/owon.d.ts.map +1 -1
  278. package/devices/owon.js +35 -26
  279. package/devices/owon.js.map +1 -1
  280. package/devices/peq.d.ts.map +1 -1
  281. package/devices/peq.js.map +1 -1
  282. package/devices/perenio.d.ts.map +1 -1
  283. package/devices/perenio.js +21 -21
  284. package/devices/perenio.js.map +1 -1
  285. package/devices/philips.d.ts.map +1 -1
  286. package/devices/philips.js +28 -0
  287. package/devices/philips.js.map +1 -1
  288. package/devices/plaid.d.ts.map +1 -1
  289. package/devices/plaid.js.map +1 -1
  290. package/devices/plugwise.d.ts.map +1 -1
  291. package/devices/plugwise.js +1 -1
  292. package/devices/plugwise.js.map +1 -1
  293. package/devices/qa.d.ts.map +1 -1
  294. package/devices/qa.js.map +1 -1
  295. package/devices/qmotion.d.ts.map +1 -1
  296. package/devices/qmotion.js +1 -1
  297. package/devices/qmotion.js.map +1 -1
  298. package/devices/qoto.d.ts.map +1 -1
  299. package/devices/qoto.js.map +1 -1
  300. package/devices/rgb_genie.d.ts.map +1 -1
  301. package/devices/rgb_genie.js +2 -2
  302. package/devices/rgb_genie.js.map +1 -1
  303. package/devices/roome.d.ts.map +1 -1
  304. package/devices/roome.js.map +1 -1
  305. package/devices/rtx.d.ts.map +1 -1
  306. package/devices/rtx.js.map +1 -1
  307. package/devices/salus_controls.d.ts.map +1 -1
  308. package/devices/salus_controls.js.map +1 -1
  309. package/devices/saswell.d.ts.map +1 -1
  310. package/devices/saswell.js +1 -1
  311. package/devices/saswell.js.map +1 -1
  312. package/devices/sber.d.ts.map +1 -1
  313. package/devices/sber.js.map +1 -1
  314. package/devices/schlage.d.ts.map +1 -1
  315. package/devices/schlage.js.map +1 -1
  316. package/devices/schneider_electric.d.ts.map +1 -1
  317. package/devices/schneider_electric.js +22 -22
  318. package/devices/schneider_electric.js.map +1 -1
  319. package/devices/securifi.d.ts.map +1 -1
  320. package/devices/securifi.js.map +1 -1
  321. package/devices/sengled.d.ts.map +1 -1
  322. package/devices/sercomm.d.ts.map +1 -1
  323. package/devices/sercomm.js.map +1 -1
  324. package/devices/shade_control.d.ts.map +1 -1
  325. package/devices/shade_control.js.map +1 -1
  326. package/devices/shinasystem.js +1 -1
  327. package/devices/shinasystem.js.map +1 -1
  328. package/devices/siglis.d.ts.map +1 -1
  329. package/devices/siglis.js +4 -5
  330. package/devices/siglis.js.map +1 -1
  331. package/devices/sinope.d.ts.map +1 -1
  332. package/devices/sinope.js +76 -84
  333. package/devices/sinope.js.map +1 -1
  334. package/devices/siterwell.d.ts.map +1 -1
  335. package/devices/siterwell.js.map +1 -1
  336. package/devices/skydance.d.ts.map +1 -1
  337. package/devices/skydance.js.map +1 -1
  338. package/devices/smart9.d.ts.map +1 -1
  339. package/devices/smart9.js.map +1 -1
  340. package/devices/smartenit.d.ts.map +1 -1
  341. package/devices/smartenit.js.map +1 -1
  342. package/devices/smartthings.js +1 -1
  343. package/devices/smartthings.js.map +1 -1
  344. package/devices/smartwings.d.ts.map +1 -1
  345. package/devices/smartwings.js.map +1 -1
  346. package/devices/somgoms.d.ts.map +1 -1
  347. package/devices/somgoms.js.map +1 -1
  348. package/devices/sonoff.d.ts.map +1 -1
  349. package/devices/sonoff.js +2 -2
  350. package/devices/sonoff.js.map +1 -1
  351. package/devices/stelpro.d.ts.map +1 -1
  352. package/devices/stelpro.js +3 -3
  353. package/devices/stelpro.js.map +1 -1
  354. package/devices/sunricher.d.ts.map +1 -1
  355. package/devices/sunricher.js +3 -8
  356. package/devices/sunricher.js.map +1 -1
  357. package/devices/swann.d.ts.map +1 -1
  358. package/devices/swann.js.map +1 -1
  359. package/devices/tapestry.d.ts.map +1 -1
  360. package/devices/tapestry.js.map +1 -1
  361. package/devices/technicolor.d.ts.map +1 -1
  362. package/devices/technicolor.js.map +1 -1
  363. package/devices/third_reality.d.ts.map +1 -1
  364. package/devices/third_reality.js +185 -13
  365. package/devices/third_reality.js.map +1 -1
  366. package/devices/titan_products.d.ts.map +1 -1
  367. package/devices/titan_products.js.map +1 -1
  368. package/devices/tplink.d.ts.map +1 -1
  369. package/devices/tplink.js.map +1 -1
  370. package/devices/tuya.d.ts.map +1 -1
  371. package/devices/tuya.js +48 -41
  372. package/devices/tuya.js.map +1 -1
  373. package/devices/ubisys.d.ts.map +1 -1
  374. package/devices/ubisys.js +37 -28
  375. package/devices/ubisys.js.map +1 -1
  376. package/devices/uhome.d.ts.map +1 -1
  377. package/devices/uhome.js.map +1 -1
  378. package/devices/universal_electronics_inc.d.ts.map +1 -1
  379. package/devices/universal_electronics_inc.js +1 -1
  380. package/devices/universal_electronics_inc.js.map +1 -1
  381. package/devices/vesternet.d.ts.map +1 -1
  382. package/devices/vesternet.js.map +1 -1
  383. package/devices/viessmann.d.ts.map +1 -1
  384. package/devices/viessmann.js.map +1 -1
  385. package/devices/vimar.d.ts.map +1 -1
  386. package/devices/vimar.js.map +1 -1
  387. package/devices/visonic.d.ts.map +1 -1
  388. package/devices/visonic.js.map +1 -1
  389. package/devices/wally.d.ts.map +1 -1
  390. package/devices/wally.js.map +1 -1
  391. package/devices/waxman.d.ts.map +1 -1
  392. package/devices/waxman.js.map +1 -1
  393. package/devices/weiser.d.ts.map +1 -1
  394. package/devices/weiser.js.map +1 -1
  395. package/devices/wirenboard.d.ts.map +1 -1
  396. package/devices/wirenboard.js +11 -11
  397. package/devices/wirenboard.js.map +1 -1
  398. package/devices/woolley.d.ts.map +1 -1
  399. package/devices/woolley.js +1 -1
  400. package/devices/woolley.js.map +1 -1
  401. package/devices/woox.d.ts.map +1 -1
  402. package/devices/woox.js.map +1 -1
  403. package/devices/wyze.d.ts.map +1 -1
  404. package/devices/wyze.js.map +1 -1
  405. package/devices/xyzroe.d.ts.map +1 -1
  406. package/devices/xyzroe.js +6 -6
  407. package/devices/xyzroe.js.map +1 -1
  408. package/devices/yale.d.ts.map +1 -1
  409. package/devices/yale.js +3 -3
  410. package/devices/yale.js.map +1 -1
  411. package/devices/yookee.d.ts.map +1 -1
  412. package/devices/yookee.js.map +1 -1
  413. package/devices/zemismart.d.ts.map +1 -1
  414. package/devices/zemismart.js +2 -2
  415. package/devices/zemismart.js.map +1 -1
  416. package/devices/zen.d.ts.map +1 -1
  417. package/devices/zen.js.map +1 -1
  418. package/index.d.ts +5 -5
  419. package/index.d.ts.map +1 -1
  420. package/index.js +31 -16
  421. package/index.js.map +1 -1
  422. package/lib/color.d.ts +1 -1
  423. package/lib/color.d.ts.map +1 -1
  424. package/lib/color.js +47 -50
  425. package/lib/color.js.map +1 -1
  426. package/lib/configureKey.js +2 -2
  427. package/lib/configureKey.js.map +1 -1
  428. package/lib/develco.d.ts.map +1 -1
  429. package/lib/develco.js +5 -6
  430. package/lib/develco.js.map +1 -1
  431. package/lib/ewelink.d.ts.map +1 -1
  432. package/lib/exposes.js +1 -1
  433. package/lib/exposes.js.map +1 -1
  434. package/lib/ikea.d.ts +1 -1
  435. package/lib/ikea.d.ts.map +1 -1
  436. package/lib/ikea.js +10 -10
  437. package/lib/ikea.js.map +1 -1
  438. package/lib/ledvance.d.ts +1 -1
  439. package/lib/ledvance.d.ts.map +1 -1
  440. package/lib/legacy.d.ts +3 -16
  441. package/lib/legacy.d.ts.map +1 -1
  442. package/lib/legacy.js +121 -131
  443. package/lib/legacy.js.map +1 -1
  444. package/lib/legrand.d.ts +1 -1
  445. package/lib/legrand.d.ts.map +1 -1
  446. package/lib/legrand.js +4 -4
  447. package/lib/legrand.js.map +1 -1
  448. package/lib/light.d.ts +1 -1
  449. package/lib/light.js +5 -5
  450. package/lib/light.js.map +1 -1
  451. package/lib/logger.d.ts.map +1 -1
  452. package/lib/logger.js +4 -4
  453. package/lib/logger.js.map +1 -1
  454. package/lib/lumi.d.ts +1 -1
  455. package/lib/lumi.d.ts.map +1 -1
  456. package/lib/lumi.js +90 -92
  457. package/lib/lumi.js.map +1 -1
  458. package/lib/modernExtend.d.ts +1 -1
  459. package/lib/modernExtend.d.ts.map +1 -1
  460. package/lib/modernExtend.js +15 -15
  461. package/lib/modernExtend.js.map +1 -1
  462. package/lib/ota/common.d.ts +1 -1
  463. package/lib/ota/common.d.ts.map +1 -1
  464. package/lib/ota/common.js +5 -5
  465. package/lib/ota/common.js.map +1 -1
  466. package/lib/ota/gmmts.d.ts +1 -1
  467. package/lib/ota/gmmts.d.ts.map +1 -1
  468. package/lib/ota/gmmts.js +2 -2
  469. package/lib/ota/gmmts.js.map +1 -1
  470. package/lib/ota/index.d.ts +5 -5
  471. package/lib/ota/index.d.ts.map +1 -1
  472. package/lib/ota/index.js +7 -7
  473. package/lib/ota/index.js.map +1 -1
  474. package/lib/ota/inovelli.d.ts +1 -6
  475. package/lib/ota/inovelli.d.ts.map +1 -1
  476. package/lib/ota/inovelli.js +11 -11
  477. package/lib/ota/inovelli.js.map +1 -1
  478. package/lib/ota/jethome.d.ts +1 -1
  479. package/lib/ota/jethome.d.ts.map +1 -1
  480. package/lib/ota/jethome.js +4 -4
  481. package/lib/ota/jethome.js.map +1 -1
  482. package/lib/ota/ledvance.d.ts +1 -1
  483. package/lib/ota/ledvance.d.ts.map +1 -1
  484. package/lib/ota/ledvance.js +4 -4
  485. package/lib/ota/ledvance.js.map +1 -1
  486. package/lib/ota/lixee.d.ts +1 -1
  487. package/lib/ota/lixee.d.ts.map +1 -1
  488. package/lib/ota/lixee.js +3 -3
  489. package/lib/ota/lixee.js.map +1 -1
  490. package/lib/ota/salus.d.ts +1 -1
  491. package/lib/ota/salus.d.ts.map +1 -1
  492. package/lib/ota/salus.js +5 -5
  493. package/lib/ota/salus.js.map +1 -1
  494. package/lib/ota/securifi.d.ts +1 -1
  495. package/lib/ota/securifi.d.ts.map +1 -1
  496. package/lib/ota/securifi.js +2 -2
  497. package/lib/ota/securifi.js.map +1 -1
  498. package/lib/ota/tradfri.d.ts.map +1 -1
  499. package/lib/ota/tradfri.js +4 -4
  500. package/lib/ota/tradfri.js.map +1 -1
  501. package/lib/ota/ubisys.d.ts.map +1 -1
  502. package/lib/ota/ubisys.js +4 -4
  503. package/lib/ota/ubisys.js.map +1 -1
  504. package/lib/ota/zigbeeOTA.d.ts +1 -1
  505. package/lib/ota/zigbeeOTA.d.ts.map +1 -1
  506. package/lib/ota/zigbeeOTA.js +9 -9
  507. package/lib/ota/zigbeeOTA.js.map +1 -1
  508. package/lib/philips.js +12 -12
  509. package/lib/philips.js.map +1 -1
  510. package/lib/reporting.d.ts +1 -1
  511. package/lib/reporting.d.ts.map +1 -1
  512. package/lib/reporting.js +7 -7
  513. package/lib/reporting.js.map +1 -1
  514. package/lib/store.d.ts +1 -1
  515. package/lib/store.d.ts.map +1 -1
  516. package/lib/store.js +2 -2
  517. package/lib/store.js.map +1 -1
  518. package/lib/tuya.d.ts +1 -1
  519. package/lib/tuya.d.ts.map +1 -1
  520. package/lib/tuya.js +24 -56
  521. package/lib/tuya.js.map +1 -1
  522. package/lib/types.d.ts +4 -4
  523. package/lib/types.d.ts.map +1 -1
  524. package/lib/types.js +1 -0
  525. package/lib/types.js.map +1 -1
  526. package/lib/ubisys.d.ts +1 -1
  527. package/lib/ubisys.d.ts.map +1 -1
  528. package/lib/ubisys.js +1 -1
  529. package/lib/ubisys.js.map +1 -1
  530. package/lib/utils.d.ts +1 -1
  531. package/lib/utils.d.ts.map +1 -1
  532. package/lib/utils.js +26 -26
  533. package/lib/utils.js.map +1 -1
  534. package/package.json +8 -9
@@ -40,7 +40,7 @@ const converters1 = {
40
40
  cluster: 'hvacFanCtrl',
41
41
  type: ['attributeReport', 'readResponse'],
42
42
  convert: (model, msg, publish, options, meta) => {
43
- if (msg.data.hasOwnProperty('fanMode')) {
43
+ if (msg.data.fanMode !== undefined) {
44
44
  const key = (0, utils_1.getKey)(constants.fanMode, msg.data.fanMode);
45
45
  return { fan_mode: key, fan_state: key === 'off' ? 'OFF' : 'ON' };
46
46
  }
@@ -52,58 +52,58 @@ const converters1 = {
52
52
  convert: (model, msg, publish, options, meta) => {
53
53
  const result = {};
54
54
  const dontMapPIHeatingDemand = model.meta && model.meta.thermostat && model.meta.thermostat.dontMapPIHeatingDemand;
55
- if (msg.data.hasOwnProperty('localTemp')) {
55
+ if (msg.data.localTemp !== undefined) {
56
56
  const value = (0, utils_1.precisionRound)(msg.data['localTemp'], 2) / 100;
57
57
  if (value >= -273.15) {
58
58
  result[(0, utils_1.postfixWithEndpointName)('local_temperature', msg, model, meta)] = value;
59
59
  }
60
60
  }
61
- if (msg.data.hasOwnProperty('localTemperatureCalibration')) {
61
+ if (msg.data.localTemperatureCalibration !== undefined) {
62
62
  result[(0, utils_1.postfixWithEndpointName)('local_temperature_calibration', msg, model, meta)] =
63
63
  (0, utils_1.precisionRound)(msg.data['localTemperatureCalibration'], 2) / 10;
64
64
  }
65
- if (msg.data.hasOwnProperty('outdoorTemp')) {
65
+ if (msg.data.outdoorTemp !== undefined) {
66
66
  const value = (0, utils_1.precisionRound)(msg.data['outdoorTemp'], 2) / 100;
67
67
  if (value >= -273.15) {
68
68
  result[(0, utils_1.postfixWithEndpointName)('outdoor_temperature', msg, model, meta)] = value;
69
69
  }
70
70
  }
71
- if (msg.data.hasOwnProperty('occupancy')) {
71
+ if (msg.data.occupancy !== undefined) {
72
72
  result[(0, utils_1.postfixWithEndpointName)('occupancy', msg, model, meta)] = msg.data.occupancy % 2 > 0;
73
73
  }
74
- if (msg.data.hasOwnProperty('occupiedHeatingSetpoint')) {
74
+ if (msg.data.occupiedHeatingSetpoint !== undefined) {
75
75
  const value = (0, utils_1.precisionRound)(msg.data['occupiedHeatingSetpoint'], 2) / 100;
76
76
  // Stelpro will return -325.65 when set to off, value is not realistic anyway
77
77
  if (value >= -273.15) {
78
78
  result[(0, utils_1.postfixWithEndpointName)('occupied_heating_setpoint', msg, model, meta)] = value;
79
79
  }
80
80
  }
81
- if (msg.data.hasOwnProperty('unoccupiedHeatingSetpoint')) {
81
+ if (msg.data.unoccupiedHeatingSetpoint !== undefined) {
82
82
  result[(0, utils_1.postfixWithEndpointName)('unoccupied_heating_setpoint', msg, model, meta)] =
83
83
  (0, utils_1.precisionRound)(msg.data['unoccupiedHeatingSetpoint'], 2) / 100;
84
84
  }
85
- if (msg.data.hasOwnProperty('occupiedCoolingSetpoint')) {
85
+ if (msg.data.occupiedCoolingSetpoint !== undefined) {
86
86
  result[(0, utils_1.postfixWithEndpointName)('occupied_cooling_setpoint', msg, model, meta)] =
87
87
  (0, utils_1.precisionRound)(msg.data['occupiedCoolingSetpoint'], 2) / 100;
88
88
  }
89
- if (msg.data.hasOwnProperty('unoccupiedCoolingSetpoint')) {
89
+ if (msg.data.unoccupiedCoolingSetpoint !== undefined) {
90
90
  result[(0, utils_1.postfixWithEndpointName)('unoccupied_cooling_setpoint', msg, model, meta)] =
91
91
  (0, utils_1.precisionRound)(msg.data['unoccupiedCoolingSetpoint'], 2) / 100;
92
92
  }
93
- if (msg.data.hasOwnProperty('setpointChangeAmount')) {
93
+ if (msg.data.setpointChangeAmount !== undefined) {
94
94
  result[(0, utils_1.postfixWithEndpointName)('setpoint_change_amount', msg, model, meta)] = msg.data['setpointChangeAmount'] / 100;
95
95
  }
96
- if (msg.data.hasOwnProperty('setpointChangeSource')) {
96
+ if (msg.data.setpointChangeSource !== undefined) {
97
97
  const lookup = { 0: 'manual', 1: 'schedule', 2: 'externally' };
98
98
  result[(0, utils_1.postfixWithEndpointName)('setpoint_change_source', msg, model, meta)] = lookup[msg.data['setpointChangeSource']];
99
99
  }
100
- if (msg.data.hasOwnProperty('setpointChangeSourceTimeStamp')) {
100
+ if (msg.data.setpointChangeSourceTimeStamp !== undefined) {
101
101
  const date = new Date(2000, 0, 1);
102
102
  date.setSeconds(msg.data['setpointChangeSourceTimeStamp']);
103
103
  const value = (0, utils_1.toLocalISOString)(date);
104
104
  result[(0, utils_1.postfixWithEndpointName)('setpoint_change_source_timestamp', msg, model, meta)] = value;
105
105
  }
106
- if (msg.data.hasOwnProperty('remoteSensing')) {
106
+ if (msg.data.remoteSensing !== undefined) {
107
107
  const value = msg.data['remoteSensing'];
108
108
  result[(0, utils_1.postfixWithEndpointName)('remote_sensing', msg, model, meta)] = {
109
109
  local_temperature: (value & 1) > 0 ? 'remotely' : 'internally',
@@ -111,79 +111,79 @@ const converters1 = {
111
111
  occupancy: (value & (1 << 2)) > 0 ? 'remotely' : 'internally',
112
112
  };
113
113
  }
114
- if (msg.data.hasOwnProperty('ctrlSeqeOfOper')) {
114
+ if (msg.data.ctrlSeqeOfOper !== undefined) {
115
115
  result[(0, utils_1.postfixWithEndpointName)('control_sequence_of_operation', msg, model, meta)] =
116
116
  constants.thermostatControlSequenceOfOperations[msg.data['ctrlSeqeOfOper']];
117
117
  }
118
- if (msg.data.hasOwnProperty('programingOperMode')) {
118
+ if (msg.data.programingOperMode !== undefined) {
119
119
  result[(0, utils_1.postfixWithEndpointName)('programming_operation_mode', msg, model, meta)] =
120
120
  constants.thermostatProgrammingOperationModes[msg.data['programingOperMode']];
121
121
  }
122
- if (msg.data.hasOwnProperty('systemMode')) {
122
+ if (msg.data.systemMode !== undefined) {
123
123
  result[(0, utils_1.postfixWithEndpointName)('system_mode', msg, model, meta)] = constants.thermostatSystemModes[msg.data['systemMode']];
124
124
  }
125
- if (msg.data.hasOwnProperty('runningMode')) {
125
+ if (msg.data.runningMode !== undefined) {
126
126
  result[(0, utils_1.postfixWithEndpointName)('running_mode', msg, model, meta)] = constants.thermostatRunningMode[msg.data['runningMode']];
127
127
  }
128
- if (msg.data.hasOwnProperty('runningState')) {
128
+ if (msg.data.runningState !== undefined) {
129
129
  result[(0, utils_1.postfixWithEndpointName)('running_state', msg, model, meta)] = constants.thermostatRunningStates[msg.data['runningState']];
130
130
  }
131
- if (msg.data.hasOwnProperty('pIHeatingDemand')) {
131
+ if (msg.data.pIHeatingDemand !== undefined) {
132
132
  result[(0, utils_1.postfixWithEndpointName)('pi_heating_demand', msg, model, meta)] = (0, utils_1.mapNumberRange)(msg.data['pIHeatingDemand'], 0, dontMapPIHeatingDemand ? 100 : 255, 0, 100);
133
133
  }
134
- if (msg.data.hasOwnProperty('pICoolingDemand')) {
134
+ if (msg.data.pICoolingDemand !== undefined) {
135
135
  // we assume the behavior is consistent for pIHeatingDemand + pICoolingDemand for the same vendor
136
136
  result[(0, utils_1.postfixWithEndpointName)('pi_cooling_demand', msg, model, meta)] = (0, utils_1.mapNumberRange)(msg.data['pICoolingDemand'], 0, dontMapPIHeatingDemand ? 100 : 255, 0, 100);
137
137
  }
138
- if (msg.data.hasOwnProperty('tempSetpointHold')) {
138
+ if (msg.data.tempSetpointHold !== undefined) {
139
139
  result[(0, utils_1.postfixWithEndpointName)('temperature_setpoint_hold', msg, model, meta)] = msg.data['tempSetpointHold'] == 1;
140
140
  }
141
- if (msg.data.hasOwnProperty('tempSetpointHoldDuration')) {
141
+ if (msg.data.tempSetpointHoldDuration !== undefined) {
142
142
  result[(0, utils_1.postfixWithEndpointName)('temperature_setpoint_hold_duration', msg, model, meta)] = msg.data['tempSetpointHoldDuration'];
143
143
  }
144
- if (msg.data.hasOwnProperty('minHeatSetpointLimit')) {
144
+ if (msg.data.minHeatSetpointLimit !== undefined) {
145
145
  const value = (0, utils_1.precisionRound)(msg.data['minHeatSetpointLimit'], 2) / 100;
146
146
  if (value >= -273.15) {
147
147
  result[(0, utils_1.postfixWithEndpointName)('min_heat_setpoint_limit', msg, model, meta)] = value;
148
148
  }
149
149
  }
150
- if (msg.data.hasOwnProperty('maxHeatSetpointLimit')) {
150
+ if (msg.data.maxHeatSetpointLimit !== undefined) {
151
151
  const value = (0, utils_1.precisionRound)(msg.data['maxHeatSetpointLimit'], 2) / 100;
152
152
  if (value >= -273.15) {
153
153
  result[(0, utils_1.postfixWithEndpointName)('max_heat_setpoint_limit', msg, model, meta)] = value;
154
154
  }
155
155
  }
156
- if (msg.data.hasOwnProperty('absMinHeatSetpointLimit')) {
156
+ if (msg.data.absMinHeatSetpointLimit !== undefined) {
157
157
  const value = (0, utils_1.precisionRound)(msg.data['absMinHeatSetpointLimit'], 2) / 100;
158
158
  if (value >= -273.15) {
159
159
  result[(0, utils_1.postfixWithEndpointName)('abs_min_heat_setpoint_limit', msg, model, meta)] = value;
160
160
  }
161
161
  }
162
- if (msg.data.hasOwnProperty('absMaxHeatSetpointLimit')) {
162
+ if (msg.data.absMaxHeatSetpointLimit !== undefined) {
163
163
  const value = (0, utils_1.precisionRound)(msg.data['absMaxHeatSetpointLimit'], 2) / 100;
164
164
  if (value >= -273.15) {
165
165
  result[(0, utils_1.postfixWithEndpointName)('abs_max_heat_setpoint_limit', msg, model, meta)] = value;
166
166
  }
167
167
  }
168
- if (msg.data.hasOwnProperty('absMinCoolSetpointLimit')) {
168
+ if (msg.data.absMinCoolSetpointLimit !== undefined) {
169
169
  const value = (0, utils_1.precisionRound)(msg.data['absMinCoolSetpointLimit'], 2) / 100;
170
170
  if (value >= -273.15) {
171
171
  result[(0, utils_1.postfixWithEndpointName)('abs_min_cool_setpoint_limit', msg, model, meta)] = value;
172
172
  }
173
173
  }
174
- if (msg.data.hasOwnProperty('absMaxCoolSetpointLimit')) {
174
+ if (msg.data.absMaxCoolSetpointLimit !== undefined) {
175
175
  const value = (0, utils_1.precisionRound)(msg.data['absMaxCoolSetpointLimit'], 2) / 100;
176
176
  if (value >= -273.15) {
177
177
  result[(0, utils_1.postfixWithEndpointName)('abs_max_cool_setpoint_limit', msg, model, meta)] = value;
178
178
  }
179
179
  }
180
- if (msg.data.hasOwnProperty('minSetpointDeadBand')) {
180
+ if (msg.data.minSetpointDeadBand !== undefined) {
181
181
  const value = (0, utils_1.precisionRound)(msg.data['minSetpointDeadBand'], 2) / 100;
182
182
  if (value >= -273.15) {
183
183
  result[(0, utils_1.postfixWithEndpointName)('min_setpoint_dead_band', msg, model, meta)] = value;
184
184
  }
185
185
  }
186
- if (msg.data.hasOwnProperty('acLouverPosition')) {
186
+ if (msg.data.acLouverPosition !== undefined) {
187
187
  result[(0, utils_1.postfixWithEndpointName)('ac_louver_position', msg, model, meta)] =
188
188
  constants.thermostatAcLouverPositions[msg.data['acLouverPosition']];
189
189
  }
@@ -203,10 +203,10 @@ const converters1 = {
203
203
  const transitions = [];
204
204
  for (const transition of msg.data.transitions) {
205
205
  const entry = { time: transition.transitionTime };
206
- if (transition.hasOwnProperty('heatSetpoint')) {
206
+ if (transition.heatSetpoint !== undefined) {
207
207
  entry['heating_setpoint'] = transition['heatSetpoint'] / 100;
208
208
  }
209
- if (transition.hasOwnProperty('coolSetpoint')) {
209
+ if (transition.coolSetpoint !== undefined) {
210
210
  entry['cooling_setpoint'] = transition['coolSetpoint'] / 100;
211
211
  }
212
212
  transitions.push(entry);
@@ -219,15 +219,17 @@ const converters1 = {
219
219
  type: ['attributeReport', 'readResponse'],
220
220
  convert: (model, msg, publish, options, meta) => {
221
221
  const result = {};
222
- if (msg.data.hasOwnProperty('keypadLockout')) {
223
- result.keypad_lockout = constants.keypadLockoutMode.hasOwnProperty(msg.data['keypadLockout'])
224
- ? constants.keypadLockoutMode[msg.data['keypadLockout']]
225
- : msg.data['keypadLockout'];
226
- }
227
- if (msg.data.hasOwnProperty('tempDisplayMode')) {
228
- result.temperature_display_mode = constants.temperatureDisplayMode.hasOwnProperty(msg.data['tempDisplayMode'])
229
- ? constants.temperatureDisplayMode[msg.data['tempDisplayMode']]
230
- : msg.data['tempDisplayMode'];
222
+ if (msg.data.keypadLockout !== undefined) {
223
+ result.keypad_lockout =
224
+ constants.keypadLockoutMode[msg.data['keypadLockout']] !== undefined
225
+ ? constants.keypadLockoutMode[msg.data['keypadLockout']]
226
+ : msg.data['keypadLockout'];
227
+ }
228
+ if (msg.data.tempDisplayMode !== undefined) {
229
+ result.temperature_display_mode =
230
+ constants.temperatureDisplayMode[msg.data['tempDisplayMode']] !== undefined
231
+ ? constants.temperatureDisplayMode[msg.data['tempDisplayMode']]
232
+ : msg.data['tempDisplayMode'];
231
233
  }
232
234
  return result;
233
235
  },
@@ -288,18 +290,18 @@ const converters1 = {
288
290
  type: ['attributeReport', 'readResponse'],
289
291
  convert: (model, msg, publish, options, meta) => {
290
292
  const result = {};
291
- if (msg.data.hasOwnProperty('lockState')) {
293
+ if (msg.data.lockState !== undefined) {
292
294
  result.state = msg.data.lockState == 1 ? 'LOCK' : 'UNLOCK';
293
295
  const lookup = ['not_fully_locked', 'locked', 'unlocked'];
294
296
  result.lock_state = lookup[msg.data['lockState']];
295
297
  }
296
- if (msg.data.hasOwnProperty('autoRelockTime')) {
298
+ if (msg.data.autoRelockTime !== undefined) {
297
299
  result.auto_relock_time = msg.data.autoRelockTime;
298
300
  }
299
- if (msg.data.hasOwnProperty('soundVolume')) {
301
+ if (msg.data.soundVolume !== undefined) {
300
302
  result.sound_volume = constants.lockSoundVolume[msg.data.soundVolume];
301
303
  }
302
- if (msg.data.hasOwnProperty('doorState')) {
304
+ if (msg.data.doorState !== undefined) {
303
305
  const lookup = {
304
306
  0: 'open',
305
307
  1: 'closed',
@@ -366,7 +368,7 @@ const converters1 = {
366
368
  // If voltageToPercentage is specified, it means we do not trust the percentage
367
369
  // returned by the device and are instead calculating it ourselves.
368
370
  if (model.meta?.battery?.voltageToPercentage == null &&
369
- msg.data.hasOwnProperty('batteryPercentageRemaining') &&
371
+ msg.data.batteryPercentageRemaining !== undefined &&
370
372
  msg.data['batteryPercentageRemaining'] < 255) {
371
373
  // Some devices do not comply to the ZCL and report a
372
374
  // batteryPercentageRemaining of 100 when the battery is full (should be 200).
@@ -375,14 +377,14 @@ const converters1 = {
375
377
  percentage = dontDividePercentage ? percentage : percentage / 2;
376
378
  payload.battery = (0, utils_1.precisionRound)(percentage, 2);
377
379
  }
378
- if (msg.data.hasOwnProperty('batteryVoltage') && msg.data['batteryVoltage'] < 255) {
380
+ if (msg.data.batteryVoltage !== undefined && msg.data['batteryVoltage'] < 255) {
379
381
  // Deprecated: voltage is = mV now but should be V
380
382
  payload.voltage = msg.data['batteryVoltage'] * 100;
381
383
  if (model.meta && model.meta.battery && model.meta.battery.voltageToPercentage) {
382
384
  payload.battery = (0, utils_1.batteryVoltageToPercentage)(payload.voltage, model.meta.battery.voltageToPercentage);
383
385
  }
384
386
  }
385
- if (msg.data.hasOwnProperty('batteryAlarmState')) {
387
+ if (msg.data.batteryAlarmState !== undefined) {
386
388
  const battery1Low = (msg.data.batteryAlarmState & (1 << 0) ||
387
389
  msg.data.batteryAlarmState & (1 << 1) ||
388
390
  msg.data.batteryAlarmState & (1 << 2) ||
@@ -404,7 +406,7 @@ const converters1 = {
404
406
  cluster: 'msTemperatureMeasurement',
405
407
  type: ['attributeReport', 'readResponse'],
406
408
  convert: (model, msg, publish, options, meta) => {
407
- if (msg.data.hasOwnProperty('measuredValue')) {
409
+ if (msg.data.measuredValue !== undefined) {
408
410
  const temperature = parseFloat(msg.data['measuredValue']) / 100.0;
409
411
  const property = (0, utils_1.postfixWithEndpointName)('temperature', msg, model, meta);
410
412
  return { [property]: temperature };
@@ -415,7 +417,7 @@ const converters1 = {
415
417
  cluster: 'genDeviceTempCfg',
416
418
  type: ['attributeReport', 'readResponse'],
417
419
  convert: (model, msg, publish, options, meta) => {
418
- if (msg.data.hasOwnProperty('currentTemperature')) {
420
+ if (msg.data.currentTemperature !== undefined) {
419
421
  const value = parseInt(msg.data['currentTemperature']);
420
422
  return { device_temperature: value };
421
423
  }
@@ -439,7 +441,7 @@ const converters1 = {
439
441
  cluster: 'pm25Measurement',
440
442
  type: ['attributeReport', 'readResponse'],
441
443
  convert: (model, msg, publish, options, meta) => {
442
- if (msg.data.hasOwnProperty('measuredValue')) {
444
+ if (msg.data.measuredValue !== undefined) {
443
445
  return { pm25: msg.data['measuredValue'] };
444
446
  }
445
447
  },
@@ -450,7 +452,7 @@ const converters1 = {
450
452
  convert: (model, msg, publish, options, meta) => {
451
453
  const flow = parseFloat(msg.data['measuredValue']) / 10.0;
452
454
  const property = (0, utils_1.postfixWithEndpointName)('flow', msg, model, meta);
453
- if (msg.data.hasOwnProperty('measuredValue')) {
455
+ if (msg.data.measuredValue !== undefined) {
454
456
  return { [property]: flow };
455
457
  }
456
458
  },
@@ -478,7 +480,7 @@ const converters1 = {
478
480
  type: ['attributeReport', 'readResponse'],
479
481
  convert: (model, msg, publish, options, meta) => {
480
482
  let pressure = 0;
481
- if (msg.data.hasOwnProperty('scaledValue')) {
483
+ if (msg.data.scaledValue !== undefined) {
482
484
  const scale = msg.endpoint.getClusterAttributeValue('msPressureMeasurement', 'scale');
483
485
  pressure = msg.data['scaledValue'] / Math.pow(10, scale) / 100.0; // convert to hPa
484
486
  }
@@ -501,7 +503,7 @@ const converters1 = {
501
503
  type: ['attributeReport', 'readResponse'],
502
504
  options: [exposes.options.no_occupancy_since_false()],
503
505
  convert: (model, msg, publish, options, meta) => {
504
- if (msg.data.hasOwnProperty('occupancy')) {
506
+ if (msg.data.occupancy !== undefined) {
505
507
  const payload = { occupancy: msg.data.occupancy % 2 > 0 };
506
508
  utils.noOccupancySince(msg.endpoint, options, publish, payload.occupancy ? 'stop' : 'start');
507
509
  return payload;
@@ -523,7 +525,7 @@ const converters1 = {
523
525
  }
524
526
  // The occupancy sensor only sends a message when motion detected.
525
527
  // Therefore we need to publish the no_motion detected by ourselves.
526
- const timeout = options && options.hasOwnProperty('occupancy_timeout') ? Number(options.occupancy_timeout) : 90;
528
+ const timeout = options && options.occupancy_timeout !== undefined ? Number(options.occupancy_timeout) : 90;
527
529
  // Stop existing timers because motion is detected and set a new one.
528
530
  clearTimeout(globalStore.getValue(msg.endpoint, 'occupancy_timer', null));
529
531
  if (timeout !== 0) {
@@ -541,7 +543,7 @@ const converters1 = {
541
543
  cluster: 'msOccupancySensing',
542
544
  type: ['attributeReport', 'readResponse'],
543
545
  convert: (model, msg, publish, options, meta) => {
544
- if (msg.data.hasOwnProperty('pirOToUDelay')) {
546
+ if (msg.data.pirOToUDelay !== undefined) {
545
547
  return { occupancy_timeout: msg.data.pirOToUDelay };
546
548
  }
547
549
  },
@@ -550,7 +552,7 @@ const converters1 = {
550
552
  cluster: 'genLevelCtrl',
551
553
  type: ['attributeReport', 'readResponse'],
552
554
  convert: (model, msg, publish, options, meta) => {
553
- if (msg.data.hasOwnProperty('currentLevel')) {
555
+ if (msg.data.currentLevel !== undefined) {
554
556
  const property = (0, utils_1.postfixWithEndpointName)('brightness', msg, model, meta);
555
557
  return { [property]: msg.data['currentLevel'] };
556
558
  }
@@ -562,12 +564,12 @@ const converters1 = {
562
564
  convert: (model, msg, publish, options, meta) => {
563
565
  const result = { level_config: {} };
564
566
  // onOffTransitionTime - range 0x0000 to 0xffff - optional
565
- if (msg.data.hasOwnProperty('onOffTransitionTime') && msg.data['onOffTransitionTime'] !== undefined) {
567
+ if (msg.data.onOffTransitionTime !== undefined && msg.data['onOffTransitionTime'] !== undefined) {
566
568
  result.level_config.on_off_transition_time = Number(msg.data['onOffTransitionTime']);
567
569
  }
568
570
  // onTransitionTime - range 0x0000 to 0xffff - optional
569
571
  // 0xffff = use onOffTransitionTime
570
- if (msg.data.hasOwnProperty('onTransitionTime') && msg.data['onTransitionTime'] !== undefined) {
572
+ if (msg.data.onTransitionTime !== undefined && msg.data['onTransitionTime'] !== undefined) {
571
573
  result.level_config.on_transition_time = Number(msg.data['onTransitionTime']);
572
574
  if (result.level_config.on_transition_time == 65535) {
573
575
  result.level_config.on_transition_time = 'disabled';
@@ -575,7 +577,7 @@ const converters1 = {
575
577
  }
576
578
  // offTransitionTime - range 0x0000 to 0xffff - optional
577
579
  // 0xffff = use onOffTransitionTime
578
- if (msg.data.hasOwnProperty('offTransitionTime') && msg.data['offTransitionTime'] !== undefined) {
580
+ if (msg.data.offTransitionTime !== undefined && msg.data['offTransitionTime'] !== undefined) {
579
581
  result.level_config.off_transition_time = Number(msg.data['offTransitionTime']);
580
582
  if (result.level_config.off_transition_time == 65535) {
581
583
  result.level_config.off_transition_time = 'disabled';
@@ -584,7 +586,7 @@ const converters1 = {
584
586
  // startUpCurrentLevel - range 0x00 to 0xff - optional
585
587
  // 0x00 = return to minimum supported level
586
588
  // 0xff - return to previous previous
587
- if (msg.data.hasOwnProperty('startUpCurrentLevel') && msg.data['startUpCurrentLevel'] !== undefined) {
589
+ if (msg.data.startUpCurrentLevel !== undefined && msg.data['startUpCurrentLevel'] !== undefined) {
588
590
  result.level_config.current_level_startup = Number(msg.data['startUpCurrentLevel']);
589
591
  if (result.level_config.current_level_startup == 255) {
590
592
  result.level_config.current_level_startup = 'previous';
@@ -595,7 +597,7 @@ const converters1 = {
595
597
  }
596
598
  // onLevel - range 0x00 to 0xff - optional
597
599
  // Any value outside of MinLevel to MaxLevel, including 0xff and 0x00, is interpreted as "previous".
598
- if (msg.data.hasOwnProperty('onLevel') && msg.data['onLevel'] !== undefined) {
600
+ if (msg.data.onLevel !== undefined && msg.data['onLevel'] !== undefined) {
599
601
  result.level_config.on_level = Number(msg.data['onLevel']);
600
602
  if (result.level_config.on_level === 255) {
601
603
  result.level_config.on_level = 'previous';
@@ -606,7 +608,7 @@ const converters1 = {
606
608
  // when 1, CurrentLevel can be changed while the device is off.
607
609
  // bit 1: CoupleColorTempToLevel - when 1, changes to level also change color temperature.
608
610
  // (What this means is not defined, but it's most likely to be "dim to warm".)
609
- if (msg.data.hasOwnProperty('options') && msg.data['options'] !== undefined) {
611
+ if (msg.data.options !== undefined && msg.data['options'] !== undefined) {
610
612
  result.level_config.execute_if_off = !!(Number(msg.data['options']) & 1);
611
613
  }
612
614
  if (Object.keys(result.level_config).length > 0) {
@@ -620,40 +622,41 @@ const converters1 = {
620
622
  options: [exposes.options.color_sync()],
621
623
  convert: (model, msg, publish, options, meta) => {
622
624
  const result = {};
623
- if (msg.data.hasOwnProperty('colorTemperature')) {
625
+ if (msg.data.colorTemperature !== undefined) {
624
626
  result.color_temp = msg.data['colorTemperature'];
625
627
  }
626
- if (msg.data.hasOwnProperty('startUpColorTemperature')) {
628
+ if (msg.data.startUpColorTemperature !== undefined) {
627
629
  result.color_temp_startup = msg.data['startUpColorTemperature'];
628
630
  }
629
- if (msg.data.hasOwnProperty('colorMode')) {
630
- result.color_mode = constants.colorModeLookup.hasOwnProperty(msg.data['colorMode'])
631
- ? constants.colorModeLookup[msg.data['colorMode']]
632
- : msg.data['colorMode'];
633
- }
634
- if (msg.data.hasOwnProperty('currentX') ||
635
- msg.data.hasOwnProperty('currentY') ||
636
- msg.data.hasOwnProperty('currentSaturation') ||
637
- msg.data.hasOwnProperty('currentHue') ||
638
- msg.data.hasOwnProperty('enhancedCurrentHue')) {
631
+ if (msg.data.colorMode !== undefined) {
632
+ result.color_mode =
633
+ constants.colorModeLookup[msg.data['colorMode']] !== undefined
634
+ ? constants.colorModeLookup[msg.data['colorMode']]
635
+ : msg.data['colorMode'];
636
+ }
637
+ if (msg.data.currentX !== undefined ||
638
+ msg.data.currentY !== undefined ||
639
+ msg.data.currentSaturation !== undefined ||
640
+ msg.data.currentHue !== undefined ||
641
+ msg.data.enhancedCurrentHue !== undefined) {
639
642
  result.color = {};
640
- if (msg.data.hasOwnProperty('currentX')) {
643
+ if (msg.data.currentX !== undefined) {
641
644
  result.color.x = (0, utils_1.mapNumberRange)(msg.data['currentX'], 0, 65535, 0, 1, 4);
642
645
  }
643
- if (msg.data.hasOwnProperty('currentY')) {
646
+ if (msg.data.currentY !== undefined) {
644
647
  result.color.y = (0, utils_1.mapNumberRange)(msg.data['currentY'], 0, 65535, 0, 1, 4);
645
648
  }
646
- if (msg.data.hasOwnProperty('currentSaturation')) {
649
+ if (msg.data.currentSaturation !== undefined) {
647
650
  result.color.saturation = (0, utils_1.mapNumberRange)(msg.data['currentSaturation'], 0, 254, 0, 100);
648
651
  }
649
- if (msg.data.hasOwnProperty('currentHue')) {
652
+ if (msg.data.currentHue !== undefined) {
650
653
  result.color.hue = (0, utils_1.mapNumberRange)(msg.data['currentHue'], 0, 254, 0, 360, 0);
651
654
  }
652
- if (msg.data.hasOwnProperty('enhancedCurrentHue')) {
655
+ if (msg.data.enhancedCurrentHue !== undefined) {
653
656
  result.color.hue = (0, utils_1.mapNumberRange)(msg.data['enhancedCurrentHue'], 0, 65535, 0, 360, 1);
654
657
  }
655
658
  }
656
- if (msg.data.hasOwnProperty('options')) {
659
+ if (msg.data.options !== undefined) {
657
660
  /*
658
661
  * Bit | Value & Summary
659
662
  * --------------------------
@@ -700,7 +703,7 @@ const converters1 = {
700
703
  const multiplier = msg.endpoint.getClusterAttributeValue('seMetering', 'multiplier');
701
704
  const divisor = msg.endpoint.getClusterAttributeValue('seMetering', 'divisor');
702
705
  const factor = multiplier && divisor ? multiplier / divisor : null;
703
- if (msg.data.hasOwnProperty('instantaneousDemand')) {
706
+ if (msg.data.instantaneousDemand !== undefined) {
704
707
  let power = msg.data['instantaneousDemand'];
705
708
  if (factor != null) {
706
709
  power = power * factor * 1000; // kWh to Watt
@@ -708,14 +711,14 @@ const converters1 = {
708
711
  const property = (0, utils_1.postfixWithEndpointName)('power', msg, model, meta);
709
712
  payload[property] = power;
710
713
  }
711
- if (factor != null && (msg.data.hasOwnProperty('currentSummDelivered') || msg.data.hasOwnProperty('currentSummReceived'))) {
712
- if (msg.data.hasOwnProperty('currentSummDelivered')) {
714
+ if (factor != null && (msg.data.currentSummDelivered !== undefined || msg.data.currentSummReceived !== undefined)) {
715
+ if (msg.data.currentSummDelivered !== undefined) {
713
716
  const data = msg.data['currentSummDelivered'];
714
717
  const value = (parseInt(data[0]) << 32) + parseInt(data[1]);
715
718
  const property = (0, utils_1.postfixWithEndpointName)('energy', msg, model, meta);
716
719
  payload[property] = value * factor;
717
720
  }
718
- if (msg.data.hasOwnProperty('currentSummReceived')) {
721
+ if (msg.data.currentSummReceived !== undefined) {
719
722
  const data = msg.data['currentSummReceived'];
720
723
  const value = (parseInt(data[0]) << 32) + parseInt(data[1]);
721
724
  const property = (0, utils_1.postfixWithEndpointName)('produced_energy', msg, model, meta);
@@ -764,22 +767,22 @@ const converters1 = {
764
767
  ];
765
768
  const payload = {};
766
769
  for (const entry of lookup) {
767
- if (msg.data.hasOwnProperty(entry.key)) {
770
+ if (msg.data[entry.key] !== undefined) {
768
771
  const factor = getFactor(entry.factor);
769
772
  const property = (0, utils_1.postfixWithEndpointName)(entry.name, msg, model, meta);
770
773
  const value = msg.data[entry.key] * factor;
771
774
  payload[property] = value;
772
775
  }
773
776
  }
774
- if (msg.data.hasOwnProperty('powerFactor')) {
777
+ if (msg.data.powerFactor !== undefined) {
775
778
  const property = (0, utils_1.postfixWithEndpointName)('power_factor', msg, model, meta);
776
779
  payload[property] = (0, utils_1.precisionRound)(msg.data['powerFactor'] / 100, 2);
777
780
  }
778
- if (msg.data.hasOwnProperty('powerFactorPhB')) {
781
+ if (msg.data.powerFactorPhB !== undefined) {
779
782
  const property = (0, utils_1.postfixWithEndpointName)('power_factor_phase_b', msg, model, meta);
780
783
  payload[property] = (0, utils_1.precisionRound)(msg.data['powerFactorPhB'] / 100, 2);
781
784
  }
782
- if (msg.data.hasOwnProperty('powerFactorPhC')) {
785
+ if (msg.data.powerFactorPhC !== undefined) {
783
786
  const property = (0, utils_1.postfixWithEndpointName)('power_factor_phase_c', msg, model, meta);
784
787
  payload[property] = (0, utils_1.precisionRound)(msg.data['powerFactorPhC'] / 100, 2);
785
788
  }
@@ -791,7 +794,7 @@ const converters1 = {
791
794
  type: ['attributeReport', 'readResponse'],
792
795
  options: [exposes.options.state_action()],
793
796
  convert: (model, msg, publish, options, meta) => {
794
- if (msg.data.hasOwnProperty('onOff')) {
797
+ if (msg.data.onOff !== undefined) {
795
798
  const payload = {};
796
799
  const property = (0, utils_1.postfixWithEndpointName)('state', msg, model, meta);
797
800
  const state = msg.data['onOff'] === 1 ? 'ON' : 'OFF';
@@ -811,9 +814,9 @@ const converters1 = {
811
814
  // This converted is need instead of `fz.on_off` when no meta: {multiEndpoint: true} can be defined for this device
812
815
  // but it is needed for the `state`. E.g. when a switch has 3 channels (state_l1, state_l2, state_l3) but
813
816
  // has combined power measurements (power, energy))
814
- if (msg.data.hasOwnProperty('onOff')) {
817
+ if (msg.data.onOff !== undefined) {
815
818
  const payload = {};
816
- const endpointName = model.hasOwnProperty('endpoint') ? utils.getKey(model.endpoint(meta.device), msg.endpoint.ID) : msg.endpoint.ID;
819
+ const endpointName = model.endpoint !== undefined ? utils.getKey(model.endpoint(meta.device), msg.endpoint.ID) : msg.endpoint.ID;
817
820
  const state = msg.data['onOff'] === 1 ? 'ON' : 'OFF';
818
821
  payload[`state_${endpointName}`] = state;
819
822
  if (options && options.state_action) {
@@ -831,7 +834,7 @@ const converters1 = {
831
834
  // Device sends multiple messages with the same transactionSequenceNumber,
832
835
  // prevent that multiple messages get send.
833
836
  // https://github.com/Koenkk/zigbee2mqtt/issues/3687
834
- if (msg.data.hasOwnProperty('onOff') && !(0, utils_1.hasAlreadyProcessedMessage)(msg, model)) {
837
+ if (msg.data.onOff !== undefined && !(0, utils_1.hasAlreadyProcessedMessage)(msg, model)) {
835
838
  const payload = {};
836
839
  const property = (0, utils_1.postfixWithEndpointName)('state', msg, model, meta);
837
840
  const state = msg.data['onOff'] === 1 ? 'ON' : 'OFF';
@@ -848,7 +851,7 @@ const converters1 = {
848
851
  type: ['attributeReport', 'readResponse'],
849
852
  convert: (model, msg, publish, options, meta) => {
850
853
  const lookup = { 0: 'off', 1: 'on', 2: 'toggle', 255: 'previous' };
851
- if (msg.data.hasOwnProperty('startUpOnOff')) {
854
+ if (msg.data.startUpOnOff !== undefined) {
852
855
  const property = (0, utils_1.postfixWithEndpointName)('power_on_behavior', msg, model, meta);
853
856
  return { [property]: lookup[msg.data['startUpOnOff']] };
854
857
  }
@@ -923,7 +926,7 @@ const converters1 = {
923
926
  options: [exposes.options.vibration_timeout()],
924
927
  convert: (model, msg, publish, options, meta) => {
925
928
  const zoneStatus = msg.data.zonestatus;
926
- const timeout = options && options.hasOwnProperty('vibration_timeout') ? Number(options.vibration_timeout) : 90;
929
+ const timeout = options && options.vibration_timeout !== undefined ? Number(options.vibration_timeout) : 90;
927
930
  // Stop existing timers because vibration is detected and set a new one.
928
931
  globalStore.getValue(msg.endpoint, 'timers', []).forEach((t) => clearTimeout(t));
929
932
  globalStore.putValue(msg.endpoint, 'timers', []);
@@ -1112,7 +1115,7 @@ const converters1 = {
1112
1115
  options: [exposes.options.occupancy_timeout()],
1113
1116
  convert: (model, msg, publish, options, meta) => {
1114
1117
  const zoneStatus = msg.data.zonestatus;
1115
- const timeout = options && options.hasOwnProperty('occupancy_timeout') ? Number(options.occupancy_timeout) : 90;
1118
+ const timeout = options && options.occupancy_timeout !== undefined ? Number(options.occupancy_timeout) : 90;
1116
1119
  clearTimeout(globalStore.getValue(msg.endpoint, 'timer'));
1117
1120
  if (timeout !== 0) {
1118
1121
  const timer = setTimeout(() => publish({ occupancy: false }), timeout * 1000);
@@ -1288,8 +1291,8 @@ const converters1 = {
1288
1291
  (0, utils_1.addActionGroup)(payload, msg, model);
1289
1292
  if (options.simulated_brightness) {
1290
1293
  const opts = options.simulated_brightness;
1291
- const deltaOpts = typeof opts === 'object' && opts.hasOwnProperty('delta') ? opts.delta : 20;
1292
- const intervalOpts = typeof opts === 'object' && opts.hasOwnProperty('interval') ? opts.interval : 200;
1294
+ const deltaOpts = typeof opts === 'object' && opts.delta !== undefined ? opts.delta : 20;
1295
+ const intervalOpts = typeof opts === 'object' && opts.interval !== undefined ? opts.interval : 200;
1293
1296
  globalStore.putValue(msg.endpoint, 'simulated_brightness_direction', direction);
1294
1297
  if (globalStore.getValue(msg.endpoint, 'simulated_brightness_timer') === undefined) {
1295
1298
  const timer = setInterval(() => {
@@ -1376,7 +1379,7 @@ const converters1 = {
1376
1379
  action: (0, utils_1.postfixWithEndpointName)(`color_temperature_step_${direction}`, msg, model, meta),
1377
1380
  action_step_size: msg.data.stepsize,
1378
1381
  };
1379
- if (msg.data.hasOwnProperty('transtime')) {
1382
+ if (msg.data.transtime !== undefined) {
1380
1383
  payload.action_transition_time = msg.data.transtime / 100;
1381
1384
  }
1382
1385
  (0, utils_1.addActionGroup)(payload, msg, model);
@@ -1605,7 +1608,7 @@ const converters1 = {
1605
1608
  const metaInvert = model.meta && model.meta.coverInverted;
1606
1609
  const invert = metaInvert ? !options.invert_cover : options.invert_cover;
1607
1610
  const coverStateFromTilt = model.meta && model.meta.coverStateFromTilt;
1608
- if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] <= 100) {
1611
+ if (msg.data.currentPositionLiftPercentage !== undefined && msg.data['currentPositionLiftPercentage'] <= 100) {
1609
1612
  const value = msg.data['currentPositionLiftPercentage'];
1610
1613
  result[(0, utils_1.postfixWithEndpointName)('position', msg, model, meta)] = invert ? value : 100 - value;
1611
1614
  if (!coverStateFromTilt) {
@@ -1618,7 +1621,7 @@ const converters1 = {
1618
1621
  : 'OPEN';
1619
1622
  }
1620
1623
  }
1621
- if (msg.data.hasOwnProperty('currentPositionTiltPercentage') && msg.data['currentPositionTiltPercentage'] <= 100) {
1624
+ if (msg.data.currentPositionTiltPercentage !== undefined && msg.data['currentPositionTiltPercentage'] <= 100) {
1622
1625
  const value = msg.data['currentPositionTiltPercentage'];
1623
1626
  result[(0, utils_1.postfixWithEndpointName)('tilt', msg, model, meta)] = invert ? value : 100 - value;
1624
1627
  if (coverStateFromTilt) {
@@ -1631,7 +1634,7 @@ const converters1 = {
1631
1634
  : 'CLOSE';
1632
1635
  }
1633
1636
  }
1634
- if (msg.data.hasOwnProperty('windowCoveringMode')) {
1637
+ if (msg.data.windowCoveringMode !== undefined) {
1635
1638
  result[(0, utils_1.postfixWithEndpointName)('cover_mode', msg, model, meta)] = {
1636
1639
  reversed: (msg.data.windowCoveringMode & (1 << 0)) > 0,
1637
1640
  calibration: (msg.data.windowCoveringMode & (1 << 1)) > 0,
@@ -1658,7 +1661,7 @@ const converters1 = {
1658
1661
  cluster: 'genOnOff',
1659
1662
  type: ['attributeReport', 'readResponse'],
1660
1663
  convert: (model, msg, publish, options, meta) => {
1661
- if (msg.data.hasOwnProperty('onOff')) {
1664
+ if (msg.data.onOff !== undefined) {
1662
1665
  return { state: msg.data['onOff'] === 1 ? 'OPEN' : 'CLOSE' };
1663
1666
  }
1664
1667
  },
@@ -1678,49 +1681,49 @@ const converters1 = {
1678
1681
  type: ['attributeReport', 'readResponse'],
1679
1682
  convert: (model, msg, publish, options, meta) => {
1680
1683
  const result = {};
1681
- if (msg.data.hasOwnProperty('ballastStatus')) {
1684
+ if (msg.data.ballastStatus !== undefined) {
1682
1685
  const ballastStatus = msg.data.ballastStatus;
1683
1686
  result['ballast_status_non_operational'] = ballastStatus & 1 ? true : false;
1684
1687
  result['ballast_status_lamp_failure'] = ballastStatus & 2 ? true : false;
1685
1688
  }
1686
- if (msg.data.hasOwnProperty('minLevel')) {
1689
+ if (msg.data.minLevel !== undefined) {
1687
1690
  result['ballast_minimum_level'] = msg.data.minLevel;
1688
1691
  }
1689
- if (msg.data.hasOwnProperty('maxLevel')) {
1692
+ if (msg.data.maxLevel !== undefined) {
1690
1693
  result['ballast_maximum_level'] = msg.data.maxLevel;
1691
1694
  }
1692
- if (msg.data.hasOwnProperty('powerOnLevel')) {
1695
+ if (msg.data.powerOnLevel !== undefined) {
1693
1696
  result['ballast_power_on_level'] = msg.data.powerOnLevel;
1694
1697
  }
1695
- if (msg.data.hasOwnProperty('powerOnFadeTime')) {
1698
+ if (msg.data.powerOnFadeTime !== undefined) {
1696
1699
  result['ballast_power_on_fade_time'] = msg.data.powerOnFadeTime;
1697
1700
  }
1698
- if (msg.data.hasOwnProperty('intrinsicBallastFactor')) {
1701
+ if (msg.data.intrinsicBallastFactor !== undefined) {
1699
1702
  result['ballast_intrinsic_ballast_factor'] = msg.data.intrinsicBallastFactor;
1700
1703
  }
1701
- if (msg.data.hasOwnProperty('ballastFactorAdjustment')) {
1704
+ if (msg.data.ballastFactorAdjustment !== undefined) {
1702
1705
  result['ballast_ballast_factor_adjustment'] = msg.data.ballastFactorAdjustment;
1703
1706
  }
1704
- if (msg.data.hasOwnProperty('lampQuantity')) {
1707
+ if (msg.data.lampQuantity !== undefined) {
1705
1708
  result['ballast_lamp_quantity'] = msg.data.lampQuantity;
1706
1709
  }
1707
- if (msg.data.hasOwnProperty('lampType')) {
1710
+ if (msg.data.lampType !== undefined) {
1708
1711
  result['ballast_lamp_type'] = msg.data.lampType;
1709
1712
  }
1710
- if (msg.data.hasOwnProperty('lampManufacturer')) {
1713
+ if (msg.data.lampManufacturer !== undefined) {
1711
1714
  result['ballast_lamp_manufacturer'] = msg.data.lampManufacturer;
1712
1715
  }
1713
- if (msg.data.hasOwnProperty('lampRatedHours')) {
1716
+ if (msg.data.lampRatedHours !== undefined) {
1714
1717
  result['ballast_lamp_rated_hours'] = msg.data.lampRatedHours;
1715
1718
  }
1716
- if (msg.data.hasOwnProperty('lampBurnHours')) {
1719
+ if (msg.data.lampBurnHours !== undefined) {
1717
1720
  result['ballast_lamp_burn_hours'] = msg.data.lampBurnHours;
1718
1721
  }
1719
- if (msg.data.hasOwnProperty('lampAlarmMode')) {
1722
+ if (msg.data.lampAlarmMode !== undefined) {
1720
1723
  const lampAlarmMode = msg.data.lampAlarmMode;
1721
1724
  result['ballast_lamp_alarm_lamp_burn_hours'] = lampAlarmMode & 1 ? true : false;
1722
1725
  }
1723
- if (msg.data.hasOwnProperty('lampBurnHoursTripPoint')) {
1726
+ if (msg.data.lampBurnHoursTripPoint !== undefined) {
1724
1727
  result['ballast_lamp_burn_hours_trip_point'] = msg.data.lampBurnHoursTripPoint;
1725
1728
  }
1726
1729
  return result;
@@ -1731,7 +1734,7 @@ const converters1 = {
1731
1734
  type: ['commandCheckin'],
1732
1735
  options: [exposes.options.presence_timeout()],
1733
1736
  convert: (model, msg, publish, options, meta) => {
1734
- const useOptionsTimeout = options && options.hasOwnProperty('presence_timeout');
1737
+ const useOptionsTimeout = options && options.presence_timeout !== undefined;
1735
1738
  const timeout = useOptionsTimeout ? Number(options.presence_timeout) : 100; // 100 seconds by default
1736
1739
  // Stop existing timer because presence is detected and set a new one.
1737
1740
  clearTimeout(globalStore.getValue(msg.endpoint, 'timer'));
@@ -1759,7 +1762,7 @@ const converters1 = {
1759
1762
  type: ['attributeReport', 'readResponse'],
1760
1763
  convert: (model, msg, publish, options, meta) => {
1761
1764
  const result = {};
1762
- if (msg.data.hasOwnProperty('maxDuration'))
1765
+ if (msg.data.maxDuration !== undefined)
1763
1766
  result['max_duration'] = msg.data.maxDuration;
1764
1767
  return result;
1765
1768
  },
@@ -1769,7 +1772,7 @@ const converters1 = {
1769
1772
  type: ['attributeReport', 'readResponse'],
1770
1773
  convert: (model, msg, publish, options, meta) => {
1771
1774
  const payload = {};
1772
- if (msg.data.hasOwnProperty('powerSource')) {
1775
+ if (msg.data.powerSource !== undefined) {
1773
1776
  const value = msg.data['powerSource'];
1774
1777
  const lookup = {
1775
1778
  0: 'unknown',
@@ -1799,66 +1802,66 @@ const converters1 = {
1799
1802
  convert: (model, msg, publish, options, meta) => {
1800
1803
  const result = {};
1801
1804
  const data = msg.data;
1802
- if (data.hasOwnProperty(0x1000)) {
1805
+ if (data[0x1000] !== undefined) {
1803
1806
  // Display brightness
1804
1807
  const lookup = { 0: 'low', 1: 'mid', 2: 'high' };
1805
1808
  result.lcd_brightness = lookup[data[0x1000]];
1806
1809
  }
1807
- if (data.hasOwnProperty(0x1001)) {
1810
+ if (data[0x1001] !== undefined) {
1808
1811
  // Button vibration level
1809
1812
  const lookup = { 0: 'off', 1: 'low', 2: 'high' };
1810
1813
  result.button_vibration_level = lookup[data[0x1001]];
1811
1814
  }
1812
- if (data.hasOwnProperty(0x1002)) {
1815
+ if (data[0x1002] !== undefined) {
1813
1816
  // Floor sensor type
1814
1817
  const lookup = { 1: '10k', 2: '15k', 3: '50k', 4: '100k', 5: '12k' };
1815
1818
  result.floor_sensor_type = lookup[data[0x1002]];
1816
1819
  }
1817
- if (data.hasOwnProperty(0x1003)) {
1820
+ if (data[0x1003] !== undefined) {
1818
1821
  // Sensor
1819
1822
  const lookup = { 0: 'air', 1: 'floor', 2: 'both' };
1820
1823
  result.sensor = lookup[data[0x1003]];
1821
1824
  }
1822
- if (data.hasOwnProperty(0x1004)) {
1825
+ if (data[0x1004] !== undefined) {
1823
1826
  // PowerUpStatus
1824
1827
  const lookup = { 0: 'default', 1: 'last_status' };
1825
1828
  result.powerup_status = lookup[data[0x1004]];
1826
1829
  }
1827
- if (data.hasOwnProperty(0x1005)) {
1830
+ if (data[0x1005] !== undefined) {
1828
1831
  // FloorSensorCalibration
1829
1832
  result.floor_sensor_calibration = (0, utils_1.precisionRound)(data[0x1005], 2) / 10;
1830
1833
  }
1831
- if (data.hasOwnProperty(0x1006)) {
1834
+ if (data[0x1006] !== undefined) {
1832
1835
  // DryTime
1833
1836
  result.dry_time = data[0x1006];
1834
1837
  }
1835
- if (data.hasOwnProperty(0x1007)) {
1838
+ if (data[0x1007] !== undefined) {
1836
1839
  // ModeAfterDry
1837
1840
  const lookup = { 0: 'off', 1: 'manual', 2: 'auto', 3: 'away' };
1838
1841
  result.mode_after_dry = lookup[data[0x1007]];
1839
1842
  }
1840
- if (data.hasOwnProperty(0x1008)) {
1843
+ if (data[0x1008] !== undefined) {
1841
1844
  // TemperatureDisplay
1842
1845
  const lookup = { 0: 'room', 1: 'floor' };
1843
1846
  result.temperature_display = lookup[data[0x1008]];
1844
1847
  }
1845
- if (data.hasOwnProperty(0x1009)) {
1848
+ if (data[0x1009] !== undefined) {
1846
1849
  // WindowOpenCheck
1847
1850
  result.window_open_check = data[0x1009] / 2;
1848
1851
  }
1849
- if (data.hasOwnProperty(0x100a)) {
1852
+ if (data[0x100a] !== undefined) {
1850
1853
  // Hysterersis
1851
1854
  result.hysterersis = (0, utils_1.precisionRound)(data[0x100a], 2) / 10;
1852
1855
  }
1853
- if (data.hasOwnProperty(0x100b)) {
1856
+ if (data[0x100b] !== undefined) {
1854
1857
  // DisplayAutoOffEnable
1855
1858
  result.display_auto_off_enabled = data[0x100b] ? 'enabled' : 'disabled';
1856
1859
  }
1857
- if (data.hasOwnProperty(0x2001)) {
1860
+ if (data[0x2001] !== undefined) {
1858
1861
  // AlarmAirTempOverValue
1859
1862
  result.alarm_airtemp_overvalue = data[0x2001];
1860
1863
  }
1861
- if (data.hasOwnProperty(0x2002)) {
1864
+ if (data[0x2002] !== undefined) {
1862
1865
  // Away Mode Set
1863
1866
  result.away_mode = data[0x2002] ? 'ON' : 'OFF';
1864
1867
  }
@@ -1870,7 +1873,7 @@ const converters1 = {
1870
1873
  type: ['attributeReport', 'readResponse'],
1871
1874
  convert: (model, msg, publish, options, meta) => {
1872
1875
  const result = {};
1873
- if (msg.data.hasOwnProperty('keypadLockout')) {
1876
+ if (msg.data.keypadLockout !== undefined) {
1874
1877
  // Set as child lock instead as keypadlockout
1875
1878
  result.child_lock = msg.data['keypadLockout'] === 0 ? 'UNLOCK' : 'LOCK';
1876
1879
  }
@@ -1883,23 +1886,23 @@ const converters1 = {
1883
1886
  convert: (model, msg, publish, options, meta) => {
1884
1887
  const result = {};
1885
1888
  const data = msg.data;
1886
- if (data.hasOwnProperty('elkoDisplayText')) {
1889
+ if (data.elkoDisplayText !== undefined) {
1887
1890
  // Display text
1888
1891
  result.display_text = data['elkoDisplayText'];
1889
1892
  }
1890
- if (data.hasOwnProperty('elkoPowerStatus')) {
1893
+ if (data.elkoPowerStatus !== undefined) {
1891
1894
  // Power status
1892
1895
  result.system_mode = data['elkoPowerStatus'] ? 'heat' : 'off';
1893
1896
  }
1894
- if (data.hasOwnProperty('elkoExternalTemp')) {
1897
+ if (data.elkoExternalTemp !== undefined) {
1895
1898
  // External temp (floor)
1896
1899
  result.floor_temp = utils.precisionRound(data['elkoExternalTemp'], 2) / 100;
1897
1900
  }
1898
- if (data.hasOwnProperty('elkoRelayState')) {
1901
+ if (data.elkoRelayState !== undefined) {
1899
1902
  // Relay state
1900
1903
  result.running_state = data['elkoRelayState'] ? 'heat' : 'idle';
1901
1904
  }
1902
- if (data.hasOwnProperty('elkoCalibration')) {
1905
+ if (data.elkoCalibration !== undefined) {
1903
1906
  // Calibration
1904
1907
  result.local_temperature_calibration = (0, utils_1.precisionRound)(data['elkoCalibration'], 2) / 10;
1905
1908
  }
@@ -1925,23 +1928,23 @@ const converters1 = {
1925
1928
  type: ['attributeReport', 'readResponse'],
1926
1929
  convert: (model, msg, publish, options, meta) => {
1927
1930
  const result = {};
1928
- if (msg.data.hasOwnProperty('alarm_temperature_max')) {
1931
+ if (msg.data.alarm_temperature_max !== undefined) {
1929
1932
  result.alarm_temperature_max = msg.data['alarm_temperature_max'];
1930
1933
  }
1931
- if (msg.data.hasOwnProperty('alarm_temperature_min')) {
1934
+ if (msg.data.alarm_temperature_min !== undefined) {
1932
1935
  result.alarm_temperature_min = msg.data['alarm_temperature_min'];
1933
1936
  }
1934
- if (msg.data.hasOwnProperty('alarm_humidity_max')) {
1937
+ if (msg.data.alarm_humidity_max !== undefined) {
1935
1938
  result.alarm_humidity_max = msg.data['alarm_humidity_max'];
1936
1939
  }
1937
- if (msg.data.hasOwnProperty('alarm_humidity_min')) {
1940
+ if (msg.data.alarm_humidity_min !== undefined) {
1938
1941
  result.alarm_humidity_min = msg.data['alarm_humidity_min'];
1939
1942
  }
1940
- if (msg.data.hasOwnProperty('alarm_humidity')) {
1943
+ if (msg.data.alarm_humidity !== undefined) {
1941
1944
  const sensorAlarmLookup = { '0': 'below_min_humdity', '1': 'over_humidity', '2': 'off' };
1942
1945
  result.alarm_humidity = sensorAlarmLookup[msg.data['alarm_humidity']];
1943
1946
  }
1944
- if (msg.data.hasOwnProperty('alarm_temperature')) {
1947
+ if (msg.data.alarm_temperature !== undefined) {
1945
1948
  const sensorAlarmLookup = { '0': 'below_min_temperature', '1': 'over_temperature', '2': 'off' };
1946
1949
  result.alarm_temperature = sensorAlarmLookup[msg.data['alarm_temperature']];
1947
1950
  }
@@ -1954,14 +1957,14 @@ const converters1 = {
1954
1957
  options: [exposes.options.color_sync()],
1955
1958
  convert: (model, msg, publish, options, meta) => {
1956
1959
  const result = {};
1957
- if (msg.data.hasOwnProperty('colorTemperature')) {
1960
+ if (msg.data.colorTemperature !== undefined) {
1958
1961
  const value = Number(msg.data['colorTemperature']);
1959
1962
  result.color_temp = (0, utils_1.mapNumberRange)(value, 0, 255, 500, 153);
1960
1963
  }
1961
- if (msg.data.hasOwnProperty('tuyaBrightness')) {
1964
+ if (msg.data.tuyaBrightness !== undefined) {
1962
1965
  result.brightness = msg.data['tuyaBrightness'];
1963
1966
  }
1964
- if (msg.data.hasOwnProperty('tuyaRgbMode')) {
1967
+ if (msg.data.tuyaRgbMode !== undefined) {
1965
1968
  if (msg.data['tuyaRgbMode'] === 1) {
1966
1969
  result.color_mode = constants.colorModeLookup[0];
1967
1970
  }
@@ -1970,11 +1973,11 @@ const converters1 = {
1970
1973
  }
1971
1974
  }
1972
1975
  result.color = {};
1973
- if (msg.data.hasOwnProperty('currentHue')) {
1976
+ if (msg.data.currentHue !== undefined) {
1974
1977
  result.color.hue = (0, utils_1.mapNumberRange)(msg.data['currentHue'], 0, 254, 0, 360);
1975
1978
  result.color.h = result.color.hue;
1976
1979
  }
1977
- if (msg.data.hasOwnProperty('currentSaturation')) {
1980
+ if (msg.data.currentSaturation !== undefined) {
1978
1981
  result.color.saturation = (0, utils_1.mapNumberRange)(msg.data['currentSaturation'], 0, 254, 0, 100);
1979
1982
  result.color.s = result.color.saturation;
1980
1983
  }
@@ -2112,12 +2115,12 @@ const converters1 = {
2112
2115
  type: ['attributeReport', 'readResponse'],
2113
2116
  convert: (model, msg, publish, options, meta) => {
2114
2117
  const result = {};
2115
- if (msg.data.hasOwnProperty('maxDuration'))
2118
+ if (msg.data.maxDuration !== undefined)
2116
2119
  result['duration'] = msg.data.maxDuration;
2117
- if (msg.data.hasOwnProperty('2')) {
2120
+ if (msg.data['2'] !== undefined) {
2118
2121
  result['volume'] = (0, utils_1.mapNumberRange)(msg.data['2'], 100, 10, 0, 100);
2119
2122
  }
2120
- if (msg.data.hasOwnProperty('61440')) {
2123
+ if (msg.data['61440'] !== undefined) {
2121
2124
  result['alarm'] = msg.data['61440'] == 0 ? false : true;
2122
2125
  }
2123
2126
  return result;
@@ -2128,11 +2131,11 @@ const converters1 = {
2128
2131
  type: ['attributeReport', 'readResponse'],
2129
2132
  convert: (model, msg, publish, options, meta) => {
2130
2133
  const result = {};
2131
- if (msg.data.hasOwnProperty('moesCalibrationTime')) {
2134
+ if (msg.data.moesCalibrationTime !== undefined) {
2132
2135
  const value = parseFloat(msg.data['moesCalibrationTime']) / 100;
2133
2136
  result[(0, utils_1.postfixWithEndpointName)('calibration_time', msg, model, meta)] = value;
2134
2137
  }
2135
- if (msg.data.hasOwnProperty('tuyaMotorReversal')) {
2138
+ if (msg.data.tuyaMotorReversal !== undefined) {
2136
2139
  const value = msg.data['tuyaMotorReversal'];
2137
2140
  const reversalLookup = { 0: 'OFF', 1: 'ON' };
2138
2141
  result[(0, utils_1.postfixWithEndpointName)('motor_reversal', msg, model, meta)] = reversalLookup[value];
@@ -2145,22 +2148,22 @@ const converters1 = {
2145
2148
  type: ['attributeReport', 'readResponse'],
2146
2149
  convert: (model, msg, publish, options, meta) => {
2147
2150
  const result = {};
2148
- if (msg.data.hasOwnProperty('tuyaMovingState')) {
2151
+ if (msg.data.tuyaMovingState !== undefined) {
2149
2152
  const value = msg.data['tuyaMovingState'];
2150
2153
  const movingLookup = { 0: 'UP', 1: 'STOP', 2: 'DOWN' };
2151
2154
  result[(0, utils_1.postfixWithEndpointName)('moving', msg, model, meta)] = movingLookup[value];
2152
2155
  }
2153
- if (msg.data.hasOwnProperty('tuyaCalibration')) {
2156
+ if (msg.data.tuyaCalibration !== undefined) {
2154
2157
  const value = msg.data['tuyaCalibration'];
2155
2158
  const calibrationLookup = { 0: 'ON', 1: 'OFF' };
2156
2159
  result[(0, utils_1.postfixWithEndpointName)('calibration', msg, model, meta)] = calibrationLookup[value];
2157
2160
  }
2158
- if (msg.data.hasOwnProperty('tuyaMotorReversal')) {
2161
+ if (msg.data.tuyaMotorReversal !== undefined) {
2159
2162
  const value = msg.data['tuyaMotorReversal'];
2160
2163
  const reversalLookup = { 0: 'OFF', 1: 'ON' };
2161
2164
  result[(0, utils_1.postfixWithEndpointName)('motor_reversal', msg, model, meta)] = reversalLookup[value];
2162
2165
  }
2163
- if (msg.data.hasOwnProperty('moesCalibrationTime')) {
2166
+ if (msg.data.moesCalibrationTime !== undefined) {
2164
2167
  const value = parseFloat(msg.data['moesCalibrationTime']) / 10.0;
2165
2168
  result[(0, utils_1.postfixWithEndpointName)('calibration_time', msg, model, meta)] = value;
2166
2169
  }
@@ -2311,8 +2314,7 @@ const converters1 = {
2311
2314
  convert: (model, msg, publish, options, meta) => {
2312
2315
  const dp = msg.data[10];
2313
2316
  const defaults = { motor_direction: 'FORWARD', motor_speed: 40 };
2314
- // @ts-expect-error
2315
- if ((msg.data[0] === 0x7a) & (msg.data[1] === 0xd1)) {
2317
+ if (msg.data[0] === 0x7a && msg.data[1] === 0xd1) {
2316
2318
  const reportType = msg.data[12];
2317
2319
  switch (dp) {
2318
2320
  case 0x0c:
@@ -2584,7 +2586,7 @@ const converters1 = {
2584
2586
  if (endpoint && (endpoint.supportsInputCluster(cluster) || endpoint.supportsOutputCluster(cluster))) {
2585
2587
  payload['brightness_' + name] = msg.data['presentValue'];
2586
2588
  }
2587
- else if (msg.data.hasOwnProperty('description')) {
2589
+ else if (msg.data.description !== undefined) {
2588
2590
  const data1 = msg.data['description'];
2589
2591
  if (data1) {
2590
2592
  const data2 = data1.split(',');
@@ -2668,7 +2670,7 @@ const converters1 = {
2668
2670
  type: ['readResponse', 'attributeReport'],
2669
2671
  convert: (model, msg, publish, options, meta) => {
2670
2672
  const payload = {};
2671
- if (msg.data.hasOwnProperty('mainsVoltage')) {
2673
+ if (msg.data.mainsVoltage !== undefined) {
2672
2674
  payload.voltage = msg.data['mainsVoltage'];
2673
2675
  if (model.meta && model.meta.battery && model.meta.battery.voltageToPercentage) {
2674
2676
  payload.battery = (0, utils_1.batteryVoltageToPercentage)(payload.voltage, model.meta.battery.voltageToPercentage);
@@ -2736,50 +2738,50 @@ const converters1 = {
2736
2738
  convert: (model, msg, publish, options, meta) => {
2737
2739
  const result = {};
2738
2740
  // typo on property name to stick with zcl definition
2739
- if (msg.data.hasOwnProperty('inletTempreature')) {
2741
+ if (msg.data.inletTempreature !== undefined) {
2740
2742
  result.inlet_temperature = (0, utils_1.precisionRound)(msg.data['inletTempreature'], 2);
2741
2743
  result.inletTemperature = result.inlet_temperature; // deprecated
2742
2744
  }
2743
- if (msg.data.hasOwnProperty('status')) {
2745
+ if (msg.data.status !== undefined) {
2744
2746
  result.status = (0, utils_1.precisionRound)(msg.data['status'], 2);
2745
2747
  }
2746
- if (msg.data.hasOwnProperty('8192')) {
2748
+ if (msg.data['8192'] !== undefined) {
2747
2749
  result.line_frequency = (0, utils_1.precisionRound)(parseFloat(msg.data['8192']) / 100.0, 2);
2748
2750
  result.linefrequency = result.line_frequency; // deprecated
2749
2751
  }
2750
- if (msg.data.hasOwnProperty('8193')) {
2752
+ if (msg.data['8193'] !== undefined) {
2751
2753
  result.power = (0, utils_1.precisionRound)(msg.data['8193'], 2);
2752
2754
  }
2753
- if (msg.data.hasOwnProperty('8196')) {
2755
+ if (msg.data['8196'] !== undefined) {
2754
2756
  result.voltage = (0, utils_1.precisionRound)(msg.data['8196'], 2);
2755
2757
  }
2756
- if (msg.data.hasOwnProperty('8213')) {
2758
+ if (msg.data['8213'] !== undefined) {
2757
2759
  result.voltage = (0, utils_1.precisionRound)(msg.data['8213'], 2);
2758
2760
  }
2759
- if (msg.data.hasOwnProperty('8199')) {
2761
+ if (msg.data['8199'] !== undefined) {
2760
2762
  result.current = (0, utils_1.precisionRound)(msg.data['8199'], 2);
2761
2763
  }
2762
- if (msg.data.hasOwnProperty('8216')) {
2764
+ if (msg.data['8216'] !== undefined) {
2763
2765
  result.current = (0, utils_1.precisionRound)(msg.data['8216'], 2);
2764
2766
  }
2765
- if (msg.data.hasOwnProperty('8202')) {
2767
+ if (msg.data['8202'] !== undefined) {
2766
2768
  result.reactive_power = (0, utils_1.precisionRound)(msg.data['8202'], 2);
2767
2769
  result.reactivepower = result.reactive_power; // deprecated
2768
2770
  }
2769
- if (msg.data.hasOwnProperty('12288')) {
2771
+ if (msg.data['12288'] !== undefined) {
2770
2772
  result.energy_consumed = (0, utils_1.precisionRound)(msg.data['12288'], 2); // deprecated
2771
2773
  result.energyconsumed = result.energy_consumed; // deprecated
2772
2774
  result.energy = result.energy_consumed;
2773
2775
  }
2774
- if (msg.data.hasOwnProperty('12291')) {
2776
+ if (msg.data['12291'] !== undefined) {
2775
2777
  result.energy_produced = (0, utils_1.precisionRound)(msg.data['12291'], 2);
2776
2778
  result.energyproduced = result.energy_produced; // deprecated
2777
2779
  }
2778
- if (msg.data.hasOwnProperty('12294')) {
2780
+ if (msg.data['12294'] !== undefined) {
2779
2781
  result.reactive_summation = (0, utils_1.precisionRound)(msg.data['12294'], 2);
2780
2782
  result.reactivesummation = result.reactive_summation; // deprecated
2781
2783
  }
2782
- if (msg.data.hasOwnProperty('16408')) {
2784
+ if (msg.data['16408'] !== undefined) {
2783
2785
  result.measure_serial = (0, utils_1.precisionRound)(msg.data['16408'], 2);
2784
2786
  result.measureserial = result.measure_serial; // deprecated
2785
2787
  }
@@ -2791,50 +2793,52 @@ const converters1 = {
2791
2793
  type: ['attributeReport', 'readResponse'],
2792
2794
  convert: (model, msg, publish, options, meta) => {
2793
2795
  const result = {};
2794
- if (msg.data.hasOwnProperty('danfossWindowOpenFeatureEnable')) {
2796
+ if (msg.data.danfossWindowOpenFeatureEnable !== undefined) {
2795
2797
  result[(0, utils_1.postfixWithEndpointName)('window_open_feature', msg, model, meta)] = msg.data['danfossWindowOpenFeatureEnable'] === 1;
2796
2798
  }
2797
- if (msg.data.hasOwnProperty('danfossWindowOpenInternal')) {
2798
- result[(0, utils_1.postfixWithEndpointName)('window_open_internal', msg, model, meta)] = constants.danfossWindowOpen.hasOwnProperty(msg.data['danfossWindowOpenInternal'])
2799
- ? constants.danfossWindowOpen[msg.data['danfossWindowOpenInternal']]
2800
- : msg.data['danfossWindowOpenInternal'];
2799
+ if (msg.data.danfossWindowOpenInternal !== undefined) {
2800
+ result[(0, utils_1.postfixWithEndpointName)('window_open_internal', msg, model, meta)] =
2801
+ constants.danfossWindowOpen[msg.data['danfossWindowOpenInternal']] !== undefined
2802
+ ? constants.danfossWindowOpen[msg.data['danfossWindowOpenInternal']]
2803
+ : msg.data['danfossWindowOpenInternal'];
2801
2804
  }
2802
- if (msg.data.hasOwnProperty('danfossWindowOpenExternal')) {
2805
+ if (msg.data.danfossWindowOpenExternal !== undefined) {
2803
2806
  result[(0, utils_1.postfixWithEndpointName)('window_open_external', msg, model, meta)] = msg.data['danfossWindowOpenExternal'] === 1;
2804
2807
  }
2805
- if (msg.data.hasOwnProperty('danfossDayOfWeek')) {
2806
- result[(0, utils_1.postfixWithEndpointName)('day_of_week', msg, model, meta)] = constants.thermostatDayOfWeek.hasOwnProperty(msg.data['danfossDayOfWeek'])
2807
- ? constants.thermostatDayOfWeek[msg.data['danfossDayOfWeek']]
2808
- : msg.data['danfossDayOfWeek'];
2808
+ if (msg.data.danfossDayOfWeek !== undefined) {
2809
+ result[(0, utils_1.postfixWithEndpointName)('day_of_week', msg, model, meta)] =
2810
+ constants.thermostatDayOfWeek[msg.data['danfossDayOfWeek']] !== undefined
2811
+ ? constants.thermostatDayOfWeek[msg.data['danfossDayOfWeek']]
2812
+ : msg.data['danfossDayOfWeek'];
2809
2813
  }
2810
- if (msg.data.hasOwnProperty('danfossTriggerTime')) {
2814
+ if (msg.data.danfossTriggerTime !== undefined) {
2811
2815
  result[(0, utils_1.postfixWithEndpointName)('trigger_time', msg, model, meta)] = msg.data['danfossTriggerTime'];
2812
2816
  }
2813
- if (msg.data.hasOwnProperty('danfossMountedModeActive')) {
2817
+ if (msg.data.danfossMountedModeActive !== undefined) {
2814
2818
  result[(0, utils_1.postfixWithEndpointName)('mounted_mode_active', msg, model, meta)] = msg.data['danfossMountedModeActive'] === 1;
2815
2819
  }
2816
- if (msg.data.hasOwnProperty('danfossMountedModeControl')) {
2820
+ if (msg.data.danfossMountedModeControl !== undefined) {
2817
2821
  result[(0, utils_1.postfixWithEndpointName)('mounted_mode_control', msg, model, meta)] = msg.data['danfossMountedModeControl'] === 1;
2818
2822
  }
2819
- if (msg.data.hasOwnProperty('danfossThermostatOrientation')) {
2823
+ if (msg.data.danfossThermostatOrientation !== undefined) {
2820
2824
  result[(0, utils_1.postfixWithEndpointName)('thermostat_vertical_orientation', msg, model, meta)] = msg.data['danfossThermostatOrientation'] === 1;
2821
2825
  }
2822
- if (msg.data.hasOwnProperty('danfossExternalMeasuredRoomSensor')) {
2826
+ if (msg.data.danfossExternalMeasuredRoomSensor !== undefined) {
2823
2827
  result[(0, utils_1.postfixWithEndpointName)('external_measured_room_sensor', msg, model, meta)] = msg.data['danfossExternalMeasuredRoomSensor'];
2824
2828
  }
2825
- if (msg.data.hasOwnProperty('danfossRadiatorCovered')) {
2829
+ if (msg.data.danfossRadiatorCovered !== undefined) {
2826
2830
  result[(0, utils_1.postfixWithEndpointName)('radiator_covered', msg, model, meta)] = msg.data['danfossRadiatorCovered'] === 1;
2827
2831
  }
2828
- if (msg.data.hasOwnProperty('danfossViewingDirection')) {
2832
+ if (msg.data.danfossViewingDirection !== undefined) {
2829
2833
  result[(0, utils_1.postfixWithEndpointName)('viewing_direction', msg, model, meta)] = msg.data['danfossViewingDirection'] === 1;
2830
2834
  }
2831
- if (msg.data.hasOwnProperty('danfossAlgorithmScaleFactor')) {
2835
+ if (msg.data.danfossAlgorithmScaleFactor !== undefined) {
2832
2836
  result[(0, utils_1.postfixWithEndpointName)('algorithm_scale_factor', msg, model, meta)] = msg.data['danfossAlgorithmScaleFactor'];
2833
2837
  }
2834
- if (msg.data.hasOwnProperty('danfossHeatAvailable')) {
2838
+ if (msg.data.danfossHeatAvailable !== undefined) {
2835
2839
  result[(0, utils_1.postfixWithEndpointName)('heat_available', msg, model, meta)] = msg.data['danfossHeatAvailable'] === 1;
2836
2840
  }
2837
- if (msg.data.hasOwnProperty('danfossHeatRequired')) {
2841
+ if (msg.data.danfossHeatRequired !== undefined) {
2838
2842
  if (msg.data['danfossHeatRequired'] === 1) {
2839
2843
  result[(0, utils_1.postfixWithEndpointName)('heat_required', msg, model, meta)] = true;
2840
2844
  result[(0, utils_1.postfixWithEndpointName)('running_state', msg, model, meta)] = 'heat';
@@ -2844,39 +2848,40 @@ const converters1 = {
2844
2848
  result[(0, utils_1.postfixWithEndpointName)('running_state', msg, model, meta)] = 'idle';
2845
2849
  }
2846
2850
  }
2847
- if (msg.data.hasOwnProperty('danfossLoadBalancingEnable')) {
2851
+ if (msg.data.danfossLoadBalancingEnable !== undefined) {
2848
2852
  result[(0, utils_1.postfixWithEndpointName)('load_balancing_enable', msg, model, meta)] = msg.data['danfossLoadBalancingEnable'] === 1;
2849
2853
  }
2850
- if (msg.data.hasOwnProperty('danfossLoadRoomMean')) {
2854
+ if (msg.data.danfossLoadRoomMean !== undefined) {
2851
2855
  result[(0, utils_1.postfixWithEndpointName)('load_room_mean', msg, model, meta)] = msg.data['danfossLoadRoomMean'];
2852
2856
  }
2853
- if (msg.data.hasOwnProperty('danfossLoadEstimate')) {
2857
+ if (msg.data.danfossLoadEstimate !== undefined) {
2854
2858
  result[(0, utils_1.postfixWithEndpointName)('load_estimate', msg, model, meta)] = msg.data['danfossLoadEstimate'];
2855
2859
  }
2856
- if (msg.data.hasOwnProperty('danfossPreheatStatus')) {
2860
+ if (msg.data.danfossPreheatStatus !== undefined) {
2857
2861
  result[(0, utils_1.postfixWithEndpointName)('preheat_status', msg, model, meta)] = msg.data['danfossPreheatStatus'] === 1;
2858
2862
  }
2859
- if (msg.data.hasOwnProperty('danfossAdaptionRunStatus')) {
2863
+ if (msg.data.danfossAdaptionRunStatus !== undefined) {
2860
2864
  result[(0, utils_1.postfixWithEndpointName)('adaptation_run_status', msg, model, meta)] =
2861
2865
  constants.danfossAdaptionRunStatus[msg.data['danfossAdaptionRunStatus']];
2862
2866
  }
2863
- if (msg.data.hasOwnProperty('danfossAdaptionRunSettings')) {
2867
+ if (msg.data.danfossAdaptionRunSettings !== undefined) {
2864
2868
  result[(0, utils_1.postfixWithEndpointName)('adaptation_run_settings', msg, model, meta)] = msg.data['danfossAdaptionRunSettings'] === 1;
2865
2869
  }
2866
- if (msg.data.hasOwnProperty('danfossAdaptionRunControl')) {
2870
+ if (msg.data.danfossAdaptionRunControl !== undefined) {
2867
2871
  result[(0, utils_1.postfixWithEndpointName)('adaptation_run_control', msg, model, meta)] =
2868
2872
  constants.danfossAdaptionRunControl[msg.data['danfossAdaptionRunControl']];
2869
2873
  }
2870
- if (msg.data.hasOwnProperty('danfossRegulationSetpointOffset')) {
2874
+ if (msg.data.danfossRegulationSetpointOffset !== undefined) {
2871
2875
  result[(0, utils_1.postfixWithEndpointName)('regulation_setpoint_offset', msg, model, meta)] = msg.data['danfossRegulationSetpointOffset'];
2872
2876
  }
2873
2877
  // Danfoss Icon Converters
2874
- if (msg.data.hasOwnProperty('danfossRoomStatusCode')) {
2875
- result[(0, utils_1.postfixWithEndpointName)('room_status_code', msg, model, meta)] = constants.danfossRoomStatusCode.hasOwnProperty(msg.data['danfossRoomStatusCode'])
2876
- ? constants.danfossRoomStatusCode[msg.data['danfossRoomStatusCode']]
2877
- : msg.data['danfossRoomStatusCode'];
2878
+ if (msg.data.danfossRoomStatusCode !== undefined) {
2879
+ result[(0, utils_1.postfixWithEndpointName)('room_status_code', msg, model, meta)] =
2880
+ constants.danfossRoomStatusCode[msg.data['danfossRoomStatusCode']] !== undefined
2881
+ ? constants.danfossRoomStatusCode[msg.data['danfossRoomStatusCode']]
2882
+ : msg.data['danfossRoomStatusCode'];
2878
2883
  }
2879
- if (msg.data.hasOwnProperty('danfossOutputStatus')) {
2884
+ if (msg.data.danfossOutputStatus !== undefined) {
2880
2885
  if (msg.data['danfossOutputStatus'] === 1) {
2881
2886
  result[(0, utils_1.postfixWithEndpointName)('output_status', msg, model, meta)] = 'active';
2882
2887
  result[(0, utils_1.postfixWithEndpointName)('running_state', msg, model, meta)] = 'heat';
@@ -2894,7 +2899,7 @@ const converters1 = {
2894
2899
  type: ['attributeReport', 'readResponse'],
2895
2900
  convert: (model, msg, publish, options, meta) => {
2896
2901
  const result = {};
2897
- if (msg.data.hasOwnProperty('occupiedHeatingSetpoint')) {
2902
+ if (msg.data.occupiedHeatingSetpoint !== undefined) {
2898
2903
  result[(0, utils_1.postfixWithEndpointName)('occupied_heating_setpoint_scheduled', msg, model, meta)] =
2899
2904
  (0, utils_1.precisionRound)(msg.data['occupiedHeatingSetpoint'], 2) / 100;
2900
2905
  }
@@ -2906,18 +2911,19 @@ const converters1 = {
2906
2911
  type: ['attributeReport', 'readResponse'],
2907
2912
  convert: (model, msg, publish, options, meta) => {
2908
2913
  const result = {};
2909
- if (msg.data.hasOwnProperty('danfossRoomFloorSensorMode')) {
2910
- result[(0, utils_1.postfixWithEndpointName)('room_floor_sensor_mode', msg, model, meta)] = constants.danfossRoomFloorSensorMode.hasOwnProperty(msg.data['danfossRoomFloorSensorMode'])
2911
- ? constants.danfossRoomFloorSensorMode[msg.data['danfossRoomFloorSensorMode']]
2912
- : msg.data['danfossRoomFloorSensorMode'];
2914
+ if (msg.data.danfossRoomFloorSensorMode !== undefined) {
2915
+ result[(0, utils_1.postfixWithEndpointName)('room_floor_sensor_mode', msg, model, meta)] =
2916
+ constants.danfossRoomFloorSensorMode[msg.data['danfossRoomFloorSensorMode']] !== undefined
2917
+ ? constants.danfossRoomFloorSensorMode[msg.data['danfossRoomFloorSensorMode']]
2918
+ : msg.data['danfossRoomFloorSensorMode'];
2913
2919
  }
2914
- if (msg.data.hasOwnProperty('danfossFloorMinSetpoint')) {
2920
+ if (msg.data.danfossFloorMinSetpoint !== undefined) {
2915
2921
  const value = (0, utils_1.precisionRound)(msg.data['danfossFloorMinSetpoint'], 2) / 100;
2916
2922
  if (value >= -273.15) {
2917
2923
  result[(0, utils_1.postfixWithEndpointName)('floor_min_setpoint', msg, model, meta)] = value;
2918
2924
  }
2919
2925
  }
2920
- if (msg.data.hasOwnProperty('danfossFloorMaxSetpoint')) {
2926
+ if (msg.data.danfossFloorMaxSetpoint !== undefined) {
2921
2927
  const value = (0, utils_1.precisionRound)(msg.data['danfossFloorMaxSetpoint'], 2) / 100;
2922
2928
  if (value >= -273.15) {
2923
2929
  result[(0, utils_1.postfixWithEndpointName)('floor_max_setpoint', msg, model, meta)] = value;
@@ -2931,7 +2937,7 @@ const converters1 = {
2931
2937
  type: ['attributeReport', 'readResponse'],
2932
2938
  convert: (model, msg, publish, options, meta) => {
2933
2939
  const result = {};
2934
- if (msg.data.hasOwnProperty('batteryPercentageRemaining')) {
2940
+ if (msg.data.batteryPercentageRemaining !== undefined) {
2935
2941
  // Some devices do not comply to the ZCL and report a
2936
2942
  // batteryPercentageRemaining of 100 when the battery is full (should be 200).
2937
2943
  const dontDividePercentage = model.meta && model.meta.battery && model.meta.battery.dontDividePercentage;
@@ -2947,20 +2953,23 @@ const converters1 = {
2947
2953
  type: ['attributeReport', 'readResponse'],
2948
2954
  convert: (model, msg, publish, options, meta) => {
2949
2955
  const result = {};
2950
- if (msg.data.hasOwnProperty('danfossSystemStatusCode')) {
2951
- result[(0, utils_1.postfixWithEndpointName)('system_status_code', msg, model, meta)] = constants.danfossSystemStatusCode.hasOwnProperty(msg.data['danfossSystemStatusCode'])
2952
- ? constants.danfossSystemStatusCode[msg.data['danfossSystemStatusCode']]
2953
- : msg.data['danfossSystemStatusCode'];
2954
- }
2955
- if (msg.data.hasOwnProperty('danfossSystemStatusWater')) {
2956
- result[(0, utils_1.postfixWithEndpointName)('system_status_water', msg, model, meta)] = constants.danfossSystemStatusWater.hasOwnProperty(msg.data['danfossSystemStatusWater'])
2957
- ? constants.danfossSystemStatusWater[msg.data['danfossSystemStatusWater']]
2958
- : msg.data['danfossSystemStatusWater'];
2959
- }
2960
- if (msg.data.hasOwnProperty('danfossMultimasterRole')) {
2961
- result[(0, utils_1.postfixWithEndpointName)('multimaster_role', msg, model, meta)] = constants.danfossMultimasterRole.hasOwnProperty(msg.data['danfossMultimasterRole'])
2962
- ? constants.danfossMultimasterRole[msg.data['danfossMultimasterRole']]
2963
- : msg.data['danfossMultimasterRole'];
2956
+ if (msg.data.danfossSystemStatusCode !== undefined) {
2957
+ result[(0, utils_1.postfixWithEndpointName)('system_status_code', msg, model, meta)] =
2958
+ constants.danfossSystemStatusCode[msg.data['danfossSystemStatusCode']] !== undefined
2959
+ ? constants.danfossSystemStatusCode[msg.data['danfossSystemStatusCode']]
2960
+ : msg.data['danfossSystemStatusCode'];
2961
+ }
2962
+ if (msg.data.danfossSystemStatusWater !== undefined) {
2963
+ result[(0, utils_1.postfixWithEndpointName)('system_status_water', msg, model, meta)] =
2964
+ constants.danfossSystemStatusWater[msg.data['danfossSystemStatusWater']] !== undefined
2965
+ ? constants.danfossSystemStatusWater[msg.data['danfossSystemStatusWater']]
2966
+ : msg.data['danfossSystemStatusWater'];
2967
+ }
2968
+ if (msg.data.danfossMultimasterRole !== undefined) {
2969
+ result[(0, utils_1.postfixWithEndpointName)('multimaster_role', msg, model, meta)] =
2970
+ constants.danfossMultimasterRole[msg.data['danfossMultimasterRole']] !== undefined
2971
+ ? constants.danfossMultimasterRole[msg.data['danfossMultimasterRole']]
2972
+ : msg.data['danfossMultimasterRole'];
2964
2973
  }
2965
2974
  return result;
2966
2975
  },
@@ -2970,15 +2979,17 @@ const converters1 = {
2970
2979
  type: ['attributeReport', 'readResponse'],
2971
2980
  convert: (model, msg, publish, options, meta) => {
2972
2981
  const result = {};
2973
- if (msg.data.hasOwnProperty('keypadLockout')) {
2974
- result[(0, utils_1.postfixWithEndpointName)('keypad_lockout', msg, model, meta)] = constants.keypadLockoutMode.hasOwnProperty(msg.data['keypadLockout'])
2975
- ? constants.keypadLockoutMode[msg.data['keypadLockout']]
2976
- : msg.data['keypadLockout'];
2977
- }
2978
- if (msg.data.hasOwnProperty('tempDisplayMode')) {
2979
- result[(0, utils_1.postfixWithEndpointName)('temperature_display_mode', msg, model, meta)] = constants.temperatureDisplayMode.hasOwnProperty(msg.data['tempDisplayMode'])
2980
- ? constants.temperatureDisplayMode[msg.data['tempDisplayMode']]
2981
- : msg.data['tempDisplayMode'];
2982
+ if (msg.data.keypadLockout !== undefined) {
2983
+ result[(0, utils_1.postfixWithEndpointName)('keypad_lockout', msg, model, meta)] =
2984
+ constants.keypadLockoutMode[msg.data['keypadLockout']] !== undefined
2985
+ ? constants.keypadLockoutMode[msg.data['keypadLockout']]
2986
+ : msg.data['keypadLockout'];
2987
+ }
2988
+ if (msg.data.tempDisplayMode !== undefined) {
2989
+ result[(0, utils_1.postfixWithEndpointName)('temperature_display_mode', msg, model, meta)] =
2990
+ constants.temperatureDisplayMode[msg.data['tempDisplayMode']] !== undefined
2991
+ ? constants.temperatureDisplayMode[msg.data['tempDisplayMode']]
2992
+ : msg.data['tempDisplayMode'];
2982
2993
  }
2983
2994
  return result;
2984
2995
  },
@@ -3091,7 +3102,7 @@ const converters1 = {
3091
3102
  cluster: 'genLevelCtrl',
3092
3103
  type: ['attributeReport', 'readResponse'],
3093
3104
  convert: (model, msg, publish, options, meta) => {
3094
- if (msg.data.hasOwnProperty('currentLevel')) {
3105
+ if (msg.data.currentLevel !== undefined) {
3095
3106
  // Ignore brightness = 0, which only happens when state is OFF
3096
3107
  if (Number(msg.data['currentLevel']) > 0) {
3097
3108
  return { brightness: msg.data['currentLevel'] };
@@ -3164,7 +3175,7 @@ const converters1 = {
3164
3175
  0x63: 'release_2_and_4',
3165
3176
  0x22: 'press_energy_bar',
3166
3177
  };
3167
- const action = lookup.hasOwnProperty(commandID) ? lookup[commandID] : `unknown_${commandID}`;
3178
+ const action = lookup[commandID] !== undefined ? lookup[commandID] : `unknown_${commandID}`;
3168
3179
  return { action };
3169
3180
  },
3170
3181
  },
@@ -3210,7 +3221,7 @@ const converters1 = {
3210
3221
  0x52: 'half_open',
3211
3222
  0x53: 'tilt',
3212
3223
  };
3213
- if (!lookup.hasOwnProperty(commandID)) {
3224
+ if (lookup[commandID] === undefined) {
3214
3225
  logger_1.logger.error(`PTM 215ZE: missing command '${commandID}'`, NS);
3215
3226
  }
3216
3227
  else {
@@ -3252,7 +3263,7 @@ const converters1 = {
3252
3263
  '104_': 'short_press_2_of_2',
3253
3264
  };
3254
3265
  const ID = `${commandID}_${msg.data.commandFrame.raw?.slice(0, 1).join('_') ?? ''}`;
3255
- if (!lookup.hasOwnProperty(ID)) {
3266
+ if (lookup[ID] === undefined) {
3256
3267
  logger_1.logger.error(`PTM 216Z: missing command '${ID}'`, NS);
3257
3268
  }
3258
3269
  else {
@@ -3308,7 +3319,7 @@ const converters1 = {
3308
3319
  type: ['attributeReport', 'readResponse'],
3309
3320
  convert: (model, msg, publish, options, meta) => {
3310
3321
  const payload = {};
3311
- if (msg.data.hasOwnProperty('acceleration'))
3322
+ if (msg.data.acceleration !== undefined)
3312
3323
  payload.moving = msg.data['acceleration'] === 1;
3313
3324
  // https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/devicetypes/smartthings/smartsense-multi-sensor.src/smartsense-multi-sensor.groovy#L222
3314
3325
  /*
@@ -3318,11 +3329,11 @@ const converters1 = {
3318
3329
  xyzResults.y = y
3319
3330
  xyzResults.z = -x
3320
3331
  */
3321
- if (msg.data.hasOwnProperty('z_axis'))
3332
+ if (msg.data.z_axis !== undefined)
3322
3333
  payload.x_axis = msg.data['z_axis'];
3323
- if (msg.data.hasOwnProperty('y_axis'))
3334
+ if (msg.data.y_axis !== undefined)
3324
3335
  payload.y_axis = msg.data['y_axis'];
3325
- if (msg.data.hasOwnProperty('x_axis'))
3336
+ if (msg.data.x_axis !== undefined)
3326
3337
  payload.z_axis = -msg.data['x_axis'];
3327
3338
  return payload;
3328
3339
  },
@@ -3454,16 +3465,16 @@ const converters1 = {
3454
3465
  const payload = {};
3455
3466
  // 0xf000 = 61440
3456
3467
  // This attribute returns usually 2 when power is over the defined threshold.
3457
- if (msg.data.hasOwnProperty('61440')) {
3468
+ if (msg.data['61440'] !== undefined) {
3458
3469
  payload.power_alarm_active_value = msg.data['61440'];
3459
3470
  payload.power_alarm_active = payload.power_alarm_active_value > 0;
3460
3471
  }
3461
3472
  // 0xf001 = 61441
3462
- if (msg.data.hasOwnProperty('61441')) {
3473
+ if (msg.data['61441'] !== undefined) {
3463
3474
  payload.power_alarm_enabled = msg.data['61441'];
3464
3475
  }
3465
3476
  // 0xf002 = 61442, wh = watt hour
3466
- if (msg.data.hasOwnProperty('61442')) {
3477
+ if (msg.data['61442'] !== undefined) {
3467
3478
  payload.power_alarm_wh_threshold = msg.data['61442'];
3468
3479
  }
3469
3480
  return payload;
@@ -3493,7 +3504,7 @@ const converters1 = {
3493
3504
  0x35: 'up',
3494
3505
  0x36: 'down', // 600087l
3495
3506
  };
3496
- if (!lookup.hasOwnProperty(commandID)) {
3507
+ if (lookup[commandID] === undefined) {
3497
3508
  logger_1.logger.error(`Legrand GreenPower: missing command '${commandID}'`, NS);
3498
3509
  }
3499
3510
  else {
@@ -3555,7 +3566,7 @@ const converters1 = {
3555
3566
  cluster: 'msPressureMeasurement',
3556
3567
  type: ['attributeReport', 'readResponse'],
3557
3568
  convert: (model, msg, publish, options, meta) => {
3558
- const pressure = msg.data.hasOwnProperty('measuredValue') ? msg.data.measuredValue : parseFloat(msg.data['32']) / 1000.0;
3569
+ const pressure = msg.data.measuredValue !== undefined ? msg.data.measuredValue : parseFloat(msg.data['32']) / 1000.0;
3559
3570
  return { pressure };
3560
3571
  },
3561
3572
  },
@@ -3691,13 +3702,13 @@ const converters1 = {
3691
3702
  const timeCoverSetMiddle = 60;
3692
3703
  // https://github.com/Koenkk/zigbee-herdsman-converters/pull/1336
3693
3704
  // Need to add time_close and time_open in your configuration.yaml after friendly_name (and set your time)
3694
- if (options.hasOwnProperty('time_close') && options.hasOwnProperty('time_open')) {
3705
+ if (options.time_close !== undefined && options.time_open !== undefined) {
3695
3706
  if (!globalStore.hasValue(msg.endpoint, 'position')) {
3696
3707
  globalStore.putValue(msg.endpoint, 'position', { lastPreviousAction: -1, CurrentPosition: -1, since: false });
3697
3708
  }
3698
3709
  const entry = globalStore.getValue(msg.endpoint, 'position');
3699
3710
  // ignore if first action is middle and ignore action middle if previous action is middle
3700
- if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] == 50) {
3711
+ if (msg.data.currentPositionLiftPercentage !== undefined && msg.data['currentPositionLiftPercentage'] == 50) {
3701
3712
  if ((entry.CurrentPosition == -1 && entry.lastPreviousAction == -1) || entry.lastPreviousAction == 50) {
3702
3713
  logger_1.logger.warning(`ZMCSW032D ignore action`, NS);
3703
3714
  return;
@@ -3708,7 +3719,7 @@ const converters1 = {
3708
3719
  const deltaTimeSec = Math.floor((Date.now() - entry.since) / 1000); // convert to sec
3709
3720
  entry.since = Date.now();
3710
3721
  entry.lastPreviousAction = msg.data['currentPositionLiftPercentage'];
3711
- if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] == 50) {
3722
+ if (msg.data.currentPositionLiftPercentage !== undefined && msg.data['currentPositionLiftPercentage'] == 50) {
3712
3723
  if (deltaTimeSec < timeCoverSetMiddle || deltaTimeSec > timeCoverSetMiddle) {
3713
3724
  if (lastPreviousAction == 100) {
3714
3725
  // Open
@@ -3725,7 +3736,7 @@ const converters1 = {
3725
3736
  }
3726
3737
  }
3727
3738
  entry.CurrentPosition = currentPosition;
3728
- if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] !== 50) {
3739
+ if (msg.data.currentPositionLiftPercentage !== undefined && msg.data['currentPositionLiftPercentage'] !== 50) {
3729
3740
  // position cast float to int
3730
3741
  result.position = currentPosition | 0;
3731
3742
  }
@@ -3743,7 +3754,7 @@ const converters1 = {
3743
3754
  }
3744
3755
  else {
3745
3756
  // Previous solution without time_close and time_open
3746
- if (msg.data.hasOwnProperty('currentPositionLiftPercentage') && msg.data['currentPositionLiftPercentage'] !== 50) {
3757
+ if (msg.data.currentPositionLiftPercentage !== undefined && msg.data['currentPositionLiftPercentage'] !== 50) {
3747
3758
  const liftPercentage = msg.data['currentPositionLiftPercentage'];
3748
3759
  result.position = liftPercentage;
3749
3760
  result.position = options.invert_cover ? 100 - result.position : result.position;
@@ -3761,7 +3772,7 @@ const converters1 = {
3761
3772
  type: 'commandArrivalSensorNotify',
3762
3773
  options: [exposes.options.presence_timeout()],
3763
3774
  convert: (model, msg, publish, options, meta) => {
3764
- const useOptionsTimeout = options && options.hasOwnProperty('presence_timeout');
3775
+ const useOptionsTimeout = options && options.presence_timeout !== undefined;
3765
3776
  const timeout = useOptionsTimeout ? Number(options.presence_timeout) : 100; // 100 seconds by default
3766
3777
  // Stop existing timer because motion is detected and set a new one.
3767
3778
  clearTimeout(globalStore.getValue(msg.endpoint, 'timer'));
@@ -3775,7 +3786,7 @@ const converters1 = {
3775
3786
  type: ['attributeReport', 'readResponse'],
3776
3787
  options: [exposes.options.presence_timeout()],
3777
3788
  convert: (model, msg, publish, options, meta) => {
3778
- const useOptionsTimeout = options && options.hasOwnProperty('presence_timeout');
3789
+ const useOptionsTimeout = options && options.presence_timeout !== undefined;
3779
3790
  const timeout = useOptionsTimeout ? Number(options.presence_timeout) : 100; // 100 seconds by default
3780
3791
  // Stop existing timer because motion is detected and set a new one.
3781
3792
  clearTimeout(globalStore.getValue(msg.endpoint, 'timer'));
@@ -3795,7 +3806,7 @@ const converters1 = {
3795
3806
  commandGoOut: 'go_out',
3796
3807
  commandRepast: 'repast',
3797
3808
  };
3798
- if (lookup.hasOwnProperty(msg.type))
3809
+ if (lookup[msg.type] !== undefined)
3799
3810
  return { action: lookup[msg.type] };
3800
3811
  },
3801
3812
  },
@@ -3863,22 +3874,22 @@ const converters1 = {
3863
3874
  type: 'readResponse',
3864
3875
  convert: (model, msg, publish, options, meta) => {
3865
3876
  const result = {};
3866
- if (msg.data.hasOwnProperty(0xf001)) {
3877
+ if (msg.data[0xf001] !== undefined) {
3867
3878
  result.led_feedback = ['OFF', 'ON'][msg.data[0xf001]];
3868
3879
  }
3869
- if (msg.data.hasOwnProperty(0xf002)) {
3880
+ if (msg.data[0xf002] !== undefined) {
3870
3881
  result.buzzer_feedback = ['OFF', 'ON'][msg.data[0xf002]];
3871
3882
  }
3872
- if (msg.data.hasOwnProperty(0xf000)) {
3883
+ if (msg.data[0xf000] !== undefined) {
3873
3884
  result.sensitivity = msg.data[0xf000];
3874
3885
  }
3875
- if (msg.data.hasOwnProperty(0xf003)) {
3886
+ if (msg.data[0xf003] !== undefined) {
3876
3887
  result.sensors_count = msg.data[0xf003];
3877
3888
  }
3878
- if (msg.data.hasOwnProperty(0xf004)) {
3889
+ if (msg.data[0xf004] !== undefined) {
3879
3890
  result.sensors_type = ['СБМ-20/СТС-5/BOI-33', 'СБМ-19/СТС-6', 'Others'][msg.data[0xf004]];
3880
3891
  }
3881
- if (msg.data.hasOwnProperty(0xf005)) {
3892
+ if (msg.data[0xf005] !== undefined) {
3882
3893
  result.alert_threshold = msg.data[0xf005];
3883
3894
  }
3884
3895
  return result;
@@ -3889,16 +3900,16 @@ const converters1 = {
3889
3900
  type: 'readResponse',
3890
3901
  convert: (model, msg, publish, options, meta) => {
3891
3902
  const result = {};
3892
- if (msg.data.hasOwnProperty(0x0203)) {
3903
+ if (msg.data[0x0203] !== undefined) {
3893
3904
  result.led_feedback = ['OFF', 'ON'][msg.data[0x0203]];
3894
3905
  }
3895
- if (msg.data.hasOwnProperty(0x0202)) {
3906
+ if (msg.data[0x0202] !== undefined) {
3896
3907
  result.enable_abc = ['OFF', 'ON'][msg.data[0x0202]];
3897
3908
  }
3898
- if (msg.data.hasOwnProperty(0x0204)) {
3909
+ if (msg.data[0x0204] !== undefined) {
3899
3910
  result.threshold1 = msg.data[0x0204];
3900
3911
  }
3901
- if (msg.data.hasOwnProperty(0x0205)) {
3912
+ if (msg.data[0x0205] !== undefined) {
3902
3913
  result.threshold2 = msg.data[0x0205];
3903
3914
  }
3904
3915
  return result;
@@ -3909,7 +3920,7 @@ const converters1 = {
3909
3920
  type: 'readResponse',
3910
3921
  convert: (model, msg, publish, options, meta) => {
3911
3922
  const result = {};
3912
- if (msg.data.hasOwnProperty(0x0210)) {
3923
+ if (msg.data[0x0210] !== undefined) {
3913
3924
  result.temperature_offset = msg.data[0x0210];
3914
3925
  }
3915
3926
  return result;
@@ -3920,7 +3931,7 @@ const converters1 = {
3920
3931
  type: 'readResponse',
3921
3932
  convert: (model, msg, publish, options, meta) => {
3922
3933
  const result = {};
3923
- if (msg.data.hasOwnProperty(0x0210)) {
3934
+ if (msg.data[0x0210] !== undefined) {
3924
3935
  result.pressure_offset = msg.data[0x0210];
3925
3936
  }
3926
3937
  return result;
@@ -3931,7 +3942,7 @@ const converters1 = {
3931
3942
  type: 'readResponse',
3932
3943
  convert: (model, msg, publish, options, meta) => {
3933
3944
  const result = {};
3934
- if (msg.data.hasOwnProperty(0x0210)) {
3945
+ if (msg.data[0x0210] !== undefined) {
3935
3946
  result.humidity_offset = msg.data[0x0210];
3936
3947
  }
3937
3948
  return result;
@@ -3942,28 +3953,28 @@ const converters1 = {
3942
3953
  type: ['attributeReport', 'readResponse'],
3943
3954
  convert: (model, msg, publish, options, meta) => {
3944
3955
  const result = {};
3945
- if (msg.data.hasOwnProperty(0x0050)) {
3956
+ if (msg.data[0x0050] !== undefined) {
3946
3957
  result.state = ['idle', 'ring', 'talk', 'open', 'drop'][msg.data[0x0050]];
3947
3958
  }
3948
- if (msg.data.hasOwnProperty(0x0051)) {
3959
+ if (msg.data[0x0051] !== undefined) {
3949
3960
  result.mode = ['never', 'once', 'always', 'drop'][msg.data[0x0051]];
3950
3961
  }
3951
- if (msg.data.hasOwnProperty(0x0052)) {
3962
+ if (msg.data[0x0052] !== undefined) {
3952
3963
  result.sound = ['OFF', 'ON'][msg.data[0x0052]];
3953
3964
  }
3954
- if (msg.data.hasOwnProperty(0x0053)) {
3965
+ if (msg.data[0x0053] !== undefined) {
3955
3966
  result.time_ring = msg.data[0x0053];
3956
3967
  }
3957
- if (msg.data.hasOwnProperty(0x0054)) {
3968
+ if (msg.data[0x0054] !== undefined) {
3958
3969
  result.time_talk = msg.data[0x0054];
3959
3970
  }
3960
- if (msg.data.hasOwnProperty(0x0055)) {
3971
+ if (msg.data[0x0055] !== undefined) {
3961
3972
  result.time_open = msg.data[0x0055];
3962
3973
  }
3963
- if (msg.data.hasOwnProperty(0x0057)) {
3974
+ if (msg.data[0x0057] !== undefined) {
3964
3975
  result.time_bell = msg.data[0x0057];
3965
3976
  }
3966
- if (msg.data.hasOwnProperty(0x0056)) {
3977
+ if (msg.data[0x0056] !== undefined) {
3967
3978
  result.time_report = msg.data[0x0056];
3968
3979
  }
3969
3980
  return result;
@@ -4022,7 +4033,7 @@ const converters1 = {
4022
4033
  cluster: 'msOccupancySensing',
4023
4034
  type: ['attributeReport', 'readResponse'],
4024
4035
  convert: (model, msg, publish, options, meta) => {
4025
- if (msg.data.hasOwnProperty('48')) {
4036
+ if (msg.data['48'] !== undefined) {
4026
4037
  const lookup = ['low', 'medium', 'high', 'very_high', 'max'];
4027
4038
  return { motion_sensitivity: lookup[msg.data['48']] };
4028
4039
  }
@@ -4032,7 +4043,7 @@ const converters1 = {
4032
4043
  cluster: 'genBasic',
4033
4044
  type: ['attributeReport', 'readResponse'],
4034
4045
  convert: (model, msg, publish, options, meta) => {
4035
- if (msg.data.hasOwnProperty('51')) {
4046
+ if (msg.data['51'] !== undefined) {
4036
4047
  return { led_indication: msg.data['51'] === 1 };
4037
4048
  }
4038
4049
  },
@@ -4041,7 +4052,7 @@ const converters1 = {
4041
4052
  cluster: 'genBasic',
4042
4053
  type: ['attributeReport', 'readResponse'],
4043
4054
  convert: (model, msg, publish, options, meta) => {
4044
- if (msg.data.hasOwnProperty('52')) {
4055
+ if (msg.data['52'] !== undefined) {
4045
4056
  const values = ['single_rocker', 'single_push_button', 'dual_rocker', 'dual_push_button'];
4046
4057
  return { device_mode: values[msg.data['52']] };
4047
4058
  }
@@ -4228,7 +4239,7 @@ const converters1 = {
4228
4239
  // simulated brightness
4229
4240
  if (options.simulated_brightness && (button === 'down' || button === 'up') && type !== 'release') {
4230
4241
  const opts = options.simulated_brightness;
4231
- const deltaOpts = typeof opts === 'object' && opts.hasOwnProperty('delta') ? opts.delta : 35;
4242
+ const deltaOpts = typeof opts === 'object' && opts.delta !== undefined ? opts.delta : 35;
4232
4243
  const delta = button === 'up' ? deltaOpts : deltaOpts * -1;
4233
4244
  const brightness = globalStore.getValue(msg.endpoint, 'brightness', 255) + delta;
4234
4245
  payload.brightness = (0, utils_1.numberWithinRange)(brightness, 0, 255);
@@ -4259,7 +4270,7 @@ const converters1 = {
4259
4270
  0x64: 'press_1_and_2',
4260
4271
  0x65: 'release_1_and_2',
4261
4272
  };
4262
- if (!lookup.hasOwnProperty(commandID)) {
4273
+ if (lookup[commandID] === undefined) {
4263
4274
  logger_1.logger.error(`Hue Tap: missing command '${commandID}'`, NS);
4264
4275
  }
4265
4276
  else {
@@ -4272,10 +4283,10 @@ const converters1 = {
4272
4283
  type: ['attributeReport', 'readResponse'],
4273
4284
  convert: (model, msg, publish, options, meta) => {
4274
4285
  const property = 0x8001;
4275
- if (msg.data.hasOwnProperty(property)) {
4286
+ if (msg.data[property] !== undefined) {
4276
4287
  const dict = { 0x00: 'off', 0x01: 'on_off', 0x02: 'off_on' };
4277
4288
  const value = msg.data[property];
4278
- if (dict.hasOwnProperty(value)) {
4289
+ if (dict[value] !== undefined) {
4279
4290
  return { [(0, utils_1.postfixWithEndpointName)('indicator_mode', msg, model, meta)]: dict[value] };
4280
4291
  }
4281
4292
  }
@@ -4310,11 +4321,11 @@ const converters1 = {
4310
4321
  const data = msg.data;
4311
4322
  const senslookup = { '0': 'low', '1': 'medium', '2': 'high' };
4312
4323
  const keeptimelookup = { '0': 0, '1': 30, '2': 60, '3': 120, '4': 240, '5': 480 };
4313
- if (data && data.hasOwnProperty('currentZoneSensitivityLevel')) {
4324
+ if (data && data.currentZoneSensitivityLevel !== undefined) {
4314
4325
  const value = data.currentZoneSensitivityLevel;
4315
4326
  return { sensitivity: senslookup[value] };
4316
4327
  }
4317
- if (data && data.hasOwnProperty('61441')) {
4328
+ if (data && data['61441'] !== undefined) {
4318
4329
  const value = data['61441'];
4319
4330
  return { keep_time: keeptimelookup[value] };
4320
4331
  }
@@ -4531,7 +4542,7 @@ const converters1 = {
4531
4542
  cluster: 'genOnOff',
4532
4543
  type: ['attributeReport', 'readResponse'],
4533
4544
  convert: (model, msg, publish, options, meta) => {
4534
- if (msg.data.hasOwnProperty('tuyaOperationMode')) {
4545
+ if (msg.data.tuyaOperationMode !== undefined) {
4535
4546
  const value = msg.data['tuyaOperationMode'];
4536
4547
  const lookup = { 0: 'command', 1: 'event' };
4537
4548
  return { operation_mode: lookup[value] };
@@ -4548,7 +4559,7 @@ const converters1 = {
4548
4559
  if (commandID === 224)
4549
4560
  return;
4550
4561
  const lookup = { 0x21: 'press_on', 0x20: 'press_off', 0x34: 'release', 0x35: 'hold_on', 0x36: 'hold_off' };
4551
- if (!lookup.hasOwnProperty(commandID)) {
4562
+ if (lookup[commandID] === undefined) {
4552
4563
  logger_1.logger.error(`Sunricher: missing command '${commandID}'`, NS);
4553
4564
  }
4554
4565
  else {
@@ -4574,7 +4585,7 @@ const converters1 = {
4574
4585
  0x36: 'hold_low',
4575
4586
  0x34: 'release',
4576
4587
  };
4577
- if (!lookup.hasOwnProperty(commandID)) {
4588
+ if (lookup[commandID] === undefined) {
4578
4589
  logger_1.logger.error(`Sunricher: missing command '${commandID}'`, NS);
4579
4590
  }
4580
4591
  else {
@@ -4632,7 +4643,7 @@ const converters1 = {
4632
4643
  type: ['attributeReport', 'readResponse'],
4633
4644
  convert: (model, msg, publish, options, meta) => {
4634
4645
  const result = {};
4635
- if (msg.data.hasOwnProperty('hwVersion'))
4646
+ if (msg.data.hwVersion !== undefined)
4636
4647
  result['hw_version'] = msg.data.hwVersion;
4637
4648
  return result;
4638
4649
  },
@@ -4884,7 +4895,7 @@ const converters2 = {
4884
4895
  cluster: 'ssIasAce',
4885
4896
  type: 'commandArm',
4886
4897
  convert: async (model, msg, publish, options, meta) => {
4887
- const payload = await converters1.command_arm.convert(model, msg, publish, options, meta);
4898
+ const payload = converters1.command_arm.convert(model, msg, publish, options, meta);
4888
4899
  if (!payload)
4889
4900
  return;
4890
4901
  payload.action_transaction = msg.meta.zclTransactionSequenceNumber;
@@ -4895,7 +4906,7 @@ const converters2 = {
4895
4906
  cluster: 'seMetering',
4896
4907
  type: ['attributeReport', 'readResponse'],
4897
4908
  convert: async (model, msg, publish, options, meta) => {
4898
- const result = await converters1.metering.convert(model, msg, publish, options, meta);
4909
+ const result = converters1.metering.convert(model, msg, publish, options, meta);
4899
4910
  // Filter incorrect 0 energy values reported by the device:
4900
4911
  // https://github.com/Koenkk/zigbee2mqtt/issues/7852
4901
4912
  if (result && result.energy === 0) {
@@ -4911,8 +4922,8 @@ const converters2 = {
4911
4922
  cluster: 'seMetering',
4912
4923
  type: ['attributeReport', 'readResponse'],
4913
4924
  convert: async (model, msg, publish, options, meta) => {
4914
- const result = await converters1.metering.convert(model, msg, publish, options, meta);
4915
- if (result && result.hasOwnProperty('power')) {
4925
+ const result = converters1.metering.convert(model, msg, publish, options, meta);
4926
+ if (result && result.power !== undefined) {
4916
4927
  result.power /= 1000;
4917
4928
  }
4918
4929
  return result;
@@ -4922,8 +4933,8 @@ const converters2 = {
4922
4933
  cluster: 'genOnOff',
4923
4934
  type: 'commandOn',
4924
4935
  convert: async (model, msg, publish, options, meta) => {
4925
- const payload1 = await converters1.checkin_presence.convert(model, msg, publish, options, meta);
4926
- const payload2 = await converters1.command_on.convert(model, msg, publish, options, meta);
4936
+ const payload1 = converters1.checkin_presence.convert(model, msg, publish, options, meta);
4937
+ const payload2 = converters1.command_on.convert(model, msg, publish, options, meta);
4927
4938
  return { ...payload1, ...payload2 };
4928
4939
  },
4929
4940
  },
@@ -4945,11 +4956,11 @@ const converters2 = {
4945
4956
  // https://github.com/Koenkk/zigbee2mqtt/issues/2233
4946
4957
  // https://github.com/Koenkk/zigbee-herdsman-converters/issues/915
4947
4958
  const result = {};
4948
- if (msg.data.hasOwnProperty('instantaneousDemand')) {
4959
+ if (msg.data.instantaneousDemand !== undefined) {
4949
4960
  result.power = msg.data['instantaneousDemand'];
4950
4961
  }
4951
4962
  // Summation is reported in Watthours
4952
- if (msg.data.hasOwnProperty('currentSummDelivered')) {
4963
+ if (msg.data.currentSummDelivered !== undefined) {
4953
4964
  const data = msg.data['currentSummDelivered'];
4954
4965
  const value = (parseInt(data[0]) << 32) + parseInt(data[1]);
4955
4966
  result.energy = value / 1000.0;
@@ -4965,12 +4976,12 @@ const converters2 = {
4965
4976
  cluster: 'hvacThermostat',
4966
4977
  type: ['attributeReport', 'readResponse'],
4967
4978
  convert: async (model, msg, publish, options, meta) => {
4968
- const result = await converters1.thermostat.convert(model, msg, publish, options, meta);
4979
+ const result = converters1.thermostat.convert(model, msg, publish, options, meta);
4969
4980
  if (result && msg.data['StelproSystemMode'] === 5) {
4970
4981
  // 'Eco' mode is translated into 'auto' here
4971
4982
  result.system_mode = constants.thermostatSystemModes[1];
4972
4983
  }
4973
- if (result && msg.data.hasOwnProperty('pIHeatingDemand')) {
4984
+ if (result && msg.data.pIHeatingDemand !== undefined) {
4974
4985
  result.running_state = msg.data['pIHeatingDemand'] >= 10 ? 'heat' : 'idle';
4975
4986
  }
4976
4987
  return result;
@@ -4980,7 +4991,7 @@ const converters2 = {
4980
4991
  cluster: 'hvacThermostat',
4981
4992
  type: ['attributeReport', 'readResponse'],
4982
4993
  convert: async (model, msg, publish, options, meta) => {
4983
- const result = await converters1.thermostat.convert(model, msg, publish, options, meta);
4994
+ const result = converters1.thermostat.convert(model, msg, publish, options, meta);
4984
4995
  if (result) {
4985
4996
  // ViessMann TRVs report piHeatingDemand from 0-5
4986
4997
  // NOTE: remove the result for now, but leave it configure for reporting
@@ -4991,17 +5002,17 @@ const converters2 = {
4991
5002
  // 0-2, 5: unknown
4992
5003
  // 3: window open (OO on display, no heating)
4993
5004
  // 4: window open (OO on display, heating)
4994
- if (msg.data.hasOwnProperty('viessmannWindowOpenInternal')) {
5005
+ if (msg.data.viessmannWindowOpenInternal !== undefined) {
4995
5006
  result.window_open = msg.data['viessmannWindowOpenInternal'] == 3 || msg.data['viessmannWindowOpenInternal'] == 4;
4996
5007
  }
4997
5008
  // viessmannWindowOpenForce (rw, bool)
4998
- if (msg.data.hasOwnProperty('viessmannWindowOpenForce')) {
5009
+ if (msg.data.viessmannWindowOpenForce !== undefined) {
4999
5010
  result.window_open_force = msg.data['viessmannWindowOpenForce'] == 1;
5000
5011
  }
5001
5012
  // viessmannAssemblyMode (ro, bool)
5002
5013
  // 0: TRV installed
5003
5014
  // 1: TRV ready to install (-- on display)
5004
- if (msg.data.hasOwnProperty('viessmannAssemblyMode')) {
5015
+ if (msg.data.viessmannAssemblyMode !== undefined) {
5005
5016
  result.assembly_mode = msg.data['viessmannAssemblyMode'] == 1;
5006
5017
  }
5007
5018
  }
@@ -5012,7 +5023,7 @@ const converters2 = {
5012
5023
  cluster: 'hvacThermostat',
5013
5024
  type: ['attributeReport', 'readResponse'],
5014
5025
  convert: async (model, msg, publish, options, meta) => {
5015
- const result = await converters1.thermostat.convert(model, msg, publish, options, meta);
5026
+ const result = converters1.thermostat.convert(model, msg, publish, options, meta);
5016
5027
  if (result) {
5017
5028
  if (typeof msg.data[0x4003] == 'number') {
5018
5029
  result.current_heating_setpoint = (0, utils_1.precisionRound)(msg.data[0x4003], 2) / 100;
@@ -5045,7 +5056,7 @@ const converters2 = {
5045
5056
  if (typeof msg.data[0x4001] == 'number') {
5046
5057
  result.valve_position = msg.data[0x4001];
5047
5058
  }
5048
- if (msg.data.hasOwnProperty('pIHeatingDemand')) {
5059
+ if (msg.data.pIHeatingDemand !== undefined) {
5049
5060
  result.running_state = msg.data['pIHeatingDemand'] >= 10 ? 'heat' : 'idle';
5050
5061
  }
5051
5062
  }
@@ -5088,7 +5099,7 @@ const converters2 = {
5088
5099
  const sidelookup = { 5: 'right', 7: 'right', 40: 'left', 56: 'left' };
5089
5100
  if (sidelookup[value]) {
5090
5101
  msg.data.occupancy = 1;
5091
- const payload = (await converters1.occupancy_with_timeout.convert(model, msg, publish, options, meta));
5102
+ const payload = converters1.occupancy_with_timeout.convert(model, msg, publish, options, meta);
5092
5103
  if (payload) {
5093
5104
  payload.action_side = sidelookup[value];
5094
5105
  payload.side = sidelookup[value]; /* legacy: remove this line (replaced by action_side) */
@@ -5104,15 +5115,15 @@ const converters2 = {
5104
5115
  convert: async (model, msg, publish, options, meta) => {
5105
5116
  let result = {};
5106
5117
  const data = msg.data;
5107
- if (data && data.hasOwnProperty('zoneStatus')) {
5108
- const result1 = await converters1.ias_occupancy_alarm_1_report.convert(model, msg, publish, options, meta);
5118
+ if (data && data.zoneStatus !== undefined) {
5119
+ const result1 = converters1.ias_occupancy_alarm_1_report.convert(model, msg, publish, options, meta);
5109
5120
  result = { ...result1 };
5110
5121
  }
5111
- if (data && data.hasOwnProperty('currentZoneSensitivityLevel')) {
5122
+ if (data && data.currentZoneSensitivityLevel !== undefined) {
5112
5123
  const senslookup = { '0': 'low', '1': 'medium', '2': 'high' };
5113
5124
  result.sensitivity = senslookup[data.currentZoneSensitivityLevel];
5114
5125
  }
5115
- if (data && data.hasOwnProperty('61441')) {
5126
+ if (data && data['61441'] !== undefined) {
5116
5127
  const keeptimelookup = { '0': 30, '1': 60, '2': 120 };
5117
5128
  result.keep_time = keeptimelookup[data['61441']];
5118
5129
  }
@@ -5123,9 +5134,9 @@ const converters2 = {
5123
5134
  cluster: 'lightingBallastCfg',
5124
5135
  type: ['attributeReport', 'readResponse'],
5125
5136
  convert: async (model, msg, publish, options, meta) => {
5126
- const result = await converters1.lighting_ballast_configuration.convert(model, msg, publish, options, meta);
5137
+ const result = converters1.lighting_ballast_configuration.convert(model, msg, publish, options, meta);
5127
5138
  const lookup = { 1: 'RC', 2: 'RL' };
5128
- if (result && msg.data.hasOwnProperty(0xe000)) {
5139
+ if (result && msg.data[0xe000] !== undefined) {
5129
5140
  result.dimmer_mode = lookup[msg.data[0xe000]];
5130
5141
  }
5131
5142
  return result;
@@ -5135,8 +5146,8 @@ const converters2 = {
5135
5146
  cluster: 'lightingBallastCfg',
5136
5147
  type: ['attributeReport', 'readResponse'],
5137
5148
  convert: async (model, msg, publish, options, meta) => {
5138
- const result = await converters1.lighting_ballast_configuration.convert(model, msg, publish, options, meta);
5139
- if (result && msg.data.hasOwnProperty('wiserControlMode')) {
5149
+ const result = converters1.lighting_ballast_configuration.convert(model, msg, publish, options, meta);
5150
+ if (result && msg.data.wiserControlMode !== undefined) {
5140
5151
  result.dimmer_mode = constants.wiserDimmerControlMode[msg.data['wiserControlMode']];
5141
5152
  }
5142
5153
  return result;
@@ -5146,28 +5157,28 @@ const converters2 = {
5146
5157
  cluster: 'hvacThermostat',
5147
5158
  type: ['attributeReport', 'readResponse'],
5148
5159
  convert: async (model, msg, publish, options, meta) => {
5149
- const result = await converters1.thermostat.convert(model, msg, publish, options, meta);
5160
+ const result = converters1.thermostat.convert(model, msg, publish, options, meta);
5150
5161
  if (result) {
5151
- if (msg.data.hasOwnProperty(0xe010)) {
5162
+ if (msg.data[0xe010] !== undefined) {
5152
5163
  // wiserSmartZoneMode
5153
5164
  const lookup = { 1: 'manual', 2: 'schedule', 3: 'energy_saver', 6: 'holiday' };
5154
5165
  result['zone_mode'] = lookup[msg.data[0xe010]];
5155
5166
  }
5156
- if (msg.data.hasOwnProperty(0xe011)) {
5167
+ if (msg.data[0xe011] !== undefined) {
5157
5168
  // wiserSmartHactConfig
5158
5169
  const lookup = { 0x00: 'unconfigured', 0x80: 'setpoint_switch', 0x82: 'setpoint_fip', 0x83: 'fip_fip' };
5159
5170
  result['hact_config'] = lookup[msg.data[0xe011]];
5160
5171
  }
5161
- if (msg.data.hasOwnProperty(0xe020)) {
5172
+ if (msg.data[0xe020] !== undefined) {
5162
5173
  // wiserSmartCurrentFilPiloteMode
5163
5174
  const lookup = { 0: 'comfort', 1: 'comfort_-1', 2: 'comfort_-2', 3: 'energy_saving', 4: 'frost_protection', 5: 'off' };
5164
5175
  result['fip_setting'] = lookup[msg.data[0xe020]];
5165
5176
  }
5166
- if (msg.data.hasOwnProperty(0xe030)) {
5177
+ if (msg.data[0xe030] !== undefined) {
5167
5178
  // wiserSmartValvePosition
5168
5179
  result['pi_heating_demand'] = msg.data[0xe030];
5169
5180
  }
5170
- if (msg.data.hasOwnProperty(0xe031)) {
5181
+ if (msg.data[0xe031] !== undefined) {
5171
5182
  // wiserSmartValveCalibrationStatus
5172
5183
  const lookup = { 0: 'ongoing', 1: 'successful', 2: 'uncalibrated', 3: 'failed_e1', 4: 'failed_e2', 5: 'failed_e3' };
5173
5184
  result['valve_calibration_status'] = lookup[msg.data[0xe031]];
@@ -5175,8 +5186,8 @@ const converters2 = {
5175
5186
  // Radiator thermostats command changes from UI, but report value periodically for sync,
5176
5187
  // force an update of the value if it doesn't match the current existing value
5177
5188
  if (meta.device.modelID === 'EH-ZB-VACT' &&
5178
- msg.data.hasOwnProperty('occupiedHeatingSetpoint') &&
5179
- meta.state.hasOwnProperty('occupied_heating_setpoint')) {
5189
+ msg.data.occupiedHeatingSetpoint !== undefined &&
5190
+ meta.state.occupied_heating_setpoint !== undefined) {
5180
5191
  if (result.occupied_heating_setpoint != meta.state.occupied_heating_setpoint) {
5181
5192
  const lookup = { manual: 1, schedule: 2, energy_saver: 3, holiday: 6 };
5182
5193
  const zonemodeNum = lookup[Number(meta.state.zone_mode)];
@@ -5230,13 +5241,13 @@ const converters2 = {
5230
5241
  type: ['attributeReport', 'readResponse'],
5231
5242
  convert: (model, msg, publish, options, meta) => {
5232
5243
  const result = {};
5233
- if (msg.data.hasOwnProperty('64515')) {
5244
+ if (msg.data['64515'] !== undefined) {
5234
5245
  result['min_brightness'] = utils.mapNumberRange(msg.data['64515'], 0, 1000, 1, 255);
5235
5246
  }
5236
- if (msg.data.hasOwnProperty('64516')) {
5247
+ if (msg.data['64516'] !== undefined) {
5237
5248
  result['max_brightness'] = utils.mapNumberRange(msg.data['64516'], 0, 1000, 1, 255);
5238
5249
  }
5239
- if (msg.data.hasOwnProperty('61440')) {
5250
+ if (msg.data['61440'] !== undefined) {
5240
5251
  const propertyName = utils.postfixWithEndpointName('brightness', msg, model, meta);
5241
5252
  result[propertyName] = utils.mapNumberRange(msg.data['61440'], 0, 1000, 0, 255);
5242
5253
  }
@@ -5248,7 +5259,7 @@ const converters2 = {
5248
5259
  type: ['attributeReport', 'readResponse'],
5249
5260
  convert: (model, msg, publish, options, meta) => {
5250
5261
  const result = {};
5251
- if (msg.data.hasOwnProperty('64514')) {
5262
+ if (msg.data['64514'] !== undefined) {
5252
5263
  const lookup = { 0: 'led', 1: 'incandescent', 2: 'halogen' };
5253
5264
  result['light_type'] = lookup[msg.data['64514']];
5254
5265
  }
@@ -5260,7 +5271,7 @@ const converters2 = {
5260
5271
  type: ['attributeReport', 'readResponse'],
5261
5272
  convert: (model, msg, publish, options, meta) => {
5262
5273
  const result = {};
5263
- if (msg.data.hasOwnProperty('64514')) {
5274
+ if (msg.data['64514'] !== undefined) {
5264
5275
  const lookup = { 0: 'momentary', 1: 'toggle', 2: 'state' };
5265
5276
  const propertyName = utils.postfixWithEndpointName('switch_type', msg, model, meta);
5266
5277
  result[propertyName] = lookup[msg.data['64514']];