@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5

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 (331) hide show
  1. package/build/cjs/cc/AlarmSensorCC.js +381 -266
  2. package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
  3. package/build/cjs/cc/AssociationCC.js +669 -503
  4. package/build/cjs/cc/AssociationCC.js.map +3 -3
  5. package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
  6. package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
  7. package/build/cjs/cc/BarrierOperatorCC.js +595 -429
  8. package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
  9. package/build/cjs/cc/BasicCC.js +354 -260
  10. package/build/cjs/cc/BasicCC.js.map +3 -3
  11. package/build/cjs/cc/BatteryCC.js +427 -345
  12. package/build/cjs/cc/BatteryCC.js.map +3 -3
  13. package/build/cjs/cc/BinarySensorCC.js +391 -276
  14. package/build/cjs/cc/BinarySensorCC.js.map +3 -3
  15. package/build/cjs/cc/BinarySwitchCC.js +347 -253
  16. package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
  17. package/build/cjs/cc/CRC16CC.js +160 -85
  18. package/build/cjs/cc/CRC16CC.js.map +3 -3
  19. package/build/cjs/cc/CentralSceneCC.js +459 -324
  20. package/build/cjs/cc/CentralSceneCC.js.map +3 -3
  21. package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
  22. package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
  23. package/build/cjs/cc/ClockCC.js +254 -150
  24. package/build/cjs/cc/ClockCC.js.map +3 -3
  25. package/build/cjs/cc/ColorSwitchCC.js +758 -610
  26. package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
  27. package/build/cjs/cc/ConfigurationCC.js +1700 -1453
  28. package/build/cjs/cc/ConfigurationCC.js.map +3 -3
  29. package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
  30. package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
  31. package/build/cjs/cc/DoorLockCC.js +904 -777
  32. package/build/cjs/cc/DoorLockCC.js.map +3 -3
  33. package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
  34. package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
  35. package/build/cjs/cc/EnergyProductionCC.js +249 -160
  36. package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
  37. package/build/cjs/cc/EntryControlCC.js +619 -458
  38. package/build/cjs/cc/EntryControlCC.js.map +3 -3
  39. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
  40. package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
  41. package/build/cjs/cc/HailCC.js +57 -11
  42. package/build/cjs/cc/HailCC.js.map +2 -2
  43. package/build/cjs/cc/HumidityControlModeCC.js +359 -233
  44. package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
  45. package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
  46. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
  47. package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
  48. package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
  49. package/build/cjs/cc/InclusionControllerCC.js +205 -114
  50. package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
  51. package/build/cjs/cc/IndicatorCC.js +897 -736
  52. package/build/cjs/cc/IndicatorCC.js.map +3 -3
  53. package/build/cjs/cc/IrrigationCC.js +1651 -1405
  54. package/build/cjs/cc/IrrigationCC.js.map +3 -3
  55. package/build/cjs/cc/LanguageCC.js +268 -171
  56. package/build/cjs/cc/LanguageCC.js.map +3 -3
  57. package/build/cjs/cc/LockCC.js +254 -154
  58. package/build/cjs/cc/LockCC.js.map +3 -3
  59. package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
  60. package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
  61. package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
  62. package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
  63. package/build/cjs/cc/MeterCC.js +827 -707
  64. package/build/cjs/cc/MeterCC.js.map +3 -3
  65. package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
  66. package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
  67. package/build/cjs/cc/MultiChannelCC.js +1037 -819
  68. package/build/cjs/cc/MultiChannelCC.js.map +3 -3
  69. package/build/cjs/cc/MultiCommandCC.js +172 -97
  70. package/build/cjs/cc/MultiCommandCC.js.map +3 -3
  71. package/build/cjs/cc/MultilevelSensorCC.js +589 -449
  72. package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
  73. package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
  74. package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
  75. package/build/cjs/cc/NoOperationCC.js +89 -27
  76. package/build/cjs/cc/NoOperationCC.js.map +2 -2
  77. package/build/cjs/cc/NodeNamingCC.js +417 -277
  78. package/build/cjs/cc/NodeNamingCC.js.map +3 -3
  79. package/build/cjs/cc/NotificationCC.js +972 -818
  80. package/build/cjs/cc/NotificationCC.js.map +3 -3
  81. package/build/cjs/cc/PowerlevelCC.js +450 -303
  82. package/build/cjs/cc/PowerlevelCC.js.map +3 -3
  83. package/build/cjs/cc/ProtectionCC.js +686 -494
  84. package/build/cjs/cc/ProtectionCC.js.map +3 -3
  85. package/build/cjs/cc/SceneActivationCC.js +165 -97
  86. package/build/cjs/cc/SceneActivationCC.js.map +3 -3
  87. package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
  88. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
  89. package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
  90. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
  91. package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
  92. package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
  93. package/build/cjs/cc/Security2CC.js +1483 -1219
  94. package/build/cjs/cc/Security2CC.js.map +3 -3
  95. package/build/cjs/cc/SecurityCC.js +839 -619
  96. package/build/cjs/cc/SecurityCC.js.map +3 -3
  97. package/build/cjs/cc/SoundSwitchCC.js +707 -515
  98. package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
  99. package/build/cjs/cc/SupervisionCC.js +327 -237
  100. package/build/cjs/cc/SupervisionCC.js.map +3 -3
  101. package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
  102. package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
  103. package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
  104. package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
  105. package/build/cjs/cc/ThermostatModeCC.js +425 -302
  106. package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
  107. package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
  108. package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
  109. package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
  110. package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
  111. package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
  112. package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
  113. package/build/cjs/cc/TimeCC.js +515 -353
  114. package/build/cjs/cc/TimeCC.js.map +3 -3
  115. package/build/cjs/cc/TimeParametersCC.js +302 -202
  116. package/build/cjs/cc/TimeParametersCC.js.map +3 -3
  117. package/build/cjs/cc/TransportServiceCC.js +433 -315
  118. package/build/cjs/cc/TransportServiceCC.js.map +3 -3
  119. package/build/cjs/cc/UserCodeCC.js +1385 -1102
  120. package/build/cjs/cc/UserCodeCC.js.map +3 -3
  121. package/build/cjs/cc/VersionCC.js +696 -562
  122. package/build/cjs/cc/VersionCC.js.map +3 -3
  123. package/build/cjs/cc/WakeUpCC.js +499 -346
  124. package/build/cjs/cc/WakeUpCC.js.map +3 -3
  125. package/build/cjs/cc/WindowCoveringCC.js +626 -478
  126. package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
  127. package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
  128. package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
  129. package/build/cjs/cc/ZWavePlusCC.js +233 -159
  130. package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
  131. package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
  132. package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
  133. package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  134. package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
  135. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
  136. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
  137. package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
  138. package/build/cjs/lib/CommandClassDecorators.js +19 -20
  139. package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
  140. package/build/cjs/lib/Security2/Extension.d.ts +1 -1
  141. package/build/cjs/lib/Security2/Extension.js +217 -126
  142. package/build/cjs/lib/Security2/Extension.js.map +3 -3
  143. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  144. package/build/esm/cc/AlarmSensorCC.js +389 -291
  145. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  146. package/build/esm/cc/AssociationCC.d.ts.map +1 -1
  147. package/build/esm/cc/AssociationCC.js +678 -537
  148. package/build/esm/cc/AssociationCC.js.map +1 -1
  149. package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
  150. package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
  151. package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
  152. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  153. package/build/esm/cc/BarrierOperatorCC.js +634 -493
  154. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  155. package/build/esm/cc/BasicCC.d.ts.map +1 -1
  156. package/build/esm/cc/BasicCC.js +380 -302
  157. package/build/esm/cc/BasicCC.js.map +1 -1
  158. package/build/esm/cc/BatteryCC.d.ts.map +1 -1
  159. package/build/esm/cc/BatteryCC.js +449 -384
  160. package/build/esm/cc/BatteryCC.js.map +1 -1
  161. package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
  162. package/build/esm/cc/BinarySensorCC.js +395 -297
  163. package/build/esm/cc/BinarySensorCC.js.map +1 -1
  164. package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
  165. package/build/esm/cc/BinarySwitchCC.js +353 -274
  166. package/build/esm/cc/BinarySwitchCC.js.map +1 -1
  167. package/build/esm/cc/CRC16CC.js +162 -98
  168. package/build/esm/cc/CRC16CC.js.map +1 -1
  169. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  170. package/build/esm/cc/CentralSceneCC.js +465 -351
  171. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  172. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  173. package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
  174. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  175. package/build/esm/cc/ClockCC.js +248 -159
  176. package/build/esm/cc/ClockCC.js.map +1 -1
  177. package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
  178. package/build/esm/cc/ColorSwitchCC.js +802 -677
  179. package/build/esm/cc/ColorSwitchCC.js.map +1 -1
  180. package/build/esm/cc/ConfigurationCC.js +1899 -1687
  181. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  182. package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
  183. package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
  184. package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
  185. package/build/esm/cc/DoorLockCC.js +951 -849
  186. package/build/esm/cc/DoorLockCC.js.map +1 -1
  187. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  188. package/build/esm/cc/DoorLockLoggingCC.js +316 -218
  189. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  190. package/build/esm/cc/EnergyProductionCC.js +240 -164
  191. package/build/esm/cc/EnergyProductionCC.js.map +1 -1
  192. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  193. package/build/esm/cc/EntryControlCC.js +629 -493
  194. package/build/esm/cc/EntryControlCC.js.map +1 -1
  195. package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
  196. package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
  197. package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
  198. package/build/esm/cc/HailCC.js +51 -12
  199. package/build/esm/cc/HailCC.js.map +1 -1
  200. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  201. package/build/esm/cc/HumidityControlModeCC.js +357 -250
  202. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  203. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  204. package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
  205. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  206. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  207. package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
  208. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  209. package/build/esm/cc/InclusionControllerCC.js +197 -119
  210. package/build/esm/cc/InclusionControllerCC.js.map +1 -1
  211. package/build/esm/cc/IndicatorCC.js +973 -835
  212. package/build/esm/cc/IndicatorCC.js.map +1 -1
  213. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  214. package/build/esm/cc/IrrigationCC.js +1697 -1496
  215. package/build/esm/cc/IrrigationCC.js.map +1 -1
  216. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  217. package/build/esm/cc/LanguageCC.js +266 -184
  218. package/build/esm/cc/LanguageCC.js.map +1 -1
  219. package/build/esm/cc/LockCC.d.ts.map +1 -1
  220. package/build/esm/cc/LockCC.js +247 -162
  221. package/build/esm/cc/LockCC.js.map +1 -1
  222. package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
  223. package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
  224. package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
  225. package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
  226. package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
  227. package/build/esm/cc/MeterCC.d.ts.map +1 -1
  228. package/build/esm/cc/MeterCC.js +896 -795
  229. package/build/esm/cc/MeterCC.js.map +1 -1
  230. package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
  231. package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
  232. package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
  233. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  234. package/build/esm/cc/MultiChannelCC.js +1106 -921
  235. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  236. package/build/esm/cc/MultiCommandCC.js +166 -102
  237. package/build/esm/cc/MultiCommandCC.js.map +1 -1
  238. package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
  239. package/build/esm/cc/MultilevelSensorCC.js +616 -497
  240. package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
  241. package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
  242. package/build/esm/cc/MultilevelSwitchCC.js +621 -496
  243. package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
  244. package/build/esm/cc/NoOperationCC.js +82 -29
  245. package/build/esm/cc/NoOperationCC.js.map +1 -1
  246. package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
  247. package/build/esm/cc/NodeNamingCC.js +413 -294
  248. package/build/esm/cc/NodeNamingCC.js.map +1 -1
  249. package/build/esm/cc/NotificationCC.d.ts.map +1 -1
  250. package/build/esm/cc/NotificationCC.js +1097 -966
  251. package/build/esm/cc/NotificationCC.js.map +1 -1
  252. package/build/esm/cc/PowerlevelCC.js +437 -311
  253. package/build/esm/cc/PowerlevelCC.js.map +1 -1
  254. package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
  255. package/build/esm/cc/ProtectionCC.js +704 -543
  256. package/build/esm/cc/ProtectionCC.js.map +1 -1
  257. package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
  258. package/build/esm/cc/SceneActivationCC.js +157 -100
  259. package/build/esm/cc/SceneActivationCC.js.map +1 -1
  260. package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
  261. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  262. package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
  263. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  264. package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
  265. package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
  266. package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
  267. package/build/esm/cc/Security2CC.js +1633 -1406
  268. package/build/esm/cc/Security2CC.js.map +1 -1
  269. package/build/esm/cc/SecurityCC.js +876 -687
  270. package/build/esm/cc/SecurityCC.js.map +1 -1
  271. package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
  272. package/build/esm/cc/SoundSwitchCC.js +689 -526
  273. package/build/esm/cc/SoundSwitchCC.js.map +1 -1
  274. package/build/esm/cc/SupervisionCC.js +349 -272
  275. package/build/esm/cc/SupervisionCC.js.map +1 -1
  276. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  277. package/build/esm/cc/ThermostatFanModeCC.js +388 -284
  278. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  279. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  280. package/build/esm/cc/ThermostatFanStateCC.js +184 -111
  281. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  282. package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
  283. package/build/esm/cc/ThermostatModeCC.js +435 -331
  284. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  285. package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
  286. package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
  287. package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
  288. package/build/esm/cc/ThermostatSetbackCC.js +274 -185
  289. package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
  290. package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
  291. package/build/esm/cc/ThermostatSetpointCC.js +674 -543
  292. package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
  293. package/build/esm/cc/TimeCC.js +499 -360
  294. package/build/esm/cc/TimeCC.js.map +1 -1
  295. package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
  296. package/build/esm/cc/TimeParametersCC.js +296 -211
  297. package/build/esm/cc/TimeParametersCC.js.map +1 -1
  298. package/build/esm/cc/TransportServiceCC.js +464 -363
  299. package/build/esm/cc/TransportServiceCC.js.map +1 -1
  300. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  301. package/build/esm/cc/UserCodeCC.js +1443 -1205
  302. package/build/esm/cc/UserCodeCC.js.map +1 -1
  303. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  304. package/build/esm/cc/VersionCC.js +744 -635
  305. package/build/esm/cc/VersionCC.js.map +1 -1
  306. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  307. package/build/esm/cc/WakeUpCC.js +494 -364
  308. package/build/esm/cc/WakeUpCC.js.map +1 -1
  309. package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
  310. package/build/esm/cc/WindowCoveringCC.js +655 -530
  311. package/build/esm/cc/WindowCoveringCC.js.map +1 -1
  312. package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
  313. package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
  314. package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
  315. package/build/esm/cc/ZWavePlusCC.js +223 -162
  316. package/build/esm/cc/ZWavePlusCC.js.map +1 -1
  317. package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
  318. package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
  319. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
  320. package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
  321. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
  322. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  323. package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
  324. package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
  325. package/build/esm/lib/CommandClassDecorators.js +24 -24
  326. package/build/esm/lib/CommandClassDecorators.js.map +1 -1
  327. package/build/esm/lib/Security2/Extension.d.ts +1 -1
  328. package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
  329. package/build/esm/lib/Security2/Extension.js +207 -123
  330. package/build/esm/lib/Security2/Extension.js.map +1 -1
  331. package/package.json +6 -6
@@ -48,13 +48,45 @@ var import_Values = require("../lib/Values.js");
48
48
  var import_Types = require("../lib/_Types.js");
49
49
  var import_serializers = require("../lib/serializers.js");
50
50
  var import_UserCodeCC = require("./UserCodeCC.js");
51
- var __decorate = function(decorators, target, key, desc) {
52
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
53
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
54
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
55
- return c > 3 && r && Object.defineProperty(target, key, r), r;
51
+ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
52
+ function accept(f) {
53
+ if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
54
+ return f;
55
+ }
56
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
57
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
58
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
59
+ var _, done = false;
60
+ for (var i = decorators.length - 1; i >= 0; i--) {
61
+ var context = {};
62
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
63
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
64
+ context.addInitializer = function(f) {
65
+ if (done) throw new TypeError("Cannot add initializers after decoration has completed");
66
+ extraInitializers.push(accept(f || null));
67
+ };
68
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
69
+ if (kind === "accessor") {
70
+ if (result === void 0) continue;
71
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
72
+ if (_ = accept(result.get)) descriptor.get = _;
73
+ if (_ = accept(result.set)) descriptor.set = _;
74
+ if (_ = accept(result.init)) initializers.unshift(_);
75
+ } else if (_ = accept(result)) {
76
+ if (kind === "field") initializers.unshift(_);
77
+ else descriptor[key] = _;
78
+ }
79
+ }
80
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
81
+ done = true;
82
+ };
83
+ var __runInitializers = function(thisArg, initializers, value) {
84
+ var useValue = arguments.length > 2;
85
+ for (var i = 0; i < initializers.length; i++) {
86
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
87
+ }
88
+ return useValue ? value : void 0;
56
89
  };
