@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.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- 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
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 =
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
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
|
-
|
|
413
|
-
|
|
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
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
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
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
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
|
-
|
|
444
|
-
|
|
445
|
-
|
|
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
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
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
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
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
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
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
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
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
|
-
|
|
572
|
+
return result;
|
|
523
573
|
}
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
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
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
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
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
...
|
|
567
|
-
}
|
|
568
|
-
|
|
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
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
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
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
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
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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:
|
|
654
|
-
direction: "
|
|
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: "
|
|
702
|
+
message: "Querying supported number of schedule slots...",
|
|
661
703
|
direction: "outbound"
|
|
662
704
|
});
|
|
663
|
-
const
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
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
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
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
|
-
|
|
837
|
-
|
|
838
|
-
|
|
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
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
(
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
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
|
-
|
|
817
|
+
enabled
|
|
886
818
|
});
|
|
887
819
|
}
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
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
|
-
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
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
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
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
|
-
|
|
993
|
-
|
|
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
|
-
|
|
996
|
-
|
|
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
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
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
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
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
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
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
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
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
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
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
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
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
|
-
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
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
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
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
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
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
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
this.
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
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
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
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
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
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
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
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
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
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
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
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
|
-
}
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
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
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
}
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
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
|
-
}
|
|
1634
|
-
|
|
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
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
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
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
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
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
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,
|