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