57
- var ScheduleEntryLockCCEnableSet_1, ScheduleEntryLockCCEnableAllSet_1, ScheduleEntryLockCCSupportedReport_1, ScheduleEntryLockCCWeekDayScheduleSet_1, ScheduleEntryLockCCWeekDayScheduleReport_1, ScheduleEntryLockCCWeekDayScheduleGet_1, ScheduleEntryLockCCYearDayScheduleSet_1, ScheduleEntryLockCCYearDayScheduleReport_1, ScheduleEntryLockCCYearDayScheduleGet_1, ScheduleEntryLockCCTimeOffsetSet_1, ScheduleEntryLockCCTimeOffsetReport_1, ScheduleEntryLockCCDailyRepeatingScheduleSet_1, ScheduleEntryLockCCDailyRepeatingScheduleReport_1, ScheduleEntryLockCCDailyRepeatingScheduleGet_1;
58
90
  function __assertType(argName, typeName, boundHasError) {
59
91
  const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
60
92
  if (boundHasError()) {
@@ -361,940 +393,933 @@ function setUserCodeScheduleEnabledCached(ctx, endpoint, userId, enabled) {
361
393
  setEnabled(userId);
362
394
  }
363
395
  }
364
- let ScheduleEntryLockCCAPI = class ScheduleEntryLockCCAPI2 extends import_API.CCAPI {
365
- supportsCommand(cmd) {
366
- switch (cmd) {
367
- case import_Types.ScheduleEntryLockCommand.EnableSet:
368
- case import_Types.ScheduleEntryLockCommand.EnableAllSet:
369
- case import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet:
370
- case import_Types.ScheduleEntryLockCommand.WeekDayScheduleGet:
371
- case import_Types.ScheduleEntryLockCommand.YearDayScheduleSet:
372
- case import_Types.ScheduleEntryLockCommand.YearDayScheduleGet:
373
- case import_Types.ScheduleEntryLockCommand.SupportedGet:
374
- return true;
375
- // V1
376
- case import_Types.ScheduleEntryLockCommand.TimeOffsetSet:
377
- case import_Types.ScheduleEntryLockCommand.TimeOffsetGet:
378
- return this.version >= 2;
379
- case import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet:
380
- case import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleGet:
381
- return this.version >= 3;
382
- }
383
- return super.supportsCommand(cmd);
384
- }
385
- /**
386
- * Enables or disables schedules. If a user ID is given, that user's
387
- * schedules will be enabled or disabled. If no user ID is given, all schedules
388
- * will be affected.
389
- */
390
- async setEnabled(enabled, userId) {
391
- __assertType("enabled", "boolean", __assertType__boolean.bind(void 0, enabled));
392
- __assertType("userId", "(optional) number", __assertType__optional_number.bind(void 0, userId));
393
- let result;
394
- if (userId != void 0) {
395
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.EnableSet);
396
- const cc = new ScheduleEntryLockCCEnableSet({
397
- nodeId: this.endpoint.nodeId,
398
- endpointIndex: this.endpoint.index,
399
- userId,
400
- enabled
401
- });
402
- result = await this.host.sendCommand(cc, this.commandOptions);
403
- } else {
404
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.EnableAllSet);
405
- const cc = new ScheduleEntryLockCCEnableAllSet({
406
- nodeId: this.endpoint.nodeId,
407
- endpointIndex: this.endpoint.index,
408
- enabled
409
- });
410
- result = await this.host.sendCommand(cc, this.commandOptions);
396
+ let ScheduleEntryLockCCAPI = (() => {
397
+ let _classDecorators = [(0, import_CommandClassDecorators.API)(import_core.CommandClasses["Schedule Entry Lock"])];
398
+ let _classDescriptor;
399
+ let _classExtraInitializers = [];
400
+ let _classThis;
401
+ let _classSuper = import_API.CCAPI;
402
+ var ScheduleEntryLockCCAPI2 = class extends _classSuper {
403
+ static {
404
+ _classThis = this;
411
405
  }
412
- if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
413
- setUserCodeScheduleEnabledCached(this.host, this.endpoint, userId, enabled);
406
+ static {
407
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
408
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
409
+ ScheduleEntryLockCCAPI2 = _classThis = _classDescriptor.value;
410
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
411
+ __runInitializers(_classThis, _classExtraInitializers);
414
412
  }
415
- return result;
416
- }
417
- // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
418
- async getNumSlots() {
419
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.SupportedGet);
420
- const cc = new ScheduleEntryLockCCSupportedGet({
421
- nodeId: this.endpoint.nodeId,
422
- endpointIndex: this.endpoint.index
423
- });
424
- const result = await this.host.sendCommand(cc, this.commandOptions);
425
- if (result) {
426
- return (0, import_shared.pick)(result, [
427
- "numWeekDaySlots",
428
- "numYearDaySlots",
429
- "numDailyRepeatingSlots"
430
- ]);
413
+ supportsCommand(cmd) {
414
+ switch (cmd) {
415
+ case import_Types.ScheduleEntryLockCommand.EnableSet:
416
+ case import_Types.ScheduleEntryLockCommand.EnableAllSet:
417
+ case import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet:
418
+ case import_Types.ScheduleEntryLockCommand.WeekDayScheduleGet:
419
+ case import_Types.ScheduleEntryLockCommand.YearDayScheduleSet:
420
+ case import_Types.ScheduleEntryLockCommand.YearDayScheduleGet:
421
+ case import_Types.ScheduleEntryLockCommand.SupportedGet:
422
+ return true;
423
+ // V1
424
+ case import_Types.ScheduleEntryLockCommand.TimeOffsetSet:
425
+ case import_Types.ScheduleEntryLockCommand.TimeOffsetGet:
426
+ return this.version >= 2;
427
+ case import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet:
428
+ case import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleGet:
429
+ return this.version >= 3;
430
+ }
431
+ return super.supportsCommand(cmd);
431
432
  }
432
- }
433
- async setWeekDaySchedule(slot, schedule) {
434
- __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
435
- __assertType("schedule", "(optional) ScheduleEntryLockWeekDaySchedule", __assertType__optional_ScheduleEntryLockWeekDaySchedule.bind(void 0, schedule));
436
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet);
437
- if (this.isSinglecast()) {
438
- const numSlots = ScheduleEntryLockCC.getNumWeekDaySlotsCached(this.host, this.endpoint);
439
- if (slot.slotId < 1 || slot.slotId > numSlots) {
440
- throw new import_core.ZWaveError(`The schedule slot # must be between 1 and the number of supported day-of-week slots ${numSlots}.`, import_core.ZWaveErrorCodes.Argument_Invalid);
433
+ /**
434
+ * Enables or disables schedules. If a user ID is given, that user's
435
+ * schedules will be enabled or disabled. If no user ID is given, all schedules
436
+ * will be affected.
437
+ */
438
+ async setEnabled(enabled, userId) {
439
+ __assertType("enabled", "boolean", __assertType__boolean.bind(void 0, enabled));
440
+ __assertType("userId", "(optional) number", __assertType__optional_number.bind(void 0, userId));
441
+ let result;
442
+ if (userId != void 0) {
443
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.EnableSet);
444
+ const cc = new ScheduleEntryLockCCEnableSet({
445
+ nodeId: this.endpoint.nodeId,
446
+ endpointIndex: this.endpoint.index,
447
+ userId,
448
+ enabled
449
+ });
450
+ result = await this.host.sendCommand(cc, this.commandOptions);
451
+ } else {
452
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.EnableAllSet);
453
+ const cc = new ScheduleEntryLockCCEnableAllSet({
454
+ nodeId: this.endpoint.nodeId,
455
+ endpointIndex: this.endpoint.index,
456
+ enabled
457
+ });
458
+ result = await this.host.sendCommand(cc, this.commandOptions);
459
+ }
460
+ if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
461
+ setUserCodeScheduleEnabledCached(this.host, this.endpoint, userId, enabled);
441
462
  }
463
+ return result;
442
464
  }
443
- if (schedule) {
444
- if (schedule.stopHour < schedule.startHour || schedule.stopHour === schedule.startHour && schedule.stopMinute <= schedule.startMinute) {
445
- throw new import_core.ZWaveError(`The stop time must be after the start time.`, import_core.ZWaveErrorCodes.Argument_Invalid);
465
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
466
+ async getNumSlots() {
467
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.SupportedGet);
468
+ const cc = new ScheduleEntryLockCCSupportedGet({
469
+ nodeId: this.endpoint.nodeId,
470
+ endpointIndex: this.endpoint.index
471
+ });
472
+ const result = await this.host.sendCommand(cc, this.commandOptions);
473
+ if (result) {
474
+ return (0, import_shared.pick)(result, [
475
+ "numWeekDaySlots",
476
+ "numYearDaySlots",
477
+ "numDailyRepeatingSlots"
478
+ ]);
446
479
  }
447
480
  }
448
- const cc = new ScheduleEntryLockCCWeekDayScheduleSet({
449
- nodeId: this.endpoint.nodeId,
450
- endpointIndex: this.endpoint.index,
451
- ...slot,
452
- ...schedule ? {
453
- action: import_Types.ScheduleEntryLockSetAction.Set,
454
- ...schedule
455
- } : {
456
- action: import_Types.ScheduleEntryLockSetAction.Erase
481
+ async setWeekDaySchedule(slot, schedule) {
482
+ __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
483
+ __assertType("schedule", "(optional) ScheduleEntryLockWeekDaySchedule", __assertType__optional_ScheduleEntryLockWeekDaySchedule.bind(void 0, schedule));
484
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet);
485
+ if (this.isSinglecast()) {
486
+ const numSlots = ScheduleEntryLockCC.getNumWeekDaySlotsCached(this.host, this.endpoint);
487
+ if (slot.slotId < 1 || slot.slotId > numSlots) {
488
+ throw new import_core.ZWaveError(`The schedule slot # must be between 1 and the number of supported day-of-week slots ${numSlots}.`, import_core.ZWaveErrorCodes.Argument_Invalid);
489
+ }
457
490
  }
458
- });
459
- const result = await this.host.sendCommand(cc, this.commandOptions);
460
- if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
461
- if (!!schedule) {
462
- setUserCodeScheduleEnabledCached(this.host, this.endpoint, slot.userId, true);
463
- setUserCodeScheduleKindCached(this.host, this.endpoint, slot.userId, import_Types.ScheduleEntryLockScheduleKind.WeekDay);
491
+ if (schedule) {
492
+ if (schedule.stopHour < schedule.startHour || schedule.stopHour === schedule.startHour && schedule.stopMinute <= schedule.startMinute) {
493
+ throw new import_core.ZWaveError(`The stop time must be after the start time.`, import_core.ZWaveErrorCodes.Argument_Invalid);
494
+ }
464
495
  }
465
- persistSchedule.call(cc, this.host, import_Types.ScheduleEntryLockScheduleKind.WeekDay, slot.userId, slot.slotId, schedule ?? false);
466
- }
467
- return result;
468
- }
469
- async getWeekDaySchedule(slot) {
470
- __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
471
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet);
472
- const cc = new ScheduleEntryLockCCWeekDayScheduleGet({
473
- nodeId: this.endpoint.nodeId,
474
- endpointIndex: this.endpoint.index,
475
- ...slot
476
- });
477
- const result = await this.host.sendCommand(cc, this.commandOptions);
478
- if (result?.weekday != void 0) {
479
- return {
480
- weekday: result.weekday,
481
- startHour: result.startHour,
482
- startMinute: result.startMinute,
483
- stopHour: result.stopHour,
484
- stopMinute: result.stopMinute
485
- };
486
- }
487
- }
488
- async setYearDaySchedule(slot, schedule) {
489
- __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
490
- __assertType("schedule", "(optional) ScheduleEntryLockYearDaySchedule", __assertType__optional_ScheduleEntryLockYearDaySchedule.bind(void 0, schedule));
491
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.YearDayScheduleSet);
492
- if (this.isSinglecast()) {
493
- const numSlots = ScheduleEntryLockCC.getNumYearDaySlotsCached(this.host, this.endpoint);
494
- if (slot.slotId < 1 || slot.slotId > numSlots) {
495
- throw new import_core.ZWaveError(`The schedule slot # must be between 1 and the number of supported day-of-year slots ${numSlots}.`, import_core.ZWaveErrorCodes.Argument_Invalid);
496
+ const cc = new ScheduleEntryLockCCWeekDayScheduleSet({
497
+ nodeId: this.endpoint.nodeId,
498
+ endpointIndex: this.endpoint.index,
499
+ ...slot,
500
+ ...schedule ? {
501
+ action: import_Types.ScheduleEntryLockSetAction.Set,
502
+ ...schedule
503
+ } : {
504
+ action: import_Types.ScheduleEntryLockSetAction.Erase
505
+ }
506
+ });
507
+ const result = await this.host.sendCommand(cc, this.commandOptions);
508
+ if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
509
+ if (!!schedule) {
510
+ setUserCodeScheduleEnabledCached(this.host, this.endpoint, slot.userId, true);
511
+ setUserCodeScheduleKindCached(this.host, this.endpoint, slot.userId, import_Types.ScheduleEntryLockScheduleKind.WeekDay);
512
+ }
513
+ persistSchedule.call(cc, this.host, import_Types.ScheduleEntryLockScheduleKind.WeekDay, slot.userId, slot.slotId, schedule ?? false);
496
514
  }
515
+ return result;
497
516
  }
498
- if (schedule) {
499
- const startDate = new Date(schedule.startYear, schedule.startMonth - 1, schedule.startDay, schedule.startHour, schedule.startMinute);
500
- const stopDate = new Date(schedule.stopYear, schedule.stopMonth - 1, schedule.stopDay, schedule.stopHour, schedule.stopMinute);
501
- if (stopDate <= startDate) {
502
- throw new import_core.ZWaveError(`The stop date must be after the start date.`, import_core.ZWaveErrorCodes.Argument_Invalid);
517
+ async getWeekDaySchedule(slot) {
518
+ __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
519
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet);
520
+ const cc = new ScheduleEntryLockCCWeekDayScheduleGet({
521
+ nodeId: this.endpoint.nodeId,
522
+ endpointIndex: this.endpoint.index,
523
+ ...slot
524
+ });
525
+ const result = await this.host.sendCommand(cc, this.commandOptions);
526
+ if (result?.weekday != void 0) {
527
+ return {
528
+ weekday: result.weekday,
529
+ startHour: result.startHour,
530
+ startMinute: result.startMinute,
531
+ stopHour: result.stopHour,
532
+ stopMinute: result.stopMinute
533
+ };
503
534
  }
504
535
  }
505
- const cc = new ScheduleEntryLockCCYearDayScheduleSet({
506
- nodeId: this.endpoint.nodeId,
507
- endpointIndex: this.endpoint.index,
508
- ...slot,
509
- ...schedule ? {
510
- action: import_Types.ScheduleEntryLockSetAction.Set,
511
- ...schedule
512
- } : {
513
- action: import_Types.ScheduleEntryLockSetAction.Erase
536
+ async setYearDaySchedule(slot, schedule) {
537
+ __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
538
+ __assertType("schedule", "(optional) ScheduleEntryLockYearDaySchedule", __assertType__optional_ScheduleEntryLockYearDaySchedule.bind(void 0, schedule));
539
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.YearDayScheduleSet);
540
+ if (this.isSinglecast()) {
541
+ const numSlots = ScheduleEntryLockCC.getNumYearDaySlotsCached(this.host, this.endpoint);
542
+ if (slot.slotId < 1 || slot.slotId > numSlots) {
543
+ throw new import_core.ZWaveError(`The schedule slot # must be between 1 and the number of supported day-of-year slots ${numSlots}.`, import_core.ZWaveErrorCodes.Argument_Invalid);
544
+ }
545
+ }
546
+ if (schedule) {
547
+ const startDate = new Date(schedule.startYear, schedule.startMonth - 1, schedule.startDay, schedule.startHour, schedule.startMinute);
548
+ const stopDate = new Date(schedule.stopYear, schedule.stopMonth - 1, schedule.stopDay, schedule.stopHour, schedule.stopMinute);
549
+ if (stopDate <= startDate) {
550
+ throw new import_core.ZWaveError(`The stop date must be after the start date.`, import_core.ZWaveErrorCodes.Argument_Invalid);
551
+ }
514
552
  }
515
- });
516
- const result = await this.host.sendCommand(cc, this.commandOptions);
517
- if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
518
- if (!!schedule) {
519
- setUserCodeScheduleEnabledCached(this.host, this.endpoint, slot.userId, true);
520
- setUserCodeScheduleKindCached(this.host, this.endpoint, slot.userId, import_Types.ScheduleEntryLockScheduleKind.YearDay);
553
+ const cc = new ScheduleEntryLockCCYearDayScheduleSet({
554
+ nodeId: this.endpoint.nodeId,
555
+ endpointIndex: this.endpoint.index,
556
+ ...slot,
557
+ ...schedule ? {
558
+ action: import_Types.ScheduleEntryLockSetAction.Set,
559
+ ...schedule
560
+ } : {
561
+ action: import_Types.ScheduleEntryLockSetAction.Erase
562
+ }
563
+ });
564
+ const result = await this.host.sendCommand(cc, this.commandOptions);
565
+ if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
566
+ if (!!schedule) {
567
+ setUserCodeScheduleEnabledCached(this.host, this.endpoint, slot.userId, true);
568
+ setUserCodeScheduleKindCached(this.host, this.endpoint, slot.userId, import_Types.ScheduleEntryLockScheduleKind.YearDay);
569
+ }
570
+ persistSchedule.call(cc, this.host, import_Types.ScheduleEntryLockScheduleKind.YearDay, slot.userId, slot.slotId, schedule ?? false);
521
571
  }
522
- persistSchedule.call(cc, this.host, import_Types.ScheduleEntryLockScheduleKind.YearDay, slot.userId, slot.slotId, schedule ?? false);
572
+ return result;
523
573
  }
524
- return result;
525
- }
526
- async getYearDaySchedule(slot) {
527
- __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
528
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.YearDayScheduleSet);
529
- const cc = new ScheduleEntryLockCCYearDayScheduleGet({
530
- nodeId: this.endpoint.nodeId,
531
- endpointIndex: this.endpoint.index,
532
- ...slot
533
- });
534
- const result = await this.host.sendCommand(cc, this.commandOptions);
535
- if (result?.startYear != void 0) {
536
- return {
537
- startYear: result.startYear,
538
- startMonth: result.startMonth,
539
- startDay: result.startDay,
540
- startHour: result.startHour,
541
- startMinute: result.startMinute,
542
- stopYear: result.stopYear,
543
- stopMonth: result.stopMonth,
544
- stopDay: result.stopDay,
545
- stopHour: result.stopHour,
546
- stopMinute: result.stopMinute
547
- };
574
+ async getYearDaySchedule(slot) {
575
+ __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
576
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.YearDayScheduleSet);
577
+ const cc = new ScheduleEntryLockCCYearDayScheduleGet({
578
+ nodeId: this.endpoint.nodeId,
579
+ endpointIndex: this.endpoint.index,
580
+ ...slot
581
+ });
582
+ const result = await this.host.sendCommand(cc, this.commandOptions);
583
+ if (result?.startYear != void 0) {
584
+ return {
585
+ startYear: result.startYear,
586
+ startMonth: result.startMonth,
587
+ startDay: result.startDay,
588
+ startHour: result.startHour,
589
+ startMinute: result.startMinute,
590
+ stopYear: result.stopYear,
591
+ stopMonth: result.stopMonth,
592
+ stopDay: result.stopDay,
593
+ stopHour: result.stopHour,
594
+ stopMinute: result.stopMinute
595
+ };
596
+ }
548
597
  }
549
- }
550
- async setDailyRepeatingSchedule(slot, schedule) {
551
- __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
552
- __assertType("schedule", "(optional) ScheduleEntryLockDailyRepeatingSchedule", __assertType__optional_ScheduleEntryLockDailyRepeatingSchedule.bind(void 0, schedule));
553
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet);
554
- if (this.isSinglecast()) {
555
- const numSlots = ScheduleEntryLockCC.getNumDailyRepeatingSlotsCached(this.host, this.endpoint);
556
- if (slot.slotId < 1 || slot.slotId > numSlots) {
557
- throw new import_core.ZWaveError(`The schedule slot # must be between 1 and the number of supported daily repeating slots ${numSlots}.`, import_core.ZWaveErrorCodes.Argument_Invalid);
598
+ async setDailyRepeatingSchedule(slot, schedule) {
599
+ __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
600
+ __assertType("schedule", "(optional) ScheduleEntryLockDailyRepeatingSchedule", __assertType__optional_ScheduleEntryLockDailyRepeatingSchedule.bind(void 0, schedule));
601
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet);
602
+ if (this.isSinglecast()) {
603
+ const numSlots = ScheduleEntryLockCC.getNumDailyRepeatingSlotsCached(this.host, this.endpoint);
604
+ if (slot.slotId < 1 || slot.slotId > numSlots) {
605
+ throw new import_core.ZWaveError(`The schedule slot # must be between 1 and the number of supported daily repeating slots ${numSlots}.`, import_core.ZWaveErrorCodes.Argument_Invalid);
606
+ }
607
+ }
608
+ const cc = new ScheduleEntryLockCCDailyRepeatingScheduleSet({
609
+ nodeId: this.endpoint.nodeId,
610
+ endpointIndex: this.endpoint.index,
611
+ ...slot,
612
+ ...schedule ? {
613
+ action: import_Types.ScheduleEntryLockSetAction.Set,
614
+ ...schedule
615
+ } : {
616
+ action: import_Types.ScheduleEntryLockSetAction.Erase
617
+ }
618
+ });
619
+ const result = await this.host.sendCommand(cc, this.commandOptions);
620
+ if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
621
+ if (!!schedule) {
622
+ setUserCodeScheduleEnabledCached(this.host, this.endpoint, slot.userId, true);
623
+ setUserCodeScheduleKindCached(this.host, this.endpoint, slot.userId, import_Types.ScheduleEntryLockScheduleKind.DailyRepeating);
624
+ }
625
+ persistSchedule.call(cc, this.host, import_Types.ScheduleEntryLockScheduleKind.DailyRepeating, slot.userId, slot.slotId, schedule ?? false);
558
626
  }
627
+ return result;
559
628
  }
560
- const cc = new ScheduleEntryLockCCDailyRepeatingScheduleSet({
561
- nodeId: this.endpoint.nodeId,
562
- endpointIndex: this.endpoint.index,
563
- ...slot,
564
- ...schedule ? {
565
- action: import_Types.ScheduleEntryLockSetAction.Set,
566
- ...schedule
567
- } : {
568
- action: import_Types.ScheduleEntryLockSetAction.Erase
629
+ async getDailyRepeatingSchedule(slot) {
630
+ __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
631
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet);
632
+ const cc = new ScheduleEntryLockCCDailyRepeatingScheduleGet({
633
+ nodeId: this.endpoint.nodeId,
634
+ endpointIndex: this.endpoint.index,
635
+ ...slot
636
+ });
637
+ const result = await this.host.sendCommand(cc, this.commandOptions);
638
+ if (result?.weekdays != void 0) {
639
+ return {
640
+ weekdays: result.weekdays,
641
+ startHour: result.startHour,
642
+ startMinute: result.startMinute,
643
+ durationHour: result.durationHour,
644
+ durationMinute: result.durationMinute
645
+ };
569
646
  }
570
- });
571
- const result = await this.host.sendCommand(cc, this.commandOptions);
572
- if (this.isSinglecast() && (0, import_core.isUnsupervisedOrSucceeded)(result)) {
573
- if (!!schedule) {
574
- setUserCodeScheduleEnabledCached(this.host, this.endpoint, slot.userId, true);
575
- setUserCodeScheduleKindCached(this.host, this.endpoint, slot.userId, import_Types.ScheduleEntryLockScheduleKind.DailyRepeating);
647
+ }
648
+ async getTimezone() {
649
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.TimeOffsetGet);
650
+ const cc = new ScheduleEntryLockCCTimeOffsetGet({
651
+ nodeId: this.endpoint.nodeId,
652
+ endpointIndex: this.endpoint.index
653
+ });
654
+ const result = await this.host.sendCommand(cc, this.commandOptions);
655
+ if (result) {
656
+ return (0, import_shared.pick)(result, ["standardOffset", "dstOffset"]);
576
657
  }
577
- persistSchedule.call(cc, this.host, import_Types.ScheduleEntryLockScheduleKind.DailyRepeating, slot.userId, slot.slotId, schedule ?? false);
578
658
  }
579
- return result;
580
- }
581
- async getDailyRepeatingSchedule(slot) {
582
- __assertType("slot", "ScheduleEntryLockSlotId", __assertType__ScheduleEntryLockSlotId.bind(void 0, slot));
583
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet);
584
- const cc = new ScheduleEntryLockCCDailyRepeatingScheduleGet({
585
- nodeId: this.endpoint.nodeId,
586
- endpointIndex: this.endpoint.index,
587
- ...slot
588
- });
589
- const result = await this.host.sendCommand(cc, this.commandOptions);
590
- if (result?.weekdays != void 0) {
591
- return {
592
- weekdays: result.weekdays,
593
- startHour: result.startHour,
594
- startMinute: result.startMinute,
595
- durationHour: result.durationHour,
596
- durationMinute: result.durationMinute
597
- };
659
+ async setTimezone(timezone) {
660
+ __assertType("timezone", "Timezone", __assertType__Timezone.bind(void 0, timezone));
661
+ this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.TimeOffsetSet);
662
+ const cc = new ScheduleEntryLockCCTimeOffsetSet({
663
+ nodeId: this.endpoint.nodeId,
664
+ endpointIndex: this.endpoint.index,
665
+ ...timezone
666
+ });
667
+ return this.host.sendCommand(cc, this.commandOptions);
598
668
  }
599
- }
600
- async getTimezone() {
601
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.TimeOffsetGet);
602
- const cc = new ScheduleEntryLockCCTimeOffsetGet({
603
- nodeId: this.endpoint.nodeId,
604
- endpointIndex: this.endpoint.index
605
- });
606
- const result = await this.host.sendCommand(cc, this.commandOptions);
607
- if (result) {
608
- return (0, import_shared.pick)(result, ["standardOffset", "dstOffset"]);
669
+ };
670
+ return ScheduleEntryLockCCAPI2 = _classThis;
671
+ })();
672
+ let ScheduleEntryLockCC = (() => {
673
+ let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Schedule Entry Lock"]), (0, import_CommandClassDecorators.implementedVersion)(3), (0, import_CommandClassDecorators.ccValues)(ScheduleEntryLockCCValues)];
674
+ let _classDescriptor;
675
+ let _classExtraInitializers = [];
676
+ let _classThis;
677
+ let _classSuper = import_CommandClass.CommandClass;
678
+ var ScheduleEntryLockCC2 = class extends _classSuper {
679
+ static {
680
+ _classThis = this;
609
681
  }
610
- }
611
- async setTimezone(timezone) {
612
- __assertType("timezone", "Timezone", __assertType__Timezone.bind(void 0, timezone));
613
- this.assertSupportsCommand(import_Types.ScheduleEntryLockCommand, import_Types.ScheduleEntryLockCommand.TimeOffsetSet);
614
- const cc = new ScheduleEntryLockCCTimeOffsetSet({
615
- nodeId: this.endpoint.nodeId,
616
- endpointIndex: this.endpoint.index,
617
- ...timezone
618
- });
619
- return this.host.sendCommand(cc, this.commandOptions);
620
- }
621
- };
622
- ScheduleEntryLockCCAPI = __decorate([
623
- (0, import_CommandClassDecorators.API)(import_core.CommandClasses["Schedule Entry Lock"])
624
- ], ScheduleEntryLockCCAPI);
625
- let ScheduleEntryLockCC = class ScheduleEntryLockCC2 extends import_CommandClass.CommandClass {
626
- async interview(ctx) {
627
- const node = this.getNode(ctx);
628
- const endpoint = this.getEndpoint(ctx);
629
- const api = import_API.CCAPI.create(import_core.CommandClasses["Schedule Entry Lock"], ctx, endpoint).withOptions({
630
- priority: import_core.MessagePriority.NodeQuery
631
- });
632
- ctx.logNode(node.id, {
633
- endpoint: this.endpointIndex,
634
- message: `Interviewing ${this.ccName}...`,
635
- direction: "none"
636
- });
637
- ctx.logNode(node.id, {
638
- endpoint: this.endpointIndex,
639
- message: "Querying supported number of schedule slots...",
640
- direction: "outbound"
641
- });
642
- const slotsResp = await api.getNumSlots();
643
- if (slotsResp) {
644
- let logMessage = `received supported number of schedule slots:
645
- day of week: ${slotsResp.numWeekDaySlots}
646
- day of year: ${slotsResp.numYearDaySlots}`;
647
- if (slotsResp.numDailyRepeatingSlots != void 0) {
648
- logMessage += `
649
- daily repeating: ${slotsResp.numDailyRepeatingSlots}`;
650
- }
682
+ static {
683
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
684
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
685
+ ScheduleEntryLockCC2 = _classThis = _classDescriptor.value;
686
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
687
+ __runInitializers(_classThis, _classExtraInitializers);
688
+ }
689
+ async interview(ctx) {
690
+ const node = this.getNode(ctx);
691
+ const endpoint = this.getEndpoint(ctx);
692
+ const api = import_API.CCAPI.create(import_core.CommandClasses["Schedule Entry Lock"], ctx, endpoint).withOptions({
693
+ priority: import_core.MessagePriority.NodeQuery
694
+ });
651
695
  ctx.logNode(node.id, {
652
696
  endpoint: this.endpointIndex,
653
- message: logMessage,
654
- direction: "inbound"
697
+ message: `Interviewing ${this.ccName}...`,
698
+ direction: "none"
655
699
  });
656
- }
657
- if (api.supportsCommand(import_Types.ScheduleEntryLockCommand.TimeOffsetSet) && (!endpoint.supportsCC(import_core.CommandClasses.Time) || endpoint.getCCVersion(import_core.CommandClasses.Time) < 2)) {
658
700
  ctx.logNode(node.id, {
659
701
  endpoint: this.endpointIndex,
660
- message: "setting timezone information...",
702
+ message: "Querying supported number of schedule slots...",
661
703
  direction: "outbound"
662
704
  });
663
- const timezone = (0, import_core.getDSTInfo)();
664
- await api.setTimezone(timezone);
665
- }
666
- this.setInterviewComplete(ctx, true);
667
- }
668
- /**
669
- * Returns the number of supported day-of-week slots.
670
- * This only works AFTER the interview process
671
- */
672
- static getNumWeekDaySlotsCached(ctx, endpoint) {
673
- return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.numWeekDaySlots.endpoint(endpoint.index)) || 0;
674
- }
675
- /**
676
- * Returns the number of supported day-of-year slots.
677
- * This only works AFTER the interview process
678
- */
679
- static getNumYearDaySlotsCached(ctx, endpoint) {
680
- return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.numYearDaySlots.endpoint(endpoint.index)) || 0;
681
- }
682
- /**
683
- * Returns the number of supported daily-repeating slots.
684
- * This only works AFTER the interview process
685
- */
686
- static getNumDailyRepeatingSlotsCached(ctx, endpoint) {
687
- return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.numDailyRepeatingSlots.endpoint(endpoint.index)) || 0;
688
- }
689
- /**
690
- * Returns whether scheduling for a given user ID (most likely) enabled. Since the Schedule Entry Lock CC
691
- * provides no way to query the enabled state, Z-Wave JS tracks this in its own cache.
692
- *
693
- * This only works AFTER the interview process and is likely to be wrong if a device
694
- * with existing schedules is queried. To be sure, disable scheduling for all users and enable
695
- * only the desired ones.
696
- */
697
- static getUserCodeScheduleEnabledCached(ctx, endpoint, userId) {
698
- return !!ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.userEnabled(userId).endpoint(endpoint.index));
699
- }
700
- /**
701
- * Returns which scheduling kind is (most likely) enabled for a given user ID . Since the Schedule Entry Lock CC
702
- * provides no way to query the current state, Z-Wave JS tracks this in its own cache.
703
- *
704
- * This only works AFTER the interview process and is likely to be wrong if a device
705
- * with existing schedules is queried. To be sure, edit a schedule of the desired kind
706
- * which will automatically switch the user to that scheduling kind.
707
- */
708
- static getUserCodeScheduleKindCached(ctx, endpoint, userId) {
709
- return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.scheduleKind(userId).endpoint(endpoint.index));
710
- }
711
- /**
712
- * Returns the assumed state of a schedule. Since the Schedule Entry Lock CC
713
- * provides no way to query the current state, Z-Wave JS tracks this in its own cache.
714
- *
715
- * A return value of `false` means the slot is empty, a return value of `undefined` means the information is not cached yet.
716
- *
717
- * This only works AFTER the interview process.
718
- */
719
- static getScheduleCached(ctx, endpoint, scheduleKind, userId, slotId) {
720
- return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.schedule(scheduleKind, userId, slotId).endpoint(endpoint.index));
721
- }
722
- };
723
- ScheduleEntryLockCC = __decorate([
724
- (0, import_CommandClassDecorators.commandClass)(import_core.CommandClasses["Schedule Entry Lock"]),
725
- (0, import_CommandClassDecorators.implementedVersion)(3),
726
- (0, import_CommandClassDecorators.ccValues)(ScheduleEntryLockCCValues)
727
- ], ScheduleEntryLockCC);
728
- let ScheduleEntryLockCCEnableSet = ScheduleEntryLockCCEnableSet_1 = class ScheduleEntryLockCCEnableSet2 extends ScheduleEntryLockCC {
729
- constructor(options) {
730
- super(options);
731
- this.userId = options.userId;
732
- this.enabled = options.enabled;
733
- }
734
- static from(raw, ctx) {
735
- (0, import_core.validatePayload)(raw.payload.length >= 2);
736
- const userId = raw.payload[0];
737
- const enabled = raw.payload[1] === 1;
738
- return new ScheduleEntryLockCCEnableSet_1({
739
- nodeId: ctx.sourceNodeId,
740
- userId,
741
- enabled
742
- });
743
- }
744
- userId;
745
- enabled;
746
- serialize(ctx) {
747
- this.payload = import_shared.Bytes.from([this.userId, this.enabled ? 1 : 0]);
748
- return super.serialize(ctx);
749
- }
750
- toLogEntry(ctx) {
751
- return {
752
- ...super.toLogEntry(ctx),
753
- message: {
754
- "user ID": this.userId,
755
- action: this.enabled ? "enable" : "disable"
705
+ const slotsResp = await api.getNumSlots();
706
+ if (slotsResp) {
707
+ let logMessage = `received supported number of schedule slots:
708
+ day of week: ${slotsResp.numWeekDaySlots}
709
+ day of year: ${slotsResp.numYearDaySlots}`;
710
+ if (slotsResp.numDailyRepeatingSlots != void 0) {
711
+ logMessage += `
712
+ daily repeating: ${slotsResp.numDailyRepeatingSlots}`;
713
+ }
714
+ ctx.logNode(node.id, {
715
+ endpoint: this.endpointIndex,
716
+ message: logMessage,
717
+ direction: "inbound"
718
+ });
756
719
  }
757
- };
758
- }
759
- };
760
- ScheduleEntryLockCCEnableSet = ScheduleEntryLockCCEnableSet_1 = __decorate([
761
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.EnableSet),
762
- (0, import_CommandClassDecorators.useSupervision)()
763
- ], ScheduleEntryLockCCEnableSet);
764
- let ScheduleEntryLockCCEnableAllSet = ScheduleEntryLockCCEnableAllSet_1 = class ScheduleEntryLockCCEnableAllSet2 extends ScheduleEntryLockCC {
765
- constructor(options) {
766
- super(options);
767
- this.enabled = options.enabled;
768
- }
769
- static from(raw, ctx) {
770
- (0, import_core.validatePayload)(raw.payload.length >= 1);
771
- const enabled = raw.payload[0] === 1;
772
- return new ScheduleEntryLockCCEnableAllSet_1({
773
- nodeId: ctx.sourceNodeId,
774
- enabled
775
- });
776
- }
777
- enabled;
778
- serialize(ctx) {
779
- this.payload = import_shared.Bytes.from([this.enabled ? 1 : 0]);
780
- return super.serialize(ctx);
781
- }
782
- toLogEntry(ctx) {
783
- return {
784
- ...super.toLogEntry(ctx),
785
- message: {
786
- action: this.enabled ? "enable all" : "disable all"
720
+ if (api.supportsCommand(import_Types.ScheduleEntryLockCommand.TimeOffsetSet) && (!endpoint.supportsCC(import_core.CommandClasses.Time) || endpoint.getCCVersion(import_core.CommandClasses.Time) < 2)) {
721
+ ctx.logNode(node.id, {
722
+ endpoint: this.endpointIndex,
723
+ message: "setting timezone information...",
724
+ direction: "outbound"
725
+ });
726
+ const timezone = (0, import_core.getDSTInfo)();
727
+ await api.setTimezone(timezone);
787
728
  }
788
- };
789
- }
790
- };
791
- ScheduleEntryLockCCEnableAllSet = ScheduleEntryLockCCEnableAllSet_1 = __decorate([
792
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.EnableAllSet),
793
- (0, import_CommandClassDecorators.useSupervision)()
794
- ], ScheduleEntryLockCCEnableAllSet);
795
- let ScheduleEntryLockCCSupportedReport = ScheduleEntryLockCCSupportedReport_1 = class ScheduleEntryLockCCSupportedReport2 extends ScheduleEntryLockCC {
796
- constructor(options) {
797
- super(options);
798
- this.numWeekDaySlots = options.numWeekDaySlots;
799
- this.numYearDaySlots = options.numYearDaySlots;
800
- this.numDailyRepeatingSlots = options.numDailyRepeatingSlots;
801
- }
802
- static from(raw, ctx) {
803
- (0, import_core.validatePayload)(raw.payload.length >= 2);
804
- const numWeekDaySlots = raw.payload[0];
805
- const numYearDaySlots = raw.payload[1];
806
- let numDailyRepeatingSlots;
807
- if (raw.payload.length >= 3) {
808
- numDailyRepeatingSlots = raw.payload[2];
809
- }
810
- return new ScheduleEntryLockCCSupportedReport_1({
811
- nodeId: ctx.sourceNodeId,
812
- numWeekDaySlots,
813
- numYearDaySlots,
814
- numDailyRepeatingSlots
815
- });
816
- }
817
- numWeekDaySlots;
818
- numYearDaySlots;
819
- numDailyRepeatingSlots;
820
- serialize(ctx) {
821
- this.payload = import_shared.Bytes.from([
822
- this.numWeekDaySlots,
823
- this.numYearDaySlots,
824
- this.numDailyRepeatingSlots ?? 0
825
- ]);
826
- return super.serialize(ctx);
827
- }
828
- toLogEntry(ctx) {
829
- const message = {
830
- "no. of weekday schedule slots": this.numWeekDaySlots,
831
- "no. of day-of-year schedule slots": this.numYearDaySlots
832
- };
833
- if (this.numDailyRepeatingSlots != void 0) {
834
- message["no. of daily repeating schedule slots"] = this.numDailyRepeatingSlots;
729
+ this.setInterviewComplete(ctx, true);
835
730
  }
836
- return {
837
- ...super.toLogEntry(ctx),
838
- message
839
- };
840
- }
841
- };
842
- __decorate([
843
- (0, import_CommandClassDecorators.ccValue)(ScheduleEntryLockCCValues.numWeekDaySlots)
844
- ], ScheduleEntryLockCCSupportedReport.prototype, "numWeekDaySlots", void 0);
845
- __decorate([
846
- (0, import_CommandClassDecorators.ccValue)(ScheduleEntryLockCCValues.numYearDaySlots)
847
- ], ScheduleEntryLockCCSupportedReport.prototype, "numYearDaySlots", void 0);
848
- __decorate([
849
- (0, import_CommandClassDecorators.ccValue)(ScheduleEntryLockCCValues.numDailyRepeatingSlots)
850
- ], ScheduleEntryLockCCSupportedReport.prototype, "numDailyRepeatingSlots", void 0);
851
- ScheduleEntryLockCCSupportedReport = ScheduleEntryLockCCSupportedReport_1 = __decorate([
852
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.SupportedReport)
853
- ], ScheduleEntryLockCCSupportedReport);
854
- let ScheduleEntryLockCCSupportedGet = class ScheduleEntryLockCCSupportedGet2 extends ScheduleEntryLockCC {
855
- };
856
- ScheduleEntryLockCCSupportedGet = __decorate([
857
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.SupportedGet),
858
- (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCSupportedReport)
859
- ], ScheduleEntryLockCCSupportedGet);
860
- let ScheduleEntryLockCCWeekDayScheduleSet = ScheduleEntryLockCCWeekDayScheduleSet_1 = class ScheduleEntryLockCCWeekDayScheduleSet2 extends ScheduleEntryLockCC {
861
- constructor(options) {
862
- super(options);
863
- this.userId = options.userId;
864
- this.slotId = options.slotId;
865
- this.action = options.action;
866
- if (options.action === import_Types.ScheduleEntryLockSetAction.Set) {
867
- this.weekday = options.weekday;
868
- this.startHour = options.startHour;
869
- this.startMinute = options.startMinute;
870
- this.stopHour = options.stopHour;
871
- this.stopMinute = options.stopMinute;
731
+ /**
732
+ * Returns the number of supported day-of-week slots.
733
+ * This only works AFTER the interview process
734
+ */
735
+ static getNumWeekDaySlotsCached(ctx, endpoint) {
736
+ return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.numWeekDaySlots.endpoint(endpoint.index)) || 0;
872
737
  }
873
- }
874
- static from(raw, ctx) {
875
- (0, import_core.validatePayload)(raw.payload.length >= 3);
876
- const action = raw.payload[0];
877
- (0, import_core.validatePayload)(action === import_Types.ScheduleEntryLockSetAction.Set || action === import_Types.ScheduleEntryLockSetAction.Erase);
878
- const userId = raw.payload[1];
879
- const slotId = raw.payload[2];
880
- if (action !== import_Types.ScheduleEntryLockSetAction.Set) {
881
- return new ScheduleEntryLockCCWeekDayScheduleSet_1({
738
+ /**
739
+ * Returns the number of supported day-of-year slots.
740
+ * This only works AFTER the interview process
741
+ */
742
+ static getNumYearDaySlotsCached(ctx, endpoint) {
743
+ return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.numYearDaySlots.endpoint(endpoint.index)) || 0;
744
+ }
745
+ /**
746
+ * Returns the number of supported daily-repeating slots.
747
+ * This only works AFTER the interview process
748
+ */
749
+ static getNumDailyRepeatingSlotsCached(ctx, endpoint) {
750
+ return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.numDailyRepeatingSlots.endpoint(endpoint.index)) || 0;
751
+ }
752
+ /**
753
+ * Returns whether scheduling for a given user ID (most likely) enabled. Since the Schedule Entry Lock CC
754
+ * provides no way to query the enabled state, Z-Wave JS tracks this in its own cache.
755
+ *
756
+ * This only works AFTER the interview process and is likely to be wrong if a device
757
+ * with existing schedules is queried. To be sure, disable scheduling for all users and enable
758
+ * only the desired ones.
759
+ */
760
+ static getUserCodeScheduleEnabledCached(ctx, endpoint, userId) {
761
+ return !!ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.userEnabled(userId).endpoint(endpoint.index));
762
+ }
763
+ /**
764
+ * Returns which scheduling kind is (most likely) enabled for a given user ID . Since the Schedule Entry Lock CC
765
+ * provides no way to query the current state, Z-Wave JS tracks this in its own cache.
766
+ *
767
+ * This only works AFTER the interview process and is likely to be wrong if a device
768
+ * with existing schedules is queried. To be sure, edit a schedule of the desired kind
769
+ * which will automatically switch the user to that scheduling kind.
770
+ */
771
+ static getUserCodeScheduleKindCached(ctx, endpoint, userId) {
772
+ return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.scheduleKind(userId).endpoint(endpoint.index));
773
+ }
774
+ /**
775
+ * Returns the assumed state of a schedule. Since the Schedule Entry Lock CC
776
+ * provides no way to query the current state, Z-Wave JS tracks this in its own cache.
777
+ *
778
+ * A return value of `false` means the slot is empty, a return value of `undefined` means the information is not cached yet.
779
+ *
780
+ * This only works AFTER the interview process.
781
+ */
782
+ static getScheduleCached(ctx, endpoint, scheduleKind, userId, slotId) {
783
+ return ctx.getValueDB(endpoint.nodeId).getValue(ScheduleEntryLockCCValues.schedule(scheduleKind, userId, slotId).endpoint(endpoint.index));
784
+ }
785
+ };
786
+ return ScheduleEntryLockCC2 = _classThis;
787
+ })();
788
+ let ScheduleEntryLockCCEnableSet = (() => {
789
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.EnableSet), (0, import_CommandClassDecorators.useSupervision)()];
790
+ let _classDescriptor;
791
+ let _classExtraInitializers = [];
792
+ let _classThis;
793
+ let _classSuper = ScheduleEntryLockCC;
794
+ var ScheduleEntryLockCCEnableSet2 = class extends _classSuper {
795
+ static {
796
+ _classThis = this;
797
+ }
798
+ static {
799
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
800
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
801
+ ScheduleEntryLockCCEnableSet2 = _classThis = _classDescriptor.value;
802
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
803
+ __runInitializers(_classThis, _classExtraInitializers);
804
+ }
805
+ constructor(options) {
806
+ super(options);
807
+ this.userId = options.userId;
808
+ this.enabled = options.enabled;
809
+ }
810
+ static from(raw, ctx) {
811
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
812
+ const userId = raw.payload[0];
813
+ const enabled = raw.payload[1] === 1;
814
+ return new this({
882
815
  nodeId: ctx.sourceNodeId,
883
- action,
884
816
  userId,
885
- slotId
817
+ enabled
886
818
  });
887
819
  }
888
- (0, import_core.validatePayload)(raw.payload.length >= 8);
889
- const weekday = raw.payload[3];
890
- const startHour = raw.payload[4];
891
- const startMinute = raw.payload[5];
892
- const stopHour = raw.payload[6];
893
- const stopMinute = raw.payload[7];
894
- return new ScheduleEntryLockCCWeekDayScheduleSet_1({
895
- nodeId: ctx.sourceNodeId,
896
- action,
897
- userId,
898
- slotId,
899
- weekday,
900
- startHour,
901
- startMinute,
902
- stopHour,
903
- stopMinute
904
- });
905
- }
906
- userId;
907
- slotId;
908
- action;
909
- weekday;
910
- startHour;
911
- startMinute;
912
- stopHour;
913
- stopMinute;
914
- serialize(ctx) {
915
- this.payload = import_shared.Bytes.from([
916
- this.action,
917
- this.userId,
918
- this.slotId,
919
- // The report should have these fields set to 0xff
920
- // if the slot is erased. The specs don't mention anything
921
- // for the Set command, so we just assume the same is okay
922
- this.weekday ?? 255,
923
- this.startHour ?? 255,
924
- this.startMinute ?? 255,
925
- this.stopHour ?? 255,
926
- this.stopMinute ?? 255
927
- ]);
928
- return super.serialize(ctx);
929
- }
930
- toLogEntry(ctx) {
931
- let message;
932
- if (this.action === import_Types.ScheduleEntryLockSetAction.Erase) {
933
- message = {
934
- "user ID": this.userId,
935
- "slot #": this.slotId,
936
- action: "erase"
820
+ userId;
821
+ enabled;
822
+ serialize(ctx) {
823
+ this.payload = import_shared.Bytes.from([this.userId, this.enabled ? 1 : 0]);
824
+ return super.serialize(ctx);
825
+ }
826
+ toLogEntry(ctx) {
827
+ return {
828
+ ...super.toLogEntry(ctx),
829
+ message: {
830
+ "user ID": this.userId,
831
+ action: this.enabled ? "enable" : "disable"
832
+ }
937
833
  };
938
- } else {
939
- message = {
940
- "user ID": this.userId,
941
- "slot #": this.slotId,
942
- action: "set",
943
- weekday: (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, this.weekday),
944
- "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
945
- "end time": (0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)
834
+ }
835
+ };
836
+ return ScheduleEntryLockCCEnableSet2 = _classThis;
837
+ })();
838
+ let ScheduleEntryLockCCEnableAllSet = (() => {
839
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.EnableAllSet), (0, import_CommandClassDecorators.useSupervision)()];
840
+ let _classDescriptor;
841
+ let _classExtraInitializers = [];
842
+ let _classThis;
843
+ let _classSuper = ScheduleEntryLockCC;
844
+ var ScheduleEntryLockCCEnableAllSet2 = class extends _classSuper {
845
+ static {
846
+ _classThis = this;
847
+ }
848
+ static {
849
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
850
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
851
+ ScheduleEntryLockCCEnableAllSet2 = _classThis = _classDescriptor.value;
852
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
853
+ __runInitializers(_classThis, _classExtraInitializers);
854
+ }
855
+ constructor(options) {
856
+ super(options);
857
+ this.enabled = options.enabled;
858
+ }
859
+ static from(raw, ctx) {
860
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
861
+ const enabled = raw.payload[0] === 1;
862
+ return new this({
863
+ nodeId: ctx.sourceNodeId,
864
+ enabled
865
+ });
866
+ }
867
+ enabled;
868
+ serialize(ctx) {
869
+ this.payload = import_shared.Bytes.from([this.enabled ? 1 : 0]);
870
+ return super.serialize(ctx);
871
+ }
872
+ toLogEntry(ctx) {
873
+ return {
874
+ ...super.toLogEntry(ctx),
875
+ message: {
876
+ action: this.enabled ? "enable all" : "disable all"
877
+ }
946
878
  };
947
879
  }
948
- return {
949
- ...super.toLogEntry(ctx),
950
- message
951
- };
952
- }
953
- };
954
- ScheduleEntryLockCCWeekDayScheduleSet = ScheduleEntryLockCCWeekDayScheduleSet_1 = __decorate([
955
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet),
956
- (0, import_CommandClassDecorators.useSupervision)()
957
- ], ScheduleEntryLockCCWeekDayScheduleSet);
958
- let ScheduleEntryLockCCWeekDayScheduleReport = ScheduleEntryLockCCWeekDayScheduleReport_1 = class ScheduleEntryLockCCWeekDayScheduleReport2 extends ScheduleEntryLockCC {
959
- constructor(options) {
960
- super(options);
961
- this.userId = options.userId;
962
- this.slotId = options.slotId;
963
- this.weekday = options.weekday;
964
- this.startHour = options.startHour;
965
- this.startMinute = options.startMinute;
966
- this.stopHour = options.stopHour;
967
- this.stopMinute = options.stopMinute;
968
- }
969
- static from(raw, ctx) {
970
- (0, import_core.validatePayload)(raw.payload.length >= 2);
971
- const userId = raw.payload[0];
972
- const slotId = raw.payload[1];
973
- let ccOptions = {
974
- userId,
975
- slotId
976
- };
977
- let weekday;
978
- let startHour;
979
- let startMinute;
980
- let stopHour;
981
- let stopMinute;
982
- if (raw.payload.length >= 7) {
983
- if (raw.payload[2] !== 255) {
984
- weekday = raw.payload[2];
985
- }
986
- if (raw.payload[3] !== 255) {
987
- startHour = raw.payload[3];
988
- }
989
- if (raw.payload[4] !== 255) {
990
- startMinute = raw.payload[4];
880
+ };
881
+ return ScheduleEntryLockCCEnableAllSet2 = _classThis;
882
+ })();
883
+ let ScheduleEntryLockCCSupportedReport = (() => {
884
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.SupportedReport), (0, import_CommandClassDecorators.ccValueProperty)("numWeekDaySlots", ScheduleEntryLockCCValues.numWeekDaySlots), (0, import_CommandClassDecorators.ccValueProperty)("numYearDaySlots", ScheduleEntryLockCCValues.numYearDaySlots), (0, import_CommandClassDecorators.ccValueProperty)("numDailyRepeatingSlots", ScheduleEntryLockCCValues.numDailyRepeatingSlots)];
885
+ let _classDescriptor;
886
+ let _classExtraInitializers = [];
887
+ let _classThis;
888
+ let _classSuper = ScheduleEntryLockCC;
889
+ var ScheduleEntryLockCCSupportedReport2 = class extends _classSuper {
890
+ static {
891
+ _classThis = this;
892
+ }
893
+ static {
894
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
895
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
896
+ ScheduleEntryLockCCSupportedReport2 = _classThis = _classDescriptor.value;
897
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
898
+ __runInitializers(_classThis, _classExtraInitializers);
899
+ }
900
+ constructor(options) {
901
+ super(options);
902
+ this.numWeekDaySlots = options.numWeekDaySlots;
903
+ this.numYearDaySlots = options.numYearDaySlots;
904
+ this.numDailyRepeatingSlots = options.numDailyRepeatingSlots;
905
+ }
906
+ static from(raw, ctx) {
907
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
908
+ const numWeekDaySlots = raw.payload[0];
909
+ const numYearDaySlots = raw.payload[1];
910
+ let numDailyRepeatingSlots;
911
+ if (raw.payload.length >= 3) {
912
+ numDailyRepeatingSlots = raw.payload[2];
991
913
  }
992
- if (raw.payload[5] !== 255) {
993
- stopHour = raw.payload[5];
914
+ return new this({
915
+ nodeId: ctx.sourceNodeId,
916
+ numWeekDaySlots,
917
+ numYearDaySlots,
918
+ numDailyRepeatingSlots
919
+ });
920
+ }
921
+ numWeekDaySlots;
922
+ numYearDaySlots;
923
+ numDailyRepeatingSlots;
924
+ serialize(ctx) {
925
+ this.payload = import_shared.Bytes.from([
926
+ this.numWeekDaySlots,
927
+ this.numYearDaySlots,
928
+ this.numDailyRepeatingSlots ?? 0
929
+ ]);
930
+ return super.serialize(ctx);
931
+ }
932
+ toLogEntry(ctx) {
933
+ const message = {
934
+ "no. of weekday schedule slots": this.numWeekDaySlots,
935
+ "no. of day-of-year schedule slots": this.numYearDaySlots
936
+ };
937
+ if (this.numDailyRepeatingSlots != void 0) {
938
+ message["no. of daily repeating schedule slots"] = this.numDailyRepeatingSlots;
994
939
  }
995
- if (raw.payload[6] !== 255) {
996
- stopMinute = raw.payload[6];
940
+ return {
941
+ ...super.toLogEntry(ctx),
942
+ message
943
+ };
944
+ }
945
+ };
946
+ return ScheduleEntryLockCCSupportedReport2 = _classThis;
947
+ })();
948
+ let ScheduleEntryLockCCSupportedGet = (() => {
949
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.SupportedGet), (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCSupportedReport)];
950
+ let _classDescriptor;
951
+ let _classExtraInitializers = [];
952
+ let _classThis;
953
+ let _classSuper = ScheduleEntryLockCC;
954
+ var ScheduleEntryLockCCSupportedGet2 = class extends _classSuper {
955
+ static {
956
+ _classThis = this;
957
+ }
958
+ static {
959
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
960
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
961
+ ScheduleEntryLockCCSupportedGet2 = _classThis = _classDescriptor.value;
962
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
963
+ __runInitializers(_classThis, _classExtraInitializers);
964
+ }
965
+ };
966
+ return ScheduleEntryLockCCSupportedGet2 = _classThis;
967
+ })();
968
+ let ScheduleEntryLockCCWeekDayScheduleSet = (() => {
969
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.WeekDayScheduleSet), (0, import_CommandClassDecorators.useSupervision)()];
970
+ let _classDescriptor;
971
+ let _classExtraInitializers = [];
972
+ let _classThis;
973
+ let _classSuper = ScheduleEntryLockCC;
974
+ var ScheduleEntryLockCCWeekDayScheduleSet2 = class extends _classSuper {
975
+ static {
976
+ _classThis = this;
977
+ }
978
+ static {
979
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
980
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
981
+ ScheduleEntryLockCCWeekDayScheduleSet2 = _classThis = _classDescriptor.value;
982
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
983
+ __runInitializers(_classThis, _classExtraInitializers);
984
+ }
985
+ constructor(options) {
986
+ super(options);
987
+ this.userId = options.userId;
988
+ this.slotId = options.slotId;
989
+ this.action = options.action;
990
+ if (options.action === import_Types.ScheduleEntryLockSetAction.Set) {
991
+ this.weekday = options.weekday;
992
+ this.startHour = options.startHour;
993
+ this.startMinute = options.startMinute;
994
+ this.stopHour = options.stopHour;
995
+ this.stopMinute = options.stopMinute;
997
996
  }
998
997
  }
999
- if (weekday != void 0 && startHour != void 0 && startMinute != void 0 && stopHour != void 0 && stopMinute != void 0) {
1000
- ccOptions = {
1001
- ...ccOptions,
998
+ static from(raw, ctx) {
999
+ (0, import_core.validatePayload)(raw.payload.length >= 3);
1000
+ const action = raw.payload[0];
1001
+ (0, import_core.validatePayload)(action === import_Types.ScheduleEntryLockSetAction.Set || action === import_Types.ScheduleEntryLockSetAction.Erase);
1002
+ const userId = raw.payload[1];
1003
+ const slotId = raw.payload[2];
1004
+ if (action !== import_Types.ScheduleEntryLockSetAction.Set) {
1005
+ return new this({
1006
+ nodeId: ctx.sourceNodeId,
1007
+ action,
1008
+ userId,
1009
+ slotId
1010
+ });
1011
+ }
1012
+ (0, import_core.validatePayload)(raw.payload.length >= 8);
1013
+ const weekday = raw.payload[3];
1014
+ const startHour = raw.payload[4];
1015
+ const startMinute = raw.payload[5];
1016
+ const stopHour = raw.payload[6];
1017
+ const stopMinute = raw.payload[7];
1018
+ return new this({
1019
+ nodeId: ctx.sourceNodeId,
1020
+ action,
1021
+ userId,
1022
+ slotId,
1002
1023
  weekday,
1003
1024
  startHour,
1004
1025
  startMinute,
1005
1026
  stopHour,
1006
1027
  stopMinute
1007
- };
1028
+ });
1008
1029
  }
1009
- return new ScheduleEntryLockCCWeekDayScheduleReport_1({
1010
- nodeId: ctx.sourceNodeId,
1011
- ...ccOptions
1012
- });
1013
- }
1014
- userId;
1015
- slotId;
1016
- weekday;
1017
- startHour;
1018
- startMinute;
1019
- stopHour;
1020
- stopMinute;
1021
- persistValues(ctx) {
1022
- if (!super.persistValues(ctx))
1023
- return false;
1024
- persistSchedule.call(this, ctx, import_Types.ScheduleEntryLockScheduleKind.WeekDay, this.userId, this.slotId, this.weekday != void 0 ? {
1025
- weekday: this.weekday,
1026
- startHour: this.startHour,
1027
- startMinute: this.startMinute,
1028
- stopHour: this.stopHour,
1029
- stopMinute: this.stopMinute
1030
- } : false);
1031
- return true;
1032
- }
1033
- serialize(ctx) {
1034
- this.payload = import_shared.Bytes.from([
1035
- this.userId,
1036
- this.slotId,
1037
- this.weekday ?? 255,
1038
- this.startHour ?? 255,
1039
- this.startMinute ?? 255,
1040
- this.stopHour ?? 255,
1041
- this.stopMinute ?? 255
1042
- ]);
1043
- return super.serialize(ctx);
1044
- }
1045
- toLogEntry(ctx) {
1046
- let message;
1047
- if (this.weekday == void 0) {
1048
- message = {
1049
- "user ID": this.userId,
1050
- "slot #": this.slotId,
1051
- schedule: "(empty)"
1052
- };
1053
- } else {
1054
- message = {
1055
- "user ID": this.userId,
1056
- "slot #": this.slotId,
1057
- weekday: (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, this.weekday),
1058
- "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1059
- "end time": (0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)
1060
- };
1030
+ userId;
1031
+ slotId;
1032
+ action;
1033
+ weekday;
1034
+ startHour;
1035
+ startMinute;
1036
+ stopHour;
1037
+ stopMinute;
1038
+ serialize(ctx) {
1039
+ this.payload = import_shared.Bytes.from([
1040
+ this.action,
1041
+ this.userId,
1042
+ this.slotId,
1043
+ // The report should have these fields set to 0xff
1044
+ // if the slot is erased. The specs don't mention anything
1045
+ // for the Set command, so we just assume the same is okay
1046
+ this.weekday ?? 255,
1047
+ this.startHour ?? 255,
1048
+ this.startMinute ?? 255,
1049
+ this.stopHour ?? 255,
1050
+ this.stopMinute ?? 255
1051
+ ]);
1052
+ return super.serialize(ctx);
1061
1053
  }
1062
- return {
1063
- ...super.toLogEntry(ctx),
1064
- message
1065
- };
1066
- }
1067
- };
1068
- ScheduleEntryLockCCWeekDayScheduleReport = ScheduleEntryLockCCWeekDayScheduleReport_1 = __decorate([
1069
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.WeekDayScheduleReport)
1070
- ], ScheduleEntryLockCCWeekDayScheduleReport);
1071
- let ScheduleEntryLockCCWeekDayScheduleGet = ScheduleEntryLockCCWeekDayScheduleGet_1 = class ScheduleEntryLockCCWeekDayScheduleGet2 extends ScheduleEntryLockCC {
1072
- constructor(options) {
1073
- super(options);
1074
- this.userId = options.userId;
1075
- this.slotId = options.slotId;
1076
- }
1077
- static from(raw, ctx) {
1078
- (0, import_core.validatePayload)(raw.payload.length >= 2);
1079
- const userId = raw.payload[0];
1080
- const slotId = raw.payload[1];
1081
- return new ScheduleEntryLockCCWeekDayScheduleGet_1({
1082
- nodeId: ctx.sourceNodeId,
1083
- userId,
1084
- slotId
1085
- });
1086
- }
1087
- userId;
1088
- slotId;
1089
- serialize(ctx) {
1090
- this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1091
- return super.serialize(ctx);
1092
- }
1093
- toLogEntry(ctx) {
1094
- return {
1095
- ...super.toLogEntry(ctx),
1096
- message: {
1097
- "user ID": this.userId,
1098
- "slot #": this.slotId
1054
+ toLogEntry(ctx) {
1055
+ let message;
1056
+ if (this.action === import_Types.ScheduleEntryLockSetAction.Erase) {
1057
+ message = {
1058
+ "user ID": this.userId,
1059
+ "slot #": this.slotId,
1060
+ action: "erase"
1061
+ };
1062
+ } else {
1063
+ message = {
1064
+ "user ID": this.userId,
1065
+ "slot #": this.slotId,
1066
+ action: "set",
1067
+ weekday: (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, this.weekday),
1068
+ "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1069
+ "end time": (0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)
1070
+ };
1099
1071
  }
1100
- };
1101
- }
1102
- };
1103
- ScheduleEntryLockCCWeekDayScheduleGet = ScheduleEntryLockCCWeekDayScheduleGet_1 = __decorate([
1104
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.WeekDayScheduleGet),
1105
- (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCWeekDayScheduleReport)
1106
- ], ScheduleEntryLockCCWeekDayScheduleGet);
1107
- let ScheduleEntryLockCCYearDayScheduleSet = ScheduleEntryLockCCYearDayScheduleSet_1 = class ScheduleEntryLockCCYearDayScheduleSet2 extends ScheduleEntryLockCC {
1108
- constructor(options) {
1109
- super(options);
1110
- this.userId = options.userId;
1111
- this.slotId = options.slotId;
1112
- this.action = options.action;
1113
- if (options.action === import_Types.ScheduleEntryLockSetAction.Set) {
1114
- this.startYear = options.startYear;
1115
- this.startMonth = options.startMonth;
1116
- this.startDay = options.startDay;
1072
+ return {
1073
+ ...super.toLogEntry(ctx),
1074
+ message
1075
+ };
1076
+ }
1077
+ };
1078
+ return ScheduleEntryLockCCWeekDayScheduleSet2 = _classThis;
1079
+ })();
1080
+ let ScheduleEntryLockCCWeekDayScheduleReport = (() => {
1081
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.WeekDayScheduleReport)];
1082
+ let _classDescriptor;
1083
+ let _classExtraInitializers = [];
1084
+ let _classThis;
1085
+ let _classSuper = ScheduleEntryLockCC;
1086
+ var ScheduleEntryLockCCWeekDayScheduleReport2 = class extends _classSuper {
1087
+ static {
1088
+ _classThis = this;
1089
+ }
1090
+ static {
1091
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1092
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1093
+ ScheduleEntryLockCCWeekDayScheduleReport2 = _classThis = _classDescriptor.value;
1094
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1095
+ __runInitializers(_classThis, _classExtraInitializers);
1096
+ }
1097
+ constructor(options) {
1098
+ super(options);
1099
+ this.userId = options.userId;
1100
+ this.slotId = options.slotId;
1101
+ this.weekday = options.weekday;
1117
1102
  this.startHour = options.startHour;
1118
1103
  this.startMinute = options.startMinute;
1119
- this.stopYear = options.stopYear;
1120
- this.stopMonth = options.stopMonth;
1121
- this.stopDay = options.stopDay;
1122
1104
  this.stopHour = options.stopHour;
1123
1105
  this.stopMinute = options.stopMinute;
1124
1106
  }
1125
- }
1126
- static from(raw, ctx) {
1127
- (0, import_core.validatePayload)(raw.payload.length >= 3);
1128
- const action = raw.payload[0];
1129
- (0, import_core.validatePayload)(action === import_Types.ScheduleEntryLockSetAction.Set || action === import_Types.ScheduleEntryLockSetAction.Erase);
1130
- const userId = raw.payload[1];
1131
- const slotId = raw.payload[2];
1132
- if (action !== import_Types.ScheduleEntryLockSetAction.Set) {
1133
- return new ScheduleEntryLockCCYearDayScheduleSet_1({
1134
- nodeId: ctx.sourceNodeId,
1135
- action,
1107
+ static from(raw, ctx) {
1108
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
1109
+ const userId = raw.payload[0];
1110
+ const slotId = raw.payload[1];
1111
+ let ccOptions = {
1136
1112
  userId,
1137
1113
  slotId
1114
+ };
1115
+ let weekday;
1116
+ let startHour;
1117
+ let startMinute;
1118
+ let stopHour;
1119
+ let stopMinute;
1120
+ if (raw.payload.length >= 7) {
1121
+ if (raw.payload[2] !== 255) {
1122
+ weekday = raw.payload[2];
1123
+ }
1124
+ if (raw.payload[3] !== 255) {
1125
+ startHour = raw.payload[3];
1126
+ }
1127
+ if (raw.payload[4] !== 255) {
1128
+ startMinute = raw.payload[4];
1129
+ }
1130
+ if (raw.payload[5] !== 255) {
1131
+ stopHour = raw.payload[5];
1132
+ }
1133
+ if (raw.payload[6] !== 255) {
1134
+ stopMinute = raw.payload[6];
1135
+ }
1136
+ }
1137
+ if (weekday != void 0 && startHour != void 0 && startMinute != void 0 && stopHour != void 0 && stopMinute != void 0) {
1138
+ ccOptions = {
1139
+ ...ccOptions,
1140
+ weekday,
1141
+ startHour,
1142
+ startMinute,
1143
+ stopHour,
1144
+ stopMinute
1145
+ };
1146
+ }
1147
+ return new this({
1148
+ nodeId: ctx.sourceNodeId,
1149
+ ...ccOptions
1138
1150
  });
1139
1151
  }
1140
- (0, import_core.validatePayload)(raw.payload.length >= 13);
1141
- const startYear = raw.payload[3];
1142
- const startMonth = raw.payload[4];
1143
- const startDay = raw.payload[5];
1144
- const startHour = raw.payload[6];
1145
- const startMinute = raw.payload[7];
1146
- const stopYear = raw.payload[8];
1147
- const stopMonth = raw.payload[9];
1148
- const stopDay = raw.payload[10];
1149
- const stopHour = raw.payload[11];
1150
- const stopMinute = raw.payload[12];
1151
- return new ScheduleEntryLockCCYearDayScheduleSet_1({
1152
- nodeId: ctx.sourceNodeId,
1153
- action,
1154
- userId,
1155
- slotId,
1156
- startYear,
1157
- startMonth,
1158
- startDay,
1159
- startHour,
1160
- startMinute,
1161
- stopYear,
1162
- stopMonth,
1163
- stopDay,
1164
- stopHour,
1165
- stopMinute
1166
- });
1167
- }
1168
- userId;
1169
- slotId;
1170
- action;
1171
- startYear;
1172
- startMonth;
1173
- startDay;
1174
- startHour;
1175
- startMinute;
1176
- stopYear;
1177
- stopMonth;
1178
- stopDay;
1179
- stopHour;
1180
- stopMinute;
1181
- serialize(ctx) {
1182
- this.payload = import_shared.Bytes.from([
1183
- this.action,
1184
- this.userId,
1185
- this.slotId,
1186
- // The report should have these fields set to 0xff
1187
- // if the slot is erased. The specs don't mention anything
1188
- // for the Set command, so we just assume the same is okay
1189
- this.startYear ?? 255,
1190
- this.startMonth ?? 255,
1191
- this.startDay ?? 255,
1192
- this.startHour ?? 255,
1193
- this.startMinute ?? 255,
1194
- this.stopYear ?? 255,
1195
- this.stopMonth ?? 255,
1196
- this.stopDay ?? 255,
1197
- this.stopHour ?? 255,
1198
- this.stopMinute ?? 255
1199
- ]);
1200
- return super.serialize(ctx);
1201
- }
1202
- toLogEntry(ctx) {
1203
- let message;
1204
- if (this.action === import_Types.ScheduleEntryLockSetAction.Erase) {
1205
- message = {
1206
- "user ID": this.userId,
1207
- "slot #": this.slotId,
1208
- action: "erase"
1152
+ userId;
1153
+ slotId;
1154
+ weekday;
1155
+ startHour;
1156
+ startMinute;
1157
+ stopHour;
1158
+ stopMinute;
1159
+ persistValues(ctx) {
1160
+ if (!super.persistValues(ctx))
1161
+ return false;
1162
+ persistSchedule.call(this, ctx, import_Types.ScheduleEntryLockScheduleKind.WeekDay, this.userId, this.slotId, this.weekday != void 0 ? {
1163
+ weekday: this.weekday,
1164
+ startHour: this.startHour,
1165
+ startMinute: this.startMinute,
1166
+ stopHour: this.stopHour,
1167
+ stopMinute: this.stopMinute
1168
+ } : false);
1169
+ return true;
1170
+ }
1171
+ serialize(ctx) {
1172
+ this.payload = import_shared.Bytes.from([
1173
+ this.userId,
1174
+ this.slotId,
1175
+ this.weekday ?? 255,
1176
+ this.startHour ?? 255,
1177
+ this.startMinute ?? 255,
1178
+ this.stopHour ?? 255,
1179
+ this.stopMinute ?? 255
1180
+ ]);
1181
+ return super.serialize(ctx);
1182
+ }
1183
+ toLogEntry(ctx) {
1184
+ let message;
1185
+ if (this.weekday == void 0) {
1186
+ message = {
1187
+ "user ID": this.userId,
1188
+ "slot #": this.slotId,
1189
+ schedule: "(empty)"
1190
+ };
1191
+ } else {
1192
+ message = {
1193
+ "user ID": this.userId,
1194
+ "slot #": this.slotId,
1195
+ weekday: (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, this.weekday),
1196
+ "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1197
+ "end time": (0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)
1198
+ };
1199
+ }
1200
+ return {
1201
+ ...super.toLogEntry(ctx),
1202
+ message
1209
1203
  };
1210
- } else {
1211
- message = {
1212
- "user ID": this.userId,
1213
- "slot #": this.slotId,
1214
- action: "set",
1215
- "start date": `${(0, import_shared.formatDate)(this.startYear ?? 0, this.startMonth ?? 0, this.startDay ?? 0)} ${(0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0)}`,
1216
- "end date": `${(0, import_shared.formatDate)(this.stopYear ?? 0, this.stopMonth ?? 0, this.stopDay ?? 0)} ${(0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)}`
1204
+ }
1205
+ };
1206
+ return ScheduleEntryLockCCWeekDayScheduleReport2 = _classThis;
1207
+ })();
1208
+ let ScheduleEntryLockCCWeekDayScheduleGet = (() => {
1209
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.WeekDayScheduleGet), (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCWeekDayScheduleReport)];
1210
+ let _classDescriptor;
1211
+ let _classExtraInitializers = [];
1212
+ let _classThis;
1213
+ let _classSuper = ScheduleEntryLockCC;
1214
+ var ScheduleEntryLockCCWeekDayScheduleGet2 = class extends _classSuper {
1215
+ static {
1216
+ _classThis = this;
1217
+ }
1218
+ static {
1219
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1220
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1221
+ ScheduleEntryLockCCWeekDayScheduleGet2 = _classThis = _classDescriptor.value;
1222
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1223
+ __runInitializers(_classThis, _classExtraInitializers);
1224
+ }
1225
+ constructor(options) {
1226
+ super(options);
1227
+ this.userId = options.userId;
1228
+ this.slotId = options.slotId;
1229
+ }
1230
+ static from(raw, ctx) {
1231
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
1232
+ const userId = raw.payload[0];
1233
+ const slotId = raw.payload[1];
1234
+ return new this({
1235
+ nodeId: ctx.sourceNodeId,
1236
+ userId,
1237
+ slotId
1238
+ });
1239
+ }
1240
+ userId;
1241
+ slotId;
1242
+ serialize(ctx) {
1243
+ this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1244
+ return super.serialize(ctx);
1245
+ }
1246
+ toLogEntry(ctx) {
1247
+ return {
1248
+ ...super.toLogEntry(ctx),
1249
+ message: {
1250
+ "user ID": this.userId,
1251
+ "slot #": this.slotId
1252
+ }
1217
1253
  };
1218
1254
  }
1219
- return {
1220
- ...super.toLogEntry(ctx),
1221
- message
1222
- };
1223
- }
1224
- };
1225
- ScheduleEntryLockCCYearDayScheduleSet = ScheduleEntryLockCCYearDayScheduleSet_1 = __decorate([
1226
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.YearDayScheduleSet),
1227
- (0, import_CommandClassDecorators.useSupervision)()
1228
- ], ScheduleEntryLockCCYearDayScheduleSet);
1229
- let ScheduleEntryLockCCYearDayScheduleReport = ScheduleEntryLockCCYearDayScheduleReport_1 = class ScheduleEntryLockCCYearDayScheduleReport2 extends ScheduleEntryLockCC {
1230
- constructor(options) {
1231
- super(options);
1232
- this.userId = options.userId;
1233
- this.slotId = options.slotId;
1234
- this.startYear = options.startYear;
1235
- this.startMonth = options.startMonth;
1236
- this.startDay = options.startDay;
1237
- this.startHour = options.startHour;
1238
- this.startMinute = options.startMinute;
1239
- this.stopYear = options.stopYear;
1240
- this.stopMonth = options.stopMonth;
1241
- this.stopDay = options.stopDay;
1242
- this.stopHour = options.stopHour;
1243
- this.stopMinute = options.stopMinute;
1244
- }
1245
- static from(raw, ctx) {
1246
- (0, import_core.validatePayload)(raw.payload.length >= 2);
1247
- const userId = raw.payload[0];
1248
- const slotId = raw.payload[1];
1249
- let ccOptions = {
1250
- userId,
1251
- slotId
1252
- };
1253
- let startYear;
1254
- let startMonth;
1255
- let startDay;
1256
- let startHour;
1257
- let startMinute;
1258
- let stopYear;
1259
- let stopMonth;
1260
- let stopDay;
1261
- let stopHour;
1262
- let stopMinute;
1263
- if (raw.payload.length >= 12) {
1264
- if (raw.payload[2] !== 255) {
1265
- startYear = raw.payload[2];
1266
- }
1267
- if (raw.payload[3] !== 255) {
1268
- startMonth = raw.payload[3];
1269
- }
1270
- if (raw.payload[4] !== 255) {
1271
- startDay = raw.payload[4];
1272
- }
1273
- if (raw.payload[5] !== 255) {
1274
- startHour = raw.payload[5];
1275
- }
1276
- if (raw.payload[6] !== 255) {
1277
- startMinute = raw.payload[6];
1278
- }
1279
- if (raw.payload[7] !== 255) {
1280
- stopYear = raw.payload[7];
1281
- }
1282
- if (raw.payload[8] !== 255) {
1283
- stopMonth = raw.payload[8];
1284
- }
1285
- if (raw.payload[9] !== 255) {
1286
- stopDay = raw.payload[9];
1287
- }
1288
- if (raw.payload[10] !== 255) {
1289
- stopHour = raw.payload[10];
1290
- }
1291
- if (raw.payload[11] !== 255) {
1292
- stopMinute = raw.payload[11];
1255
+ };
1256
+ return ScheduleEntryLockCCWeekDayScheduleGet2 = _classThis;
1257
+ })();
1258
+ let ScheduleEntryLockCCYearDayScheduleSet = (() => {
1259
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.YearDayScheduleSet), (0, import_CommandClassDecorators.useSupervision)()];
1260
+ let _classDescriptor;
1261
+ let _classExtraInitializers = [];
1262
+ let _classThis;
1263
+ let _classSuper = ScheduleEntryLockCC;
1264
+ var ScheduleEntryLockCCYearDayScheduleSet2 = class extends _classSuper {
1265
+ static {
1266
+ _classThis = this;
1267
+ }
1268
+ static {
1269
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1270
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1271
+ ScheduleEntryLockCCYearDayScheduleSet2 = _classThis = _classDescriptor.value;
1272
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1273
+ __runInitializers(_classThis, _classExtraInitializers);
1274
+ }
1275
+ constructor(options) {
1276
+ super(options);
1277
+ this.userId = options.userId;
1278
+ this.slotId = options.slotId;
1279
+ this.action = options.action;
1280
+ if (options.action === import_Types.ScheduleEntryLockSetAction.Set) {
1281
+ this.startYear = options.startYear;
1282
+ this.startMonth = options.startMonth;
1283
+ this.startDay = options.startDay;
1284
+ this.startHour = options.startHour;
1285
+ this.startMinute = options.startMinute;
1286
+ this.stopYear = options.stopYear;
1287
+ this.stopMonth = options.stopMonth;
1288
+ this.stopDay = options.stopDay;
1289
+ this.stopHour = options.stopHour;
1290
+ this.stopMinute = options.stopMinute;
1293
1291
  }
1294
1292
  }
1295
- if (startYear != void 0 && startMonth != void 0 && startDay != void 0 && startHour != void 0 && startMinute != void 0 && stopYear != void 0 && stopMonth != void 0 && stopDay != void 0 && stopHour != void 0 && stopMinute != void 0) {
1296
- ccOptions = {
1297
- ...ccOptions,
1293
+ static from(raw, ctx) {
1294
+ (0, import_core.validatePayload)(raw.payload.length >= 3);
1295
+ const action = raw.payload[0];
1296
+ (0, import_core.validatePayload)(action === import_Types.ScheduleEntryLockSetAction.Set || action === import_Types.ScheduleEntryLockSetAction.Erase);
1297
+ const userId = raw.payload[1];
1298
+ const slotId = raw.payload[2];
1299
+ if (action !== import_Types.ScheduleEntryLockSetAction.Set) {
1300
+ return new this({
1301
+ nodeId: ctx.sourceNodeId,
1302
+ action,
1303
+ userId,
1304
+ slotId
1305
+ });
1306
+ }
1307
+ (0, import_core.validatePayload)(raw.payload.length >= 13);
1308
+ const startYear = raw.payload[3];
1309
+ const startMonth = raw.payload[4];
1310
+ const startDay = raw.payload[5];
1311
+ const startHour = raw.payload[6];
1312
+ const startMinute = raw.payload[7];
1313
+ const stopYear = raw.payload[8];
1314
+ const stopMonth = raw.payload[9];
1315
+ const stopDay = raw.payload[10];
1316
+ const stopHour = raw.payload[11];
1317
+ const stopMinute = raw.payload[12];
1318
+ return new this({
1319
+ nodeId: ctx.sourceNodeId,
1320
+ action,
1321
+ userId,
1322
+ slotId,
1298
1323
  startYear,
1299
1324
  startMonth,
1300
1325
  startDay,
@@ -1305,323 +1330,465 @@ let ScheduleEntryLockCCYearDayScheduleReport = ScheduleEntryLockCCYearDaySchedul
1305
1330
  stopDay,
1306
1331
  stopHour,
1307
1332
  stopMinute
1308
- };
1333
+ });
1309
1334
  }
1310
- return new ScheduleEntryLockCCYearDayScheduleReport_1({
1311
- nodeId: ctx.sourceNodeId,
1312
- ...ccOptions
1313
- });
1314
- }
1315
- userId;
1316
- slotId;
1317
- startYear;
1318
- startMonth;
1319
- startDay;
1320
- startHour;
1321
- startMinute;
1322
- stopYear;
1323
- stopMonth;
1324
- stopDay;
1325
- stopHour;
1326
- stopMinute;
1327
- persistValues(ctx) {
1328
- if (!super.persistValues(ctx))
1329
- return false;
1330
- persistSchedule.call(this, ctx, import_Types.ScheduleEntryLockScheduleKind.YearDay, this.userId, this.slotId, this.startYear != void 0 ? {
1331
- startYear: this.startYear,
1332
- startMonth: this.startMonth,
1333
- startDay: this.startDay,
1334
- startHour: this.startHour,
1335
- startMinute: this.startMinute,
1336
- stopYear: this.stopYear,
1337
- stopMonth: this.stopMonth,
1338
- stopDay: this.stopDay,
1339
- stopHour: this.stopHour,
1340
- stopMinute: this.stopMinute
1341
- } : false);
1342
- return true;
1343
- }
1344
- serialize(ctx) {
1345
- this.payload = import_shared.Bytes.from([
1346
- this.userId,
1347
- this.slotId,
1348
- this.startYear ?? 255,
1349
- this.startMonth ?? 255,
1350
- this.startDay ?? 255,
1351
- this.startHour ?? 255,
1352
- this.startMinute ?? 255,
1353
- this.stopYear ?? 255,
1354
- this.stopMonth ?? 255,
1355
- this.stopDay ?? 255,
1356
- this.stopHour ?? 255,
1357
- this.stopMinute ?? 255
1358
- ]);
1359
- return super.serialize(ctx);
1360
- }
1361
- toLogEntry(ctx) {
1362
- let message;
1363
- if (this.startYear !== void 0) {
1364
- message = {
1365
- "user ID": this.userId,
1366
- "slot #": this.slotId,
1367
- schedule: "(empty)"
1368
- };
1369
- } else {
1370
- message = {
1371
- "user ID": this.userId,
1372
- "slot #": this.slotId,
1373
- action: "set",
1374
- "start date": `${(0, import_shared.formatDate)(this.startYear ?? 0, this.startMonth ?? 0, this.startDay ?? 0)} ${(0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0)}`,
1375
- "end date": `${(0, import_shared.formatDate)(this.stopYear ?? 0, this.stopMonth ?? 0, this.stopDay ?? 0)} ${(0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)}`
1335
+ userId;
1336
+ slotId;
1337
+ action;
1338
+ startYear;
1339
+ startMonth;
1340
+ startDay;
1341
+ startHour;
1342
+ startMinute;
1343
+ stopYear;
1344
+ stopMonth;
1345
+ stopDay;
1346
+ stopHour;
1347
+ stopMinute;
1348
+ serialize(ctx) {
1349
+ this.payload = import_shared.Bytes.from([
1350
+ this.action,
1351
+ this.userId,
1352
+ this.slotId,
1353
+ // The report should have these fields set to 0xff
1354
+ // if the slot is erased. The specs don't mention anything
1355
+ // for the Set command, so we just assume the same is okay
1356
+ this.startYear ?? 255,
1357
+ this.startMonth ?? 255,
1358
+ this.startDay ?? 255,
1359
+ this.startHour ?? 255,
1360
+ this.startMinute ?? 255,
1361
+ this.stopYear ?? 255,
1362
+ this.stopMonth ?? 255,
1363
+ this.stopDay ?? 255,
1364
+ this.stopHour ?? 255,
1365
+ this.stopMinute ?? 255
1366
+ ]);
1367
+ return super.serialize(ctx);
1368
+ }
1369
+ toLogEntry(ctx) {
1370
+ let message;
1371
+ if (this.action === import_Types.ScheduleEntryLockSetAction.Erase) {
1372
+ message = {
1373
+ "user ID": this.userId,
1374
+ "slot #": this.slotId,
1375
+ action: "erase"
1376
+ };
1377
+ } else {
1378
+ message = {
1379
+ "user ID": this.userId,
1380
+ "slot #": this.slotId,
1381
+ action: "set",
1382
+ "start date": `${(0, import_shared.formatDate)(this.startYear ?? 0, this.startMonth ?? 0, this.startDay ?? 0)} ${(0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0)}`,
1383
+ "end date": `${(0, import_shared.formatDate)(this.stopYear ?? 0, this.stopMonth ?? 0, this.stopDay ?? 0)} ${(0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)}`
1384
+ };
1385
+ }
1386
+ return {
1387
+ ...super.toLogEntry(ctx),
1388
+ message
1376
1389
  };
1377
1390
  }
1378
- return {
1379
- ...super.toLogEntry(ctx),
1380
- message
1381
- };
1382
- }
1383
- };
1384
- ScheduleEntryLockCCYearDayScheduleReport = ScheduleEntryLockCCYearDayScheduleReport_1 = __decorate([
1385
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.YearDayScheduleReport)
1386
- ], ScheduleEntryLockCCYearDayScheduleReport);
1387
- let ScheduleEntryLockCCYearDayScheduleGet = ScheduleEntryLockCCYearDayScheduleGet_1 = class ScheduleEntryLockCCYearDayScheduleGet2 extends ScheduleEntryLockCC {
1388
- constructor(options) {
1389
- super(options);
1390
- this.userId = options.userId;
1391
- this.slotId = options.slotId;
1392
- }
1393
- static from(raw, ctx) {
1394
- (0, import_core.validatePayload)(raw.payload.length >= 2);
1395
- const userId = raw.payload[0];
1396
- const slotId = raw.payload[1];
1397
- return new ScheduleEntryLockCCYearDayScheduleGet_1({
1398
- nodeId: ctx.sourceNodeId,
1399
- userId,
1400
- slotId
1401
- });
1402
- }
1403
- userId;
1404
- slotId;
1405
- serialize(ctx) {
1406
- this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1407
- return super.serialize(ctx);
1408
- }
1409
- toLogEntry(ctx) {
1410
- return {
1411
- ...super.toLogEntry(ctx),
1412
- message: {
1413
- "user ID": this.userId,
1414
- "slot #": this.slotId
1391
+ };
1392
+ return ScheduleEntryLockCCYearDayScheduleSet2 = _classThis;
1393
+ })();
1394
+ let ScheduleEntryLockCCYearDayScheduleReport = (() => {
1395
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.YearDayScheduleReport)];
1396
+ let _classDescriptor;
1397
+ let _classExtraInitializers = [];
1398
+ let _classThis;
1399
+ let _classSuper = ScheduleEntryLockCC;
1400
+ var ScheduleEntryLockCCYearDayScheduleReport2 = class extends _classSuper {
1401
+ static {
1402
+ _classThis = this;
1403
+ }
1404
+ static {
1405
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1406
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1407
+ ScheduleEntryLockCCYearDayScheduleReport2 = _classThis = _classDescriptor.value;
1408
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1409
+ __runInitializers(_classThis, _classExtraInitializers);
1410
+ }
1411
+ constructor(options) {
1412
+ super(options);
1413
+ this.userId = options.userId;
1414
+ this.slotId = options.slotId;
1415
+ this.startYear = options.startYear;
1416
+ this.startMonth = options.startMonth;
1417
+ this.startDay = options.startDay;
1418
+ this.startHour = options.startHour;
1419
+ this.startMinute = options.startMinute;
1420
+ this.stopYear = options.stopYear;
1421
+ this.stopMonth = options.stopMonth;
1422
+ this.stopDay = options.stopDay;
1423
+ this.stopHour = options.stopHour;
1424
+ this.stopMinute = options.stopMinute;
1425
+ }
1426
+ static from(raw, ctx) {
1427
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
1428
+ const userId = raw.payload[0];
1429
+ const slotId = raw.payload[1];
1430
+ let ccOptions = {
1431
+ userId,
1432
+ slotId
1433
+ };
1434
+ let startYear;
1435
+ let startMonth;
1436
+ let startDay;
1437
+ let startHour;
1438
+ let startMinute;
1439
+ let stopYear;
1440
+ let stopMonth;
1441
+ let stopDay;
1442
+ let stopHour;
1443
+ let stopMinute;
1444
+ if (raw.payload.length >= 12) {
1445
+ if (raw.payload[2] !== 255) {
1446
+ startYear = raw.payload[2];
1447
+ }
1448
+ if (raw.payload[3] !== 255) {
1449
+ startMonth = raw.payload[3];
1450
+ }
1451
+ if (raw.payload[4] !== 255) {
1452
+ startDay = raw.payload[4];
1453
+ }
1454
+ if (raw.payload[5] !== 255) {
1455
+ startHour = raw.payload[5];
1456
+ }
1457
+ if (raw.payload[6] !== 255) {
1458
+ startMinute = raw.payload[6];
1459
+ }
1460
+ if (raw.payload[7] !== 255) {
1461
+ stopYear = raw.payload[7];
1462
+ }
1463
+ if (raw.payload[8] !== 255) {
1464
+ stopMonth = raw.payload[8];
1465
+ }
1466
+ if (raw.payload[9] !== 255) {
1467
+ stopDay = raw.payload[9];
1468
+ }
1469
+ if (raw.payload[10] !== 255) {
1470
+ stopHour = raw.payload[10];
1471
+ }
1472
+ if (raw.payload[11] !== 255) {
1473
+ stopMinute = raw.payload[11];
1474
+ }
1415
1475
  }
1416
- };
1417
- }
1418
- };
1419
- ScheduleEntryLockCCYearDayScheduleGet = ScheduleEntryLockCCYearDayScheduleGet_1 = __decorate([
1420
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.YearDayScheduleGet),
1421
- (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCYearDayScheduleReport)
1422
- ], ScheduleEntryLockCCYearDayScheduleGet);
1423
- let ScheduleEntryLockCCTimeOffsetSet = ScheduleEntryLockCCTimeOffsetSet_1 = class ScheduleEntryLockCCTimeOffsetSet2 extends ScheduleEntryLockCC {
1424
- constructor(options) {
1425
- super(options);
1426
- this.standardOffset = options.standardOffset;
1427
- this.dstOffset = options.dstOffset;
1428
- }
1429
- static from(raw, ctx) {
1430
- const { standardOffset, dstOffset } = (0, import_serializers.parseTimezone)(raw.payload);
1431
- return new ScheduleEntryLockCCTimeOffsetSet_1({
1432
- nodeId: ctx.sourceNodeId,
1433
- standardOffset,
1434
- dstOffset
1435
- });
1436
- }
1437
- standardOffset;
1438
- dstOffset;
1439
- serialize(ctx) {
1440
- this.payload = (0, import_serializers.encodeTimezone)({
1441
- standardOffset: this.standardOffset,
1442
- dstOffset: this.dstOffset
1443
- });
1444
- return super.serialize(ctx);
1445
- }
1446
- toLogEntry(ctx) {
1447
- return {
1448
- ...super.toLogEntry(ctx),
1449
- message: {
1450
- "standard time offset": `${this.standardOffset} minutes`,
1451
- "DST offset": `${this.dstOffset} minutes`
1476
+ if (startYear != void 0 && startMonth != void 0 && startDay != void 0 && startHour != void 0 && startMinute != void 0 && stopYear != void 0 && stopMonth != void 0 && stopDay != void 0 && stopHour != void 0 && stopMinute != void 0) {
1477
+ ccOptions = {
1478
+ ...ccOptions,
1479
+ startYear,
1480
+ startMonth,
1481
+ startDay,
1482
+ startHour,
1483
+ startMinute,
1484
+ stopYear,
1485
+ stopMonth,
1486
+ stopDay,
1487
+ stopHour,
1488
+ stopMinute
1489
+ };
1452
1490
  }
1453
- };
1454
- }
1455
- };
1456
- ScheduleEntryLockCCTimeOffsetSet = ScheduleEntryLockCCTimeOffsetSet_1 = __decorate([
1457
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.TimeOffsetSet),
1458
- (0, import_CommandClassDecorators.useSupervision)()
1459
- ], ScheduleEntryLockCCTimeOffsetSet);
1460
- let ScheduleEntryLockCCTimeOffsetReport = ScheduleEntryLockCCTimeOffsetReport_1 = class ScheduleEntryLockCCTimeOffsetReport2 extends ScheduleEntryLockCC {
1461
- constructor(options) {
1462
- super(options);
1463
- this.standardOffset = options.standardOffset;
1464
- this.dstOffset = options.dstOffset;
1465
- }
1466
- static from(raw, ctx) {
1467
- const { standardOffset, dstOffset } = (0, import_serializers.parseTimezone)(raw.payload);
1468
- return new ScheduleEntryLockCCTimeOffsetReport_1({
1469
- nodeId: ctx.sourceNodeId,
1470
- standardOffset,
1471
- dstOffset
1472
- });
1473
- }
1474
- standardOffset;
1475
- dstOffset;
1476
- serialize(ctx) {
1477
- this.payload = (0, import_serializers.encodeTimezone)({
1478
- standardOffset: this.standardOffset,
1479
- dstOffset: this.dstOffset
1480
- });
1481
- return super.serialize(ctx);
1482
- }
1483
- toLogEntry(ctx) {
1484
- return {
1485
- ...super.toLogEntry(ctx),
1486
- message: {
1487
- "standard time offset": `${this.standardOffset} minutes`,
1488
- "DST offset": `${this.dstOffset} minutes`
1491
+ return new this({
1492
+ nodeId: ctx.sourceNodeId,
1493
+ ...ccOptions
1494
+ });
1495
+ }
1496
+ userId;
1497
+ slotId;
1498
+ startYear;
1499
+ startMonth;
1500
+ startDay;
1501
+ startHour;
1502
+ startMinute;
1503
+ stopYear;
1504
+ stopMonth;
1505
+ stopDay;
1506
+ stopHour;
1507
+ stopMinute;
1508
+ persistValues(ctx) {
1509
+ if (!super.persistValues(ctx))
1510
+ return false;
1511
+ persistSchedule.call(this, ctx, import_Types.ScheduleEntryLockScheduleKind.YearDay, this.userId, this.slotId, this.startYear != void 0 ? {
1512
+ startYear: this.startYear,
1513
+ startMonth: this.startMonth,
1514
+ startDay: this.startDay,
1515
+ startHour: this.startHour,
1516
+ startMinute: this.startMinute,
1517
+ stopYear: this.stopYear,
1518
+ stopMonth: this.stopMonth,
1519
+ stopDay: this.stopDay,
1520
+ stopHour: this.stopHour,
1521
+ stopMinute: this.stopMinute
1522
+ } : false);
1523
+ return true;
1524
+ }
1525
+ serialize(ctx) {
1526
+ this.payload = import_shared.Bytes.from([
1527
+ this.userId,
1528
+ this.slotId,
1529
+ this.startYear ?? 255,
1530
+ this.startMonth ?? 255,
1531
+ this.startDay ?? 255,
1532
+ this.startHour ?? 255,
1533
+ this.startMinute ?? 255,
1534
+ this.stopYear ?? 255,
1535
+ this.stopMonth ?? 255,
1536
+ this.stopDay ?? 255,
1537
+ this.stopHour ?? 255,
1538
+ this.stopMinute ?? 255
1539
+ ]);
1540
+ return super.serialize(ctx);
1541
+ }
1542
+ toLogEntry(ctx) {
1543
+ let message;
1544
+ if (this.startYear !== void 0) {
1545
+ message = {
1546
+ "user ID": this.userId,
1547
+ "slot #": this.slotId,
1548
+ schedule: "(empty)"
1549
+ };
1550
+ } else {
1551
+ message = {
1552
+ "user ID": this.userId,
1553
+ "slot #": this.slotId,
1554
+ action: "set",
1555
+ "start date": `${(0, import_shared.formatDate)(this.startYear ?? 0, this.startMonth ?? 0, this.startDay ?? 0)} ${(0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0)}`,
1556
+ "end date": `${(0, import_shared.formatDate)(this.stopYear ?? 0, this.stopMonth ?? 0, this.stopDay ?? 0)} ${(0, import_shared.formatTime)(this.stopHour ?? 0, this.stopMinute ?? 0)}`
1557
+ };
1489
1558
  }
1490
- };
1491
- }
1492
- };
1493
- ScheduleEntryLockCCTimeOffsetReport = ScheduleEntryLockCCTimeOffsetReport_1 = __decorate([
1494
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.TimeOffsetReport)
1495
- ], ScheduleEntryLockCCTimeOffsetReport);
1496
- let ScheduleEntryLockCCTimeOffsetGet = class ScheduleEntryLockCCTimeOffsetGet2 extends ScheduleEntryLockCC {
1497
- };
1498
- ScheduleEntryLockCCTimeOffsetGet = __decorate([
1499
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.TimeOffsetGet),
1500
- (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCTimeOffsetReport)
1501
- ], ScheduleEntryLockCCTimeOffsetGet);
1502
- let ScheduleEntryLockCCDailyRepeatingScheduleSet = ScheduleEntryLockCCDailyRepeatingScheduleSet_1 = class ScheduleEntryLockCCDailyRepeatingScheduleSet2 extends ScheduleEntryLockCC {
1503
- constructor(options) {
1504
- super(options);
1505
- this.userId = options.userId;
1506
- this.slotId = options.slotId;
1507
- this.action = options.action;
1508
- if (options.action === import_Types.ScheduleEntryLockSetAction.Set) {
1509
- this.weekdays = options.weekdays;
1510
- this.startHour = options.startHour;
1511
- this.startMinute = options.startMinute;
1512
- this.durationHour = options.durationHour;
1513
- this.durationMinute = options.durationMinute;
1559
+ return {
1560
+ ...super.toLogEntry(ctx),
1561
+ message
1562
+ };
1514
1563
  }
1515
- }
1516
- static from(raw, ctx) {
1517
- (0, import_core.validatePayload)(raw.payload.length >= 3);
1518
- const action = raw.payload[0];
1519
- (0, import_core.validatePayload)(action === import_Types.ScheduleEntryLockSetAction.Set || action === import_Types.ScheduleEntryLockSetAction.Erase);
1520
- const userId = raw.payload[1];
1521
- const slotId = raw.payload[2];
1522
- if (action !== import_Types.ScheduleEntryLockSetAction.Set) {
1523
- return new ScheduleEntryLockCCDailyRepeatingScheduleSet_1({
1564
+ };
1565
+ return ScheduleEntryLockCCYearDayScheduleReport2 = _classThis;
1566
+ })();
1567
+ let ScheduleEntryLockCCYearDayScheduleGet = (() => {
1568
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.YearDayScheduleGet), (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCYearDayScheduleReport)];
1569
+ let _classDescriptor;
1570
+ let _classExtraInitializers = [];
1571
+ let _classThis;
1572
+ let _classSuper = ScheduleEntryLockCC;
1573
+ var ScheduleEntryLockCCYearDayScheduleGet2 = class extends _classSuper {
1574
+ static {
1575
+ _classThis = this;
1576
+ }
1577
+ static {
1578
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1579
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1580
+ ScheduleEntryLockCCYearDayScheduleGet2 = _classThis = _classDescriptor.value;
1581
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1582
+ __runInitializers(_classThis, _classExtraInitializers);
1583
+ }
1584
+ constructor(options) {
1585
+ super(options);
1586
+ this.userId = options.userId;
1587
+ this.slotId = options.slotId;
1588
+ }
1589
+ static from(raw, ctx) {
1590
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
1591
+ const userId = raw.payload[0];
1592
+ const slotId = raw.payload[1];
1593
+ return new this({
1524
1594
  nodeId: ctx.sourceNodeId,
1525
- action,
1526
1595
  userId,
1527
1596
  slotId
1528
1597
  });
1529
1598
  }
1530
- (0, import_core.validatePayload)(raw.payload.length >= 8);
1531
- const weekdays = (0, import_core.parseBitMask)(raw.payload.subarray(3, 4), import_Types.ScheduleEntryLockWeekday.Sunday);
1532
- const startHour = raw.payload[4];
1533
- const startMinute = raw.payload[5];
1534
- const durationHour = raw.payload[6];
1535
- const durationMinute = raw.payload[7];
1536
- return new ScheduleEntryLockCCDailyRepeatingScheduleSet_1({
1537
- nodeId: ctx.sourceNodeId,
1538
- action,
1539
- userId,
1540
- slotId,
1541
- weekdays,
1542
- startHour,
1543
- startMinute,
1544
- durationHour,
1545
- durationMinute
1546
- });
1547
- }
1548
- userId;
1549
- slotId;
1550
- action;
1551
- weekdays;
1552
- startHour;
1553
- startMinute;
1554
- durationHour;
1555
- durationMinute;
1556
- serialize(ctx) {
1557
- this.payload = import_shared.Bytes.from([this.action, this.userId, this.slotId]);
1558
- if (this.action === import_Types.ScheduleEntryLockSetAction.Set) {
1559
- this.payload = import_shared.Bytes.concat([
1560
- this.payload,
1561
- (0, import_core.encodeBitMask)(this.weekdays, import_Types.ScheduleEntryLockWeekday.Saturday, import_Types.ScheduleEntryLockWeekday.Sunday),
1562
- import_shared.Bytes.from([
1563
- this.startHour,
1564
- this.startMinute,
1565
- this.durationHour,
1566
- this.durationMinute
1567
- ])
1568
- ]);
1569
- } else {
1570
- this.payload = import_shared.Bytes.concat([this.payload, import_shared.Bytes.alloc(5, 255)]);
1599
+ userId;
1600
+ slotId;
1601
+ serialize(ctx) {
1602
+ this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1603
+ return super.serialize(ctx);
1571
1604
  }
1572
- return super.serialize(ctx);
1573
- }
1574
- toLogEntry(ctx) {
1575
- let message;
1576
- if (this.action === import_Types.ScheduleEntryLockSetAction.Erase) {
1577
- message = {
1578
- "user ID": this.userId,
1579
- "slot #": this.slotId,
1580
- action: "erase"
1605
+ toLogEntry(ctx) {
1606
+ return {
1607
+ ...super.toLogEntry(ctx),
1608
+ message: {
1609
+ "user ID": this.userId,
1610
+ "slot #": this.slotId
1611
+ }
1612
+ };
1613
+ }
1614
+ };
1615
+ return ScheduleEntryLockCCYearDayScheduleGet2 = _classThis;
1616
+ })();
1617
+ let ScheduleEntryLockCCTimeOffsetSet = (() => {
1618
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.TimeOffsetSet), (0, import_CommandClassDecorators.useSupervision)()];
1619
+ let _classDescriptor;
1620
+ let _classExtraInitializers = [];
1621
+ let _classThis;
1622
+ let _classSuper = ScheduleEntryLockCC;
1623
+ var ScheduleEntryLockCCTimeOffsetSet2 = class extends _classSuper {
1624
+ static {
1625
+ _classThis = this;
1626
+ }
1627
+ static {
1628
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1629
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1630
+ ScheduleEntryLockCCTimeOffsetSet2 = _classThis = _classDescriptor.value;
1631
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1632
+ __runInitializers(_classThis, _classExtraInitializers);
1633
+ }
1634
+ constructor(options) {
1635
+ super(options);
1636
+ this.standardOffset = options.standardOffset;
1637
+ this.dstOffset = options.dstOffset;
1638
+ }
1639
+ static from(raw, ctx) {
1640
+ const { standardOffset, dstOffset } = (0, import_serializers.parseTimezone)(raw.payload);
1641
+ return new this({
1642
+ nodeId: ctx.sourceNodeId,
1643
+ standardOffset,
1644
+ dstOffset
1645
+ });
1646
+ }
1647
+ standardOffset;
1648
+ dstOffset;
1649
+ serialize(ctx) {
1650
+ this.payload = (0, import_serializers.encodeTimezone)({
1651
+ standardOffset: this.standardOffset,
1652
+ dstOffset: this.dstOffset
1653
+ });
1654
+ return super.serialize(ctx);
1655
+ }
1656
+ toLogEntry(ctx) {
1657
+ return {
1658
+ ...super.toLogEntry(ctx),
1659
+ message: {
1660
+ "standard time offset": `${this.standardOffset} minutes`,
1661
+ "DST offset": `${this.dstOffset} minutes`
1662
+ }
1581
1663
  };
1582
- } else {
1583
- message = {
1584
- "user ID": this.userId,
1585
- "slot #": this.slotId,
1586
- action: "set",
1587
- weekdays: this.weekdays.map((w) => (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, w)).join(", "),
1588
- "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1589
- duration: (0, import_shared.formatTime)(this.durationHour ?? 0, this.durationMinute ?? 0)
1664
+ }
1665
+ };
1666
+ return ScheduleEntryLockCCTimeOffsetSet2 = _classThis;
1667
+ })();
1668
+ let ScheduleEntryLockCCTimeOffsetReport = (() => {
1669
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.TimeOffsetReport)];
1670
+ let _classDescriptor;
1671
+ let _classExtraInitializers = [];
1672
+ let _classThis;
1673
+ let _classSuper = ScheduleEntryLockCC;
1674
+ var ScheduleEntryLockCCTimeOffsetReport2 = class extends _classSuper {
1675
+ static {
1676
+ _classThis = this;
1677
+ }
1678
+ static {
1679
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1680
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1681
+ ScheduleEntryLockCCTimeOffsetReport2 = _classThis = _classDescriptor.value;
1682
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1683
+ __runInitializers(_classThis, _classExtraInitializers);
1684
+ }
1685
+ constructor(options) {
1686
+ super(options);
1687
+ this.standardOffset = options.standardOffset;
1688
+ this.dstOffset = options.dstOffset;
1689
+ }
1690
+ static from(raw, ctx) {
1691
+ const { standardOffset, dstOffset } = (0, import_serializers.parseTimezone)(raw.payload);
1692
+ return new this({
1693
+ nodeId: ctx.sourceNodeId,
1694
+ standardOffset,
1695
+ dstOffset
1696
+ });
1697
+ }
1698
+ standardOffset;
1699
+ dstOffset;
1700
+ serialize(ctx) {
1701
+ this.payload = (0, import_serializers.encodeTimezone)({
1702
+ standardOffset: this.standardOffset,
1703
+ dstOffset: this.dstOffset
1704
+ });
1705
+ return super.serialize(ctx);
1706
+ }
1707
+ toLogEntry(ctx) {
1708
+ return {
1709
+ ...super.toLogEntry(ctx),
1710
+ message: {
1711
+ "standard time offset": `${this.standardOffset} minutes`,
1712
+ "DST offset": `${this.dstOffset} minutes`
1713
+ }
1590
1714
  };
1591
1715
  }
1592
- return {
1593
- ...super.toLogEntry(ctx),
1594
- message
1595
- };
1596
- }
1597
- };
1598
- ScheduleEntryLockCCDailyRepeatingScheduleSet = ScheduleEntryLockCCDailyRepeatingScheduleSet_1 = __decorate([
1599
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet),
1600
- (0, import_CommandClassDecorators.useSupervision)()
1601
- ], ScheduleEntryLockCCDailyRepeatingScheduleSet);
1602
- let ScheduleEntryLockCCDailyRepeatingScheduleReport = ScheduleEntryLockCCDailyRepeatingScheduleReport_1 = class ScheduleEntryLockCCDailyRepeatingScheduleReport2 extends ScheduleEntryLockCC {
1603
- constructor(options) {
1604
- super(options);
1605
- this.userId = options.userId;
1606
- this.slotId = options.slotId;
1607
- this.weekdays = options.weekdays;
1608
- this.startHour = options.startHour;
1609
- this.startMinute = options.startMinute;
1610
- this.durationHour = options.durationHour;
1611
- this.durationMinute = options.durationMinute;
1612
- }
1613
- static from(raw, ctx) {
1614
- (0, import_core.validatePayload)(raw.payload.length >= 2);
1615
- const userId = raw.payload[0];
1616
- const slotId = raw.payload[1];
1617
- if (raw.payload.length >= 7 && raw.payload[2] !== 0) {
1618
- const weekdays = (0, import_core.parseBitMask)(raw.payload.subarray(2, 3), import_Types.ScheduleEntryLockWeekday.Sunday);
1619
- const startHour = raw.payload[3];
1620
- const startMinute = raw.payload[4];
1621
- const durationHour = raw.payload[5];
1622
- const durationMinute = raw.payload[6];
1623
- return new ScheduleEntryLockCCDailyRepeatingScheduleReport_1({
1716
+ };
1717
+ return ScheduleEntryLockCCTimeOffsetReport2 = _classThis;
1718
+ })();
1719
+ let ScheduleEntryLockCCTimeOffsetGet = (() => {
1720
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.TimeOffsetGet), (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCTimeOffsetReport)];
1721
+ let _classDescriptor;
1722
+ let _classExtraInitializers = [];
1723
+ let _classThis;
1724
+ let _classSuper = ScheduleEntryLockCC;
1725
+ var ScheduleEntryLockCCTimeOffsetGet2 = class extends _classSuper {
1726
+ static {
1727
+ _classThis = this;
1728
+ }
1729
+ static {
1730
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1731
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1732
+ ScheduleEntryLockCCTimeOffsetGet2 = _classThis = _classDescriptor.value;
1733
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1734
+ __runInitializers(_classThis, _classExtraInitializers);
1735
+ }
1736
+ };
1737
+ return ScheduleEntryLockCCTimeOffsetGet2 = _classThis;
1738
+ })();
1739
+ let ScheduleEntryLockCCDailyRepeatingScheduleSet = (() => {
1740
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleSet), (0, import_CommandClassDecorators.useSupervision)()];
1741
+ let _classDescriptor;
1742
+ let _classExtraInitializers = [];
1743
+ let _classThis;
1744
+ let _classSuper = ScheduleEntryLockCC;
1745
+ var ScheduleEntryLockCCDailyRepeatingScheduleSet2 = class extends _classSuper {
1746
+ static {
1747
+ _classThis = this;
1748
+ }
1749
+ static {
1750
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1751
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1752
+ ScheduleEntryLockCCDailyRepeatingScheduleSet2 = _classThis = _classDescriptor.value;
1753
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1754
+ __runInitializers(_classThis, _classExtraInitializers);
1755
+ }
1756
+ constructor(options) {
1757
+ super(options);
1758
+ this.userId = options.userId;
1759
+ this.slotId = options.slotId;
1760
+ this.action = options.action;
1761
+ if (options.action === import_Types.ScheduleEntryLockSetAction.Set) {
1762
+ this.weekdays = options.weekdays;
1763
+ this.startHour = options.startHour;
1764
+ this.startMinute = options.startMinute;
1765
+ this.durationHour = options.durationHour;
1766
+ this.durationMinute = options.durationMinute;
1767
+ }
1768
+ }
1769
+ static from(raw, ctx) {
1770
+ (0, import_core.validatePayload)(raw.payload.length >= 3);
1771
+ const action = raw.payload[0];
1772
+ (0, import_core.validatePayload)(action === import_Types.ScheduleEntryLockSetAction.Set || action === import_Types.ScheduleEntryLockSetAction.Erase);
1773
+ const userId = raw.payload[1];
1774
+ const slotId = raw.payload[2];
1775
+ if (action !== import_Types.ScheduleEntryLockSetAction.Set) {
1776
+ return new this({
1777
+ nodeId: ctx.sourceNodeId,
1778
+ action,
1779
+ userId,
1780
+ slotId
1781
+ });
1782
+ }
1783
+ (0, import_core.validatePayload)(raw.payload.length >= 8);
1784
+ const weekdays = (0, import_core.parseBitMask)(raw.payload.subarray(3, 4), import_Types.ScheduleEntryLockWeekday.Sunday);
1785
+ const startHour = raw.payload[4];
1786
+ const startMinute = raw.payload[5];
1787
+ const durationHour = raw.payload[6];
1788
+ const durationMinute = raw.payload[7];
1789
+ return new this({
1624
1790
  nodeId: ctx.sourceNodeId,
1791
+ action,
1625
1792
  userId,
1626
1793
  slotId,
1627
1794
  weekdays,
@@ -1630,114 +1797,227 @@ let ScheduleEntryLockCCDailyRepeatingScheduleReport = ScheduleEntryLockCCDailyRe
1630
1797
  durationHour,
1631
1798
  durationMinute
1632
1799
  });
1633
- } else {
1634
- return new ScheduleEntryLockCCDailyRepeatingScheduleReport_1({
1800
+ }
1801
+ userId;
1802
+ slotId;
1803
+ action;
1804
+ weekdays;
1805
+ startHour;
1806
+ startMinute;
1807
+ durationHour;
1808
+ durationMinute;
1809
+ serialize(ctx) {
1810
+ this.payload = import_shared.Bytes.from([this.action, this.userId, this.slotId]);
1811
+ if (this.action === import_Types.ScheduleEntryLockSetAction.Set) {
1812
+ this.payload = import_shared.Bytes.concat([
1813
+ this.payload,
1814
+ (0, import_core.encodeBitMask)(this.weekdays, import_Types.ScheduleEntryLockWeekday.Saturday, import_Types.ScheduleEntryLockWeekday.Sunday),
1815
+ import_shared.Bytes.from([
1816
+ this.startHour,
1817
+ this.startMinute,
1818
+ this.durationHour,
1819
+ this.durationMinute
1820
+ ])
1821
+ ]);
1822
+ } else {
1823
+ this.payload = import_shared.Bytes.concat([this.payload, import_shared.Bytes.alloc(5, 255)]);
1824
+ }
1825
+ return super.serialize(ctx);
1826
+ }
1827
+ toLogEntry(ctx) {
1828
+ let message;
1829
+ if (this.action === import_Types.ScheduleEntryLockSetAction.Erase) {
1830
+ message = {
1831
+ "user ID": this.userId,
1832
+ "slot #": this.slotId,
1833
+ action: "erase"
1834
+ };
1835
+ } else {
1836
+ message = {
1837
+ "user ID": this.userId,
1838
+ "slot #": this.slotId,
1839
+ action: "set",
1840
+ weekdays: this.weekdays.map((w) => (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, w)).join(", "),
1841
+ "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1842
+ duration: (0, import_shared.formatTime)(this.durationHour ?? 0, this.durationMinute ?? 0)
1843
+ };
1844
+ }
1845
+ return {
1846
+ ...super.toLogEntry(ctx),
1847
+ message
1848
+ };
1849
+ }
1850
+ };
1851
+ return ScheduleEntryLockCCDailyRepeatingScheduleSet2 = _classThis;
1852
+ })();
1853
+ let ScheduleEntryLockCCDailyRepeatingScheduleReport = (() => {
1854
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleReport)];
1855
+ let _classDescriptor;
1856
+ let _classExtraInitializers = [];
1857
+ let _classThis;
1858
+ let _classSuper = ScheduleEntryLockCC;
1859
+ var ScheduleEntryLockCCDailyRepeatingScheduleReport2 = class extends _classSuper {
1860
+ static {
1861
+ _classThis = this;
1862
+ }
1863
+ static {
1864
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1865
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1866
+ ScheduleEntryLockCCDailyRepeatingScheduleReport2 = _classThis = _classDescriptor.value;
1867
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1868
+ __runInitializers(_classThis, _classExtraInitializers);
1869
+ }
1870
+ constructor(options) {
1871
+ super(options);
1872
+ this.userId = options.userId;
1873
+ this.slotId = options.slotId;
1874
+ this.weekdays = options.weekdays;
1875
+ this.startHour = options.startHour;
1876
+ this.startMinute = options.startMinute;
1877
+ this.durationHour = options.durationHour;
1878
+ this.durationMinute = options.durationMinute;
1879
+ }
1880
+ static from(raw, ctx) {
1881
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
1882
+ const userId = raw.payload[0];
1883
+ const slotId = raw.payload[1];
1884
+ if (raw.payload.length >= 7 && raw.payload[2] !== 0) {
1885
+ const weekdays = (0, import_core.parseBitMask)(raw.payload.subarray(2, 3), import_Types.ScheduleEntryLockWeekday.Sunday);
1886
+ const startHour = raw.payload[3];
1887
+ const startMinute = raw.payload[4];
1888
+ const durationHour = raw.payload[5];
1889
+ const durationMinute = raw.payload[6];
1890
+ return new this({
1891
+ nodeId: ctx.sourceNodeId,
1892
+ userId,
1893
+ slotId,
1894
+ weekdays,
1895
+ startHour,
1896
+ startMinute,
1897
+ durationHour,
1898
+ durationMinute
1899
+ });
1900
+ } else {
1901
+ return new this({
1902
+ nodeId: ctx.sourceNodeId,
1903
+ userId,
1904
+ slotId
1905
+ });
1906
+ }
1907
+ }
1908
+ userId;
1909
+ slotId;
1910
+ weekdays;
1911
+ startHour;
1912
+ startMinute;
1913
+ durationHour;
1914
+ durationMinute;
1915
+ persistValues(ctx) {
1916
+ if (!super.persistValues(ctx))
1917
+ return false;
1918
+ persistSchedule.call(this, ctx, import_Types.ScheduleEntryLockScheduleKind.DailyRepeating, this.userId, this.slotId, this.weekdays?.length ? {
1919
+ weekdays: this.weekdays,
1920
+ startHour: this.startHour,
1921
+ startMinute: this.startMinute,
1922
+ durationHour: this.durationHour,
1923
+ durationMinute: this.durationMinute
1924
+ } : false);
1925
+ return true;
1926
+ }
1927
+ serialize(ctx) {
1928
+ this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1929
+ if (this.weekdays) {
1930
+ this.payload = import_shared.Bytes.concat([
1931
+ this.payload,
1932
+ (0, import_core.encodeBitMask)(this.weekdays, import_Types.ScheduleEntryLockWeekday.Saturday, import_Types.ScheduleEntryLockWeekday.Sunday),
1933
+ import_shared.Bytes.from([
1934
+ this.startHour,
1935
+ this.startMinute,
1936
+ this.durationHour,
1937
+ this.durationMinute
1938
+ ])
1939
+ ]);
1940
+ } else {
1941
+ this.payload = import_shared.Bytes.concat([this.payload, import_shared.Bytes.alloc(5, 0)]);
1942
+ }
1943
+ return super.serialize(ctx);
1944
+ }
1945
+ toLogEntry(ctx) {
1946
+ let message;
1947
+ if (!this.weekdays) {
1948
+ message = {
1949
+ "user ID": this.userId,
1950
+ "slot #": this.slotId,
1951
+ schedule: "(empty)"
1952
+ };
1953
+ } else {
1954
+ message = {
1955
+ "user ID": this.userId,
1956
+ "slot #": this.slotId,
1957
+ action: "set",
1958
+ weekdays: this.weekdays.map((w) => (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, w)).join(", "),
1959
+ "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1960
+ duration: (0, import_shared.formatTime)(this.durationHour ?? 0, this.durationMinute ?? 0)
1961
+ };
1962
+ }
1963
+ return {
1964
+ ...super.toLogEntry(ctx),
1965
+ message
1966
+ };
1967
+ }
1968
+ };
1969
+ return ScheduleEntryLockCCDailyRepeatingScheduleReport2 = _classThis;
1970
+ })();
1971
+ let ScheduleEntryLockCCDailyRepeatingScheduleGet = (() => {
1972
+ let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleGet), (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCDailyRepeatingScheduleReport)];
1973
+ let _classDescriptor;
1974
+ let _classExtraInitializers = [];
1975
+ let _classThis;
1976
+ let _classSuper = ScheduleEntryLockCC;
1977
+ var ScheduleEntryLockCCDailyRepeatingScheduleGet2 = class extends _classSuper {
1978
+ static {
1979
+ _classThis = this;
1980
+ }
1981
+ static {
1982
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
1983
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
1984
+ ScheduleEntryLockCCDailyRepeatingScheduleGet2 = _classThis = _classDescriptor.value;
1985
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
1986
+ __runInitializers(_classThis, _classExtraInitializers);
1987
+ }
1988
+ constructor(options) {
1989
+ super(options);
1990
+ this.userId = options.userId;
1991
+ this.slotId = options.slotId;
1992
+ }
1993
+ static from(raw, ctx) {
1994
+ (0, import_core.validatePayload)(raw.payload.length >= 2);
1995
+ const userId = raw.payload[0];
1996
+ const slotId = raw.payload[1];
1997
+ return new this({
1635
1998
  nodeId: ctx.sourceNodeId,
1636
1999
  userId,
1637
2000
  slotId
1638
2001
  });
1639
2002
  }
1640
- }
1641
- userId;
1642
- slotId;
1643
- weekdays;
1644
- startHour;
1645
- startMinute;
1646
- durationHour;
1647
- durationMinute;
1648
- persistValues(ctx) {
1649
- if (!super.persistValues(ctx))
1650
- return false;
1651
- persistSchedule.call(this, ctx, import_Types.ScheduleEntryLockScheduleKind.DailyRepeating, this.userId, this.slotId, this.weekdays?.length ? {
1652
- weekdays: this.weekdays,
1653
- startHour: this.startHour,
1654
- startMinute: this.startMinute,
1655
- durationHour: this.durationHour,
1656
- durationMinute: this.durationMinute
1657
- } : false);
1658
- return true;
1659
- }
1660
- serialize(ctx) {
1661
- this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1662
- if (this.weekdays) {
1663
- this.payload = import_shared.Bytes.concat([
1664
- this.payload,
1665
- (0, import_core.encodeBitMask)(this.weekdays, import_Types.ScheduleEntryLockWeekday.Saturday, import_Types.ScheduleEntryLockWeekday.Sunday),
1666
- import_shared.Bytes.from([
1667
- this.startHour,
1668
- this.startMinute,
1669
- this.durationHour,
1670
- this.durationMinute
1671
- ])
1672
- ]);
1673
- } else {
1674
- this.payload = import_shared.Bytes.concat([this.payload, import_shared.Bytes.alloc(5, 0)]);
2003
+ userId;
2004
+ slotId;
2005
+ serialize(ctx) {
2006
+ this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
2007
+ return super.serialize(ctx);
1675
2008
  }
1676
- return super.serialize(ctx);
1677
- }
1678
- toLogEntry(ctx) {
1679
- let message;
1680
- if (!this.weekdays) {
1681
- message = {
1682
- "user ID": this.userId,
1683
- "slot #": this.slotId,
1684
- schedule: "(empty)"
1685
- };
1686
- } else {
1687
- message = {
1688
- "user ID": this.userId,
1689
- "slot #": this.slotId,
1690
- action: "set",
1691
- weekdays: this.weekdays.map((w) => (0, import_shared.getEnumMemberName)(import_Types.ScheduleEntryLockWeekday, w)).join(", "),
1692
- "start time": (0, import_shared.formatTime)(this.startHour ?? 0, this.startMinute ?? 0),
1693
- duration: (0, import_shared.formatTime)(this.durationHour ?? 0, this.durationMinute ?? 0)
2009
+ toLogEntry(ctx) {
2010
+ return {
2011
+ ...super.toLogEntry(ctx),
2012
+ message: {
2013
+ "user ID": this.userId,
2014
+ "slot #": this.slotId
2015
+ }
1694
2016
  };
1695
2017
  }
1696
- return {
1697
- ...super.toLogEntry(ctx),
1698
- message
1699
- };
1700
- }
1701
- };
1702
- ScheduleEntryLockCCDailyRepeatingScheduleReport = ScheduleEntryLockCCDailyRepeatingScheduleReport_1 = __decorate([
1703
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleReport)
1704
- ], ScheduleEntryLockCCDailyRepeatingScheduleReport);
1705
- let ScheduleEntryLockCCDailyRepeatingScheduleGet = ScheduleEntryLockCCDailyRepeatingScheduleGet_1 = class ScheduleEntryLockCCDailyRepeatingScheduleGet2 extends ScheduleEntryLockCC {
1706
- constructor(options) {
1707
- super(options);
1708
- this.userId = options.userId;
1709
- this.slotId = options.slotId;
1710
- }
1711
- static from(raw, ctx) {
1712
- (0, import_core.validatePayload)(raw.payload.length >= 2);
1713
- const userId = raw.payload[0];
1714
- const slotId = raw.payload[1];
1715
- return new ScheduleEntryLockCCDailyRepeatingScheduleGet_1({
1716
- nodeId: ctx.sourceNodeId,
1717
- userId,
1718
- slotId
1719
- });
1720
- }
1721
- userId;
1722
- slotId;
1723
- serialize(ctx) {
1724
- this.payload = import_shared.Bytes.from([this.userId, this.slotId]);
1725
- return super.serialize(ctx);
1726
- }
1727
- toLogEntry(ctx) {
1728
- return {
1729
- ...super.toLogEntry(ctx),
1730
- message: {
1731
- "user ID": this.userId,
1732
- "slot #": this.slotId
1733
- }
1734
- };
1735
- }
1736
- };
1737
- ScheduleEntryLockCCDailyRepeatingScheduleGet = ScheduleEntryLockCCDailyRepeatingScheduleGet_1 = __decorate([
1738
- (0, import_CommandClassDecorators.CCCommand)(import_Types.ScheduleEntryLockCommand.DailyRepeatingScheduleGet),
1739
- (0, import_CommandClassDecorators.expectedCCResponse)(ScheduleEntryLockCCDailyRepeatingScheduleReport)
1740
- ], ScheduleEntryLockCCDailyRepeatingScheduleGet);
2018
+ };
2019
+ return ScheduleEntryLockCCDailyRepeatingScheduleGet2 = _classThis;
2020
+ })();
1741
2021
  // Annotate the CommonJS export names for ESM import in node:
1742
2022
  0 && (module.exports = {
1743
2023
  ScheduleEntryLockCC,