@zwave-js/cc 15.15.3 → 15.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +1 -1
- package/build/cjs/cc/AlarmSensorCC.js.map +1 -1
- package/build/cjs/cc/ApplicationStatusCC.d.ts +33 -0
- package/build/cjs/cc/ApplicationStatusCC.js +229 -0
- package/build/cjs/cc/ApplicationStatusCC.js.map +7 -0
- package/build/cjs/cc/AssociationCC.js.map +1 -1
- package/build/cjs/cc/AssociationGroupInfoCC.js +4 -4
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.js +9 -2
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.js +1 -1
- package/build/cjs/cc/BasicCC.js.map +1 -1
- package/build/cjs/cc/BatteryCC.js +6 -2
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.js +1 -1
- package/build/cjs/cc/BinarySwitchCC.js.map +1 -1
- package/build/cjs/cc/CRC16CC.js +2 -2
- package/build/cjs/cc/CRC16CC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.js +2 -2
- package/build/cjs/cc/CentralSceneCC.js.map +1 -1
- package/build/cjs/cc/ClimateControlScheduleCC.js +5 -5
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.js +1 -1
- package/build/cjs/cc/ClockCC.js.map +1 -1
- package/build/cjs/cc/ColorSwitchCC.js.map +1 -1
- package/build/cjs/cc/ConfigurationCC.d.ts +6 -0
- package/build/cjs/cc/ConfigurationCC.js +52 -4
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC.js +3 -3
- package/build/cjs/cc/DoorLockCC.js.map +1 -1
- package/build/cjs/cc/EntryControlCC.d.ts +2 -2
- package/build/cjs/cc/EntryControlCC.js +3 -3
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.js +5 -5
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.js +3 -3
- package/build/cjs/cc/IrrigationCC.js.map +1 -1
- package/build/cjs/cc/LanguageCC.js +1 -1
- package/build/cjs/cc/LanguageCC.js.map +1 -1
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +4 -4
- package/build/cjs/cc/ManufacturerProprietaryCC.js +1 -1
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +1 -1
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cjs/cc/MeterCC.js +3 -3
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.js +8 -8
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.js.map +1 -1
- package/build/cjs/cc/MultilevelSwitchCC.js +1 -1
- package/build/cjs/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +3 -3
- package/build/cjs/cc/NotificationCC.js +29 -23
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.js +10 -3
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.js +0 -1
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.js +1 -1
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cjs/cc/Security2CC.d.ts +14 -14
- package/build/cjs/cc/Security2CC.js +6 -5
- package/build/cjs/cc/Security2CC.js.map +2 -2
- package/build/cjs/cc/SecurityCC.d.ts +10 -10
- package/build/cjs/cc/SecurityCC.js +3 -3
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.js +2 -2
- package/build/cjs/cc/SoundSwitchCC.js.map +1 -1
- package/build/cjs/cc/SupervisionCC.js +1 -1
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.js +1 -1
- package/build/cjs/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/cjs/cc/ThermostatFanStateCC.js +1 -1
- package/build/cjs/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/cjs/cc/ThermostatModeCC.d.ts +6 -6
- package/build/cjs/cc/ThermostatModeCC.js +2 -2
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.js +1 -1
- package/build/cjs/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/cjs/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/cjs/cc/TimeCC.js +2 -2
- package/build/cjs/cc/TimeCC.js.map +1 -1
- package/build/cjs/cc/TransportServiceCC.d.ts +7 -7
- package/build/cjs/cc/TransportServiceCC.js +1 -1
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC.d.ts +14 -6
- package/build/cjs/cc/UserCodeCC.js +16 -4
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.js +3 -3
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.js +2 -2
- package/build/cjs/cc/WakeUpCC.js.map +1 -1
- package/build/cjs/cc/WindowCoveringCC.d.ts +3 -1
- package/build/cjs/cc/WindowCoveringCC.js +28 -8
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +1 -1
- package/build/cjs/cc/ZWavePlusCC.js.map +1 -1
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.js.map +1 -1
- package/build/cjs/cc/index.d.ts +3 -0
- package/build/cjs/cc/index.js +8 -0
- package/build/cjs/cc/index.js.map +2 -2
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/cjs/lib/API.d.ts +2 -0
- package/build/cjs/lib/API.js +2 -2
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CommandClass.d.ts +7 -7
- package/build/cjs/lib/CommandClass.js +6 -6
- package/build/cjs/lib/CommandClass.js.map +2 -2
- package/build/cjs/lib/NotificationEventPayload.d.ts +2 -1
- package/build/cjs/lib/NotificationEventPayload.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +12 -12
- package/build/cjs/lib/Security2/Extension.js.map +2 -2
- package/build/cjs/lib/_Types.d.ts +11 -1
- package/build/cjs/lib/_Types.js +15 -0
- package/build/cjs/lib/_Types.js.map +3 -3
- package/build/cjs/lib/serializers.d.ts +4 -4
- package/build/cjs/lib/serializers.js.map +2 -2
- package/build/cjs/lib/traits.d.ts +5 -0
- package/build/cjs/lib/utils.js +1 -1
- package/build/cjs/lib/utils.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.js +1 -1
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/ApplicationStatusCC.d.ts +33 -0
- package/build/esm/cc/ApplicationStatusCC.d.ts.map +1 -0
- package/build/esm/cc/ApplicationStatusCC.js +175 -0
- package/build/esm/cc/ApplicationStatusCC.js.map +1 -0
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +4 -4
- 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 +13 -2
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.js +1 -1
- 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 +5 -2
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +1 -1
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +2 -2
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -2
- 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 +5 -5
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +1 -1
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +6 -0
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +65 -5
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.js +3 -3
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +2 -2
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +3 -3
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +4 -4
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +6 -6
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -3
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.js +1 -1
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +4 -4
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +1 -1
- 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 +3 -3
- 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.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +8 -8
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +3 -3
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +43 -31
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +16 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +0 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +0 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +14 -14
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +7 -6
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +10 -10
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +4 -4
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -2
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +1 -1
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +6 -6
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +3 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +2 -2
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +7 -7
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +2 -1
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +14 -6
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +20 -4
- 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 +4 -4
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -2
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +3 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +30 -9
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +1 -1
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +3 -3
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/index.d.ts +3 -0
- package/build/esm/cc/index.d.ts.map +1 -1
- package/build/esm/cc/index.js +5 -0
- package/build/esm/cc/index.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/API.d.ts +2 -0
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js +2 -2
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CommandClass.d.ts +7 -7
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +6 -6
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/NotificationEventPayload.d.ts +2 -1
- package/build/esm/lib/NotificationEventPayload.d.ts.map +1 -1
- package/build/esm/lib/NotificationEventPayload.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +12 -12
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +1 -1
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/build/esm/lib/_Types.d.ts +11 -1
- package/build/esm/lib/_Types.d.ts.map +1 -1
- package/build/esm/lib/_Types.js +11 -0
- package/build/esm/lib/_Types.js.map +1 -1
- package/build/esm/lib/serializers.d.ts +4 -4
- package/build/esm/lib/serializers.d.ts.map +1 -1
- package/build/esm/lib/serializers.js.map +1 -1
- package/build/esm/lib/traits.d.ts +5 -0
- package/build/esm/lib/traits.d.ts.map +1 -1
- package/build/esm/lib/utils.js +1 -1
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +12 -13
- package/build/cjs/lib/ICommandClassContainer.d.ts +0 -2
- package/build/cjs/lib/ICommandClassContainer.js +0 -17
- package/build/cjs/lib/ICommandClassContainer.js.map +0 -7
- package/build/esm/lib/ICommandClassContainer.d.ts +0 -2
- package/build/esm/lib/ICommandClassContainer.d.ts.map +0 -1
- package/build/esm/lib/ICommandClassContainer.js +0 -2
- package/build/esm/lib/ICommandClassContainer.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/ScheduleEntryLockCC.ts"],
|
|
4
|
-
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeBitMask,\n\tgetDSTInfo,\n\tisUnsupervisedOrSucceeded,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\tBytes,\n\tformatDate,\n\tformatTime,\n\tgetEnumMemberName,\n\tpick,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tScheduleEntryLockCommand,\n\ttype ScheduleEntryLockDailyRepeatingSchedule,\n\tScheduleEntryLockScheduleKind,\n\tScheduleEntryLockSetAction,\n\ttype ScheduleEntryLockSlotId,\n\ttype ScheduleEntryLockWeekDaySchedule,\n\tScheduleEntryLockWeekday,\n\ttype ScheduleEntryLockYearDaySchedule,\n\ttype Timezone,\n} from \"../lib/_Types.js\";\nimport { encodeTimezone, parseTimezone } from \"../lib/serializers.js\";\nimport { UserCodeCC } from \"./UserCodeCC.js\";\n\nexport const ScheduleEntryLockCCValues = V.defineCCValues(\n\tCommandClasses[\"Schedule Entry Lock\"],\n\t{\n\t\t...V.staticProperty(\"numWeekDaySlots\", undefined, { internal: true }),\n\t\t...V.staticProperty(\"numYearDaySlots\", undefined, { internal: true }),\n\t\t...V.staticProperty(\"numDailyRepeatingSlots\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"userEnabled\",\n\t\t\t\"userEnabled\",\n\t\t\t(userId: number) => userId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"userEnabled\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"scheduleKind\",\n\t\t\t\"scheduleKind\",\n\t\t\t(userId: number) => userId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"scheduleKind\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"schedule\",\n\t\t\t\"schedule\",\n\t\t\t(\n\t\t\t\tscheduleKind: ScheduleEntryLockScheduleKind,\n\t\t\t\tuserId: number,\n\t\t\t\tslotId: number,\n\t\t\t) => (scheduleKind << 16) | (userId << 8) | slotId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"schedule\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t},\n);\n\n/** Caches information about a schedule */\nfunction persistSchedule(\n\tthis: ScheduleEntryLockCC,\n\tctx: GetValueDB,\n\tscheduleKind: ScheduleEntryLockScheduleKind,\n\tuserId: number,\n\tslotId: number,\n\tschedule:\n\t\t| ScheduleEntryLockWeekDaySchedule\n\t\t| ScheduleEntryLockYearDaySchedule\n\t\t| ScheduleEntryLockDailyRepeatingSchedule\n\t\t| false\n\t\t| undefined,\n): void {\n\tconst scheduleValue = ScheduleEntryLockCCValues.schedule(\n\t\tscheduleKind,\n\t\tuserId,\n\t\tslotId,\n\t);\n\n\tif (schedule != undefined) {\n\t\tthis.setValue(ctx, scheduleValue, schedule);\n\t} else {\n\t\tthis.removeValue(ctx, scheduleValue);\n\t}\n}\n\n/** Updates the schedule kind assumed to be active for user in the cache */\nfunction setUserCodeScheduleKindCached(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n\tuserId: number,\n\tscheduleKind: ScheduleEntryLockScheduleKind,\n): void {\n\tctx\n\t\t.getValueDB(endpoint.nodeId)\n\t\t.setValue(\n\t\t\tScheduleEntryLockCCValues.scheduleKind(userId).endpoint(\n\t\t\t\tendpoint.index,\n\t\t\t),\n\t\t\tscheduleKind,\n\t\t);\n}\n\n/** Updates whether scheduling is active for one or all user(s) in the cache */\nfunction setUserCodeScheduleEnabledCached(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n\tuserId: number | undefined,\n\tenabled: boolean,\n): void {\n\tconst setEnabled = (userId: number) => {\n\t\tctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.setValue(\n\t\t\t\tScheduleEntryLockCCValues.userEnabled(userId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t\tenabled,\n\t\t\t);\n\t};\n\n\tif (userId == undefined) {\n\t\t// Enable/disable all users\n\t\tconst numUsers = UserCodeCC.getSupportedUsersCached(ctx, endpoint)\n\t\t\t?? 0;\n\n\t\tfor (let userId = 1; userId <= numUsers; userId++) {\n\t\t\tsetEnabled(userId);\n\t\t}\n\t} else {\n\t\tsetEnabled(userId);\n\t}\n}\n\n@API(CommandClasses[\"Schedule Entry Lock\"])\nexport class ScheduleEntryLockCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ScheduleEntryLockCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ScheduleEntryLockCommand.EnableSet:\n\t\t\tcase ScheduleEntryLockCommand.EnableAllSet:\n\t\t\tcase ScheduleEntryLockCommand.WeekDayScheduleSet:\n\t\t\tcase ScheduleEntryLockCommand.WeekDayScheduleGet:\n\t\t\tcase ScheduleEntryLockCommand.YearDayScheduleSet:\n\t\t\tcase ScheduleEntryLockCommand.YearDayScheduleGet:\n\t\t\tcase ScheduleEntryLockCommand.SupportedGet:\n\t\t\t\treturn true; // V1\n\n\t\t\tcase ScheduleEntryLockCommand.TimeOffsetSet:\n\t\t\tcase ScheduleEntryLockCommand.TimeOffsetGet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase ScheduleEntryLockCommand.DailyRepeatingScheduleSet:\n\t\t\tcase ScheduleEntryLockCommand.DailyRepeatingScheduleGet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Enables or disables schedules. If a user ID is given, that user's\n\t * schedules will be enabled or disabled. If no user ID is given, all schedules\n\t * will be affected.\n\t */\n\t@validateArgs()\n\tpublic async setEnabled(\n\t\tenabled: boolean,\n\t\tuserId?: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tlet result: SupervisionResult | undefined;\n\t\tif (userId != undefined) {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tScheduleEntryLockCommand,\n\t\t\t\tScheduleEntryLockCommand.EnableSet,\n\t\t\t);\n\n\t\t\tconst cc = new ScheduleEntryLockCCEnableSet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tuserId,\n\t\t\t\tenabled,\n\t\t\t});\n\n\t\t\tresult = await this.host.sendCommand(cc, this.commandOptions);\n\t\t} else {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tScheduleEntryLockCommand,\n\t\t\t\tScheduleEntryLockCommand.EnableAllSet,\n\t\t\t);\n\n\t\t\tconst cc = new ScheduleEntryLockCCEnableAllSet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tenabled,\n\t\t\t});\n\n\t\t\tresult = await this.host.sendCommand(cc, this.commandOptions);\n\t\t}\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Remember the new state in the cache\n\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t\tuserId,\n\t\t\t\tenabled,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getNumSlots() {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result) {\n\t\t\treturn pick(result, [\n\t\t\t\t\"numWeekDaySlots\",\n\t\t\t\t\"numYearDaySlots\",\n\t\t\t\t\"numDailyRepeatingSlots\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setWeekDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t\tschedule?: ScheduleEntryLockWeekDaySchedule,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.WeekDayScheduleSet,\n\t\t);\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst numSlots = ScheduleEntryLockCC.getNumWeekDaySlotsCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t);\n\n\t\t\tif (slot.slotId < 1 || slot.slotId > numSlots) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The schedule slot # must be between 1 and the number of supported day-of-week slots ${numSlots}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (schedule) {\n\t\t\tif (\n\t\t\t\tschedule.stopHour < schedule.startHour\n\t\t\t\t|| schedule.stopHour === schedule.startHour\n\t\t\t\t\t&& schedule.stopMinute <= schedule.startMinute\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The stop time must be after the start time.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new ScheduleEntryLockCCWeekDayScheduleSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t\t...(schedule\n\t\t\t\t? {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Set,\n\t\t\t\t\t...schedule,\n\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Erase,\n\t\t\t\t}),\n\t\t});\n\n\t\tconst result = await this.host.sendCommand(cc, this.commandOptions);\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Editing (but not erasing) a schedule will enable scheduling for that user\n\t\t\t// and switch it to the current scheduling kind\n\t\t\tif (!!schedule) {\n\t\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tsetUserCodeScheduleKindCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\tScheduleEntryLockScheduleKind.WeekDay,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// And cache the schedule\n\t\t\tpersistSchedule.call(\n\t\t\t\tcc,\n\t\t\t\tthis.host,\n\t\t\t\tScheduleEntryLockScheduleKind.WeekDay,\n\t\t\t\tslot.userId,\n\t\t\t\tslot.slotId,\n\t\t\t\tschedule ?? false,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@validateArgs()\n\tpublic async getWeekDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t): Promise<MaybeNotKnown<ScheduleEntryLockWeekDaySchedule>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.WeekDayScheduleSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCWeekDayScheduleGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCWeekDayScheduleReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result?.weekday != undefined) {\n\t\t\treturn {\n\t\t\t\tweekday: result.weekday,\n\t\t\t\tstartHour: result.startHour!,\n\t\t\t\tstartMinute: result.startMinute!,\n\t\t\t\tstopHour: result.stopHour!,\n\t\t\t\tstopMinute: result.stopMinute!,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setYearDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t\tschedule?: ScheduleEntryLockYearDaySchedule,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.YearDayScheduleSet,\n\t\t);\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst numSlots = ScheduleEntryLockCC.getNumYearDaySlotsCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t);\n\n\t\t\tif (slot.slotId < 1 || slot.slotId > numSlots) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The schedule slot # must be between 1 and the number of supported day-of-year slots ${numSlots}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (schedule) {\n\t\t\tconst startDate = new Date(\n\t\t\t\tschedule.startYear,\n\t\t\t\tschedule.startMonth - 1,\n\t\t\t\tschedule.startDay,\n\t\t\t\tschedule.startHour,\n\t\t\t\tschedule.startMinute,\n\t\t\t);\n\t\t\tconst stopDate = new Date(\n\t\t\t\tschedule.stopYear,\n\t\t\t\tschedule.stopMonth - 1,\n\t\t\t\tschedule.stopDay,\n\t\t\t\tschedule.stopHour,\n\t\t\t\tschedule.stopMinute,\n\t\t\t);\n\t\t\tif (stopDate <= startDate) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The stop date must be after the start date.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new ScheduleEntryLockCCYearDayScheduleSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t\t...(schedule\n\t\t\t\t? {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Set,\n\t\t\t\t\t...schedule,\n\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Erase,\n\t\t\t\t}),\n\t\t});\n\n\t\tconst result = await this.host.sendCommand(cc, this.commandOptions);\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Editing (but not erasing) a schedule will enable scheduling for that user\n\t\t\t// and switch it to the current scheduling kind\n\t\t\tif (!!schedule) {\n\t\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tsetUserCodeScheduleKindCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\tScheduleEntryLockScheduleKind.YearDay,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// And cache the schedule\n\t\t\tpersistSchedule.call(\n\t\t\t\tcc,\n\t\t\t\tthis.host,\n\t\t\t\tScheduleEntryLockScheduleKind.YearDay,\n\t\t\t\tslot.userId,\n\t\t\t\tslot.slotId,\n\t\t\t\tschedule ?? false,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@validateArgs()\n\tpublic async getYearDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t): Promise<MaybeNotKnown<ScheduleEntryLockYearDaySchedule>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.YearDayScheduleSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCYearDayScheduleGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCYearDayScheduleReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result?.startYear != undefined) {\n\t\t\treturn {\n\t\t\t\tstartYear: result.startYear,\n\t\t\t\tstartMonth: result.startMonth!,\n\t\t\t\tstartDay: result.startDay!,\n\t\t\t\tstartHour: result.startHour!,\n\t\t\t\tstartMinute: result.startMinute!,\n\t\t\t\tstopYear: result.stopYear!,\n\t\t\t\tstopMonth: result.stopMonth!,\n\t\t\t\tstopDay: result.stopDay!,\n\t\t\t\tstopHour: result.stopHour!,\n\t\t\t\tstopMinute: result.stopMinute!,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setDailyRepeatingSchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t\tschedule?: ScheduleEntryLockDailyRepeatingSchedule,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.DailyRepeatingScheduleSet,\n\t\t);\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst numSlots = ScheduleEntryLockCC\n\t\t\t\t.getNumDailyRepeatingSlotsCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t);\n\n\t\t\tif (slot.slotId < 1 || slot.slotId > numSlots) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The schedule slot # must be between 1 and the number of supported daily repeating slots ${numSlots}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new ScheduleEntryLockCCDailyRepeatingScheduleSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t\t...(schedule\n\t\t\t\t? {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Set,\n\t\t\t\t\t...schedule,\n\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Erase,\n\t\t\t\t}),\n\t\t});\n\n\t\tconst result = await this.host.sendCommand(cc, this.commandOptions);\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Editing (but not erasing) a schedule will enable scheduling for that user\n\t\t\t// and switch it to the current scheduling kind\n\t\t\tif (!!schedule) {\n\t\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tsetUserCodeScheduleKindCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\tScheduleEntryLockScheduleKind.DailyRepeating,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// And cache the schedule\n\t\t\tpersistSchedule.call(\n\t\t\t\tcc,\n\t\t\t\tthis.host,\n\t\t\t\tScheduleEntryLockScheduleKind.DailyRepeating,\n\t\t\t\tslot.userId,\n\t\t\t\tslot.slotId,\n\t\t\t\tschedule ?? false,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@validateArgs()\n\tpublic async getDailyRepeatingSchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t): Promise<MaybeNotKnown<ScheduleEntryLockDailyRepeatingSchedule>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.DailyRepeatingScheduleSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCDailyRepeatingScheduleGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result?.weekdays != undefined) {\n\t\t\treturn {\n\t\t\t\tweekdays: result.weekdays,\n\t\t\t\tstartHour: result.startHour!,\n\t\t\t\tstartMinute: result.startMinute!,\n\t\t\t\tdurationHour: result.durationHour!,\n\t\t\t\tdurationMinute: result.durationMinute!,\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic async getTimezone(): Promise<MaybeNotKnown<Timezone>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.TimeOffsetGet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCTimeOffsetGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCTimeOffsetReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result) {\n\t\t\treturn pick(result, [\"standardOffset\", \"dstOffset\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setTimezone(\n\t\ttimezone: Timezone,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.TimeOffsetSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCTimeOffsetSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...timezone,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Schedule Entry Lock\"])\n@implementedVersion(3)\n@ccValues(ScheduleEntryLockCCValues)\nexport class ScheduleEntryLockCC extends CommandClass {\n\tdeclare ccCommand: ScheduleEntryLockCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Schedule Entry Lock\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying supported number of schedule slots...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst slotsResp = await api.getNumSlots();\n\t\tif (slotsResp) {\n\t\t\tlet logMessage = `received supported number of schedule slots:\nday of week: ${slotsResp.numWeekDaySlots}\nday of year: ${slotsResp.numYearDaySlots}`;\n\t\t\tif (slotsResp.numDailyRepeatingSlots != undefined) {\n\t\t\t\tlogMessage += `\ndaily repeating: ${slotsResp.numDailyRepeatingSlots}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\t// If the timezone is not configured with the Time CC, do it here\n\t\tif (\n\t\t\tapi.supportsCommand(ScheduleEntryLockCommand.TimeOffsetSet)\n\t\t\t&& (!endpoint.supportsCC(CommandClasses.Time)\n\t\t\t\t|| endpoint.getCCVersion(CommandClasses.Time) < 2)\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"setting timezone information...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\t// Set the correct timezone on this node\n\t\t\tconst timezone = getDSTInfo();\n\t\t\tawait api.setTimezone(timezone);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\t/**\n\t * Returns the number of supported day-of-week slots.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getNumWeekDaySlotsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.numWeekDaySlots.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of supported day-of-year slots.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getNumYearDaySlotsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.numYearDaySlots.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of supported daily-repeating slots.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getNumDailyRepeatingSlotsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.numDailyRepeatingSlots.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns whether scheduling for a given user ID (most likely) enabled. Since the Schedule Entry Lock CC\n\t * provides no way to query the enabled state, Z-Wave JS tracks this in its own cache.\n\t *\n\t * This only works AFTER the interview process and is likely to be wrong if a device\n\t * with existing schedules is queried. To be sure, disable scheduling for all users and enable\n\t * only the desired ones.\n\t */\n\tpublic static getUserCodeScheduleEnabledCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tuserId: number,\n\t): boolean {\n\t\treturn !!ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.userEnabled(userId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\t/**\n\t * Returns which scheduling kind is (most likely) enabled for a given user ID . Since the Schedule Entry Lock CC\n\t * provides no way to query the current state, Z-Wave JS tracks this in its own cache.\n\t *\n\t * This only works AFTER the interview process and is likely to be wrong if a device\n\t * with existing schedules is queried. To be sure, edit a schedule of the desired kind\n\t * which will automatically switch the user to that scheduling kind.\n\t */\n\tpublic static getUserCodeScheduleKindCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tuserId: number,\n\t): MaybeNotKnown<ScheduleEntryLockScheduleKind> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue<ScheduleEntryLockScheduleKind>(\n\t\t\t\tScheduleEntryLockCCValues.scheduleKind(userId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind.WeekDay,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<ScheduleEntryLockWeekDaySchedule | false>;\n\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind.YearDay,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<ScheduleEntryLockYearDaySchedule | false>;\n\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind.DailyRepeating,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<ScheduleEntryLockDailyRepeatingSchedule | false>;\n\n\t// Catch-all overload for applications which haven't narrowed `scheduleKind`\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<\n\t\t| ScheduleEntryLockWeekDaySchedule\n\t\t| ScheduleEntryLockYearDaySchedule\n\t\t| ScheduleEntryLockDailyRepeatingSchedule\n\t\t| false\n\t>;\n\n\t/**\n\t * Returns the assumed state of a schedule. Since the Schedule Entry Lock CC\n\t * provides no way to query the current state, Z-Wave JS tracks this in its own cache.\n\t *\n\t * A return value of `false` means the slot is empty, a return value of `undefined` means the information is not cached yet.\n\t *\n\t * This only works AFTER the interview process.\n\t */\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<\n\t\t| ScheduleEntryLockWeekDaySchedule\n\t\t| ScheduleEntryLockYearDaySchedule\n\t\t| ScheduleEntryLockDailyRepeatingSchedule\n\t\t| false\n\t> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.schedule(\n\t\t\t\t\tscheduleKind,\n\t\t\t\t\tuserId,\n\t\t\t\t\tslotId,\n\t\t\t\t).endpoint(endpoint.index),\n\t\t\t);\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCEnableSetOptions {\n\tuserId: number;\n\tenabled: boolean;\n}\n\n@CCCommand(ScheduleEntryLockCommand.EnableSet)\n@useSupervision()\nexport class ScheduleEntryLockCCEnableSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCEnableSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.enabled = options.enabled;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCEnableSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst enabled: boolean = raw.payload[1] === 0x01;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tenabled,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic enabled: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.enabled ? 0x01 : 0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\taction: this.enabled ? \"enable\" : \"disable\",\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCEnableAllSetOptions {\n\tenabled: boolean;\n}\n\n@CCCommand(ScheduleEntryLockCommand.EnableAllSet)\n@useSupervision()\nexport class ScheduleEntryLockCCEnableAllSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCEnableAllSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.enabled = options.enabled;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCEnableAllSet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst enabled: boolean = raw.payload[0] === 0x01;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tenabled,\n\t\t});\n\t}\n\n\tpublic enabled: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.enabled ? 0x01 : 0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\taction: this.enabled ? \"enable all\" : \"disable all\",\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCSupportedReportOptions {\n\tnumWeekDaySlots: number;\n\tnumYearDaySlots: number;\n\tnumDailyRepeatingSlots?: number;\n}\n\n@CCCommand(ScheduleEntryLockCommand.SupportedReport)\n@ccValueProperty(\"numWeekDaySlots\", ScheduleEntryLockCCValues.numWeekDaySlots)\n@ccValueProperty(\"numYearDaySlots\", ScheduleEntryLockCCValues.numYearDaySlots)\n@ccValueProperty(\n\t\"numDailyRepeatingSlots\",\n\tScheduleEntryLockCCValues.numDailyRepeatingSlots,\n)\nexport class ScheduleEntryLockCCSupportedReport extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.numWeekDaySlots = options.numWeekDaySlots;\n\t\tthis.numYearDaySlots = options.numYearDaySlots;\n\t\tthis.numDailyRepeatingSlots = options.numDailyRepeatingSlots;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst numWeekDaySlots = raw.payload[0];\n\t\tconst numYearDaySlots = raw.payload[1];\n\t\tlet numDailyRepeatingSlots: number | undefined;\n\t\tif (raw.payload.length >= 3) {\n\t\t\tnumDailyRepeatingSlots = raw.payload[2];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnumWeekDaySlots,\n\t\t\tnumYearDaySlots,\n\t\t\tnumDailyRepeatingSlots,\n\t\t});\n\t}\n\n\tpublic numWeekDaySlots: number;\n\n\tpublic numYearDaySlots: number;\n\n\tpublic numDailyRepeatingSlots: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.numWeekDaySlots,\n\t\t\tthis.numYearDaySlots,\n\t\t\tthis.numDailyRepeatingSlots ?? 0,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"no. of weekday schedule slots\": this.numWeekDaySlots,\n\t\t\t\"no. of day-of-year schedule slots\": this.numYearDaySlots,\n\t\t};\n\t\tif (this.numDailyRepeatingSlots != undefined) {\n\t\t\tmessage[\"no. of daily repeating schedule slots\"] =\n\t\t\t\tthis.numDailyRepeatingSlots;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(ScheduleEntryLockCommand.SupportedGet)\n@expectedCCResponse(ScheduleEntryLockCCSupportedReport)\nexport class ScheduleEntryLockCCSupportedGet extends ScheduleEntryLockCC {}\n\n/** @publicAPI */\nexport type ScheduleEntryLockCCWeekDayScheduleSetOptions =\n\t& ScheduleEntryLockSlotId\n\t& (\n\t\t| {\n\t\t\taction: ScheduleEntryLockSetAction.Erase;\n\t\t}\n\t\t| ({\n\t\t\taction: ScheduleEntryLockSetAction.Set;\n\t\t} & ScheduleEntryLockWeekDaySchedule)\n\t);\n\n@CCCommand(ScheduleEntryLockCommand.WeekDayScheduleSet)\n@useSupervision()\nexport class ScheduleEntryLockCCWeekDayScheduleSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCWeekDayScheduleSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.action = options.action;\n\t\tif (options.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.weekday = options.weekday;\n\t\t\tthis.startHour = options.startHour;\n\t\t\tthis.startMinute = options.startMinute;\n\t\t\tthis.stopHour = options.stopHour;\n\t\t\tthis.stopMinute = options.stopMinute;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCWeekDayScheduleSet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst action: ScheduleEntryLockSetAction = raw.payload[0];\n\n\t\tvalidatePayload(\n\t\t\taction === ScheduleEntryLockSetAction.Set\n\t\t\t\t|| action === ScheduleEntryLockSetAction.Erase,\n\t\t);\n\t\tconst userId = raw.payload[1];\n\t\tconst slotId = raw.payload[2];\n\n\t\tif (action !== ScheduleEntryLockSetAction.Set) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\taction,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 8);\n\t\tconst weekday: ScheduleEntryLockWeekday = raw.payload[3];\n\t\tconst startHour = raw.payload[4];\n\t\tconst startMinute = raw.payload[5];\n\t\tconst stopHour = raw.payload[6];\n\t\tconst stopMinute = raw.payload[7];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\taction,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t\tweekday,\n\t\t\tstartHour,\n\t\t\tstartMinute,\n\t\t\tstopHour,\n\t\t\tstopMinute,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic action: ScheduleEntryLockSetAction;\n\n\tpublic weekday?: ScheduleEntryLockWeekday;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.action,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\t// The report should have these fields set to 0xff\n\t\t\t// if the slot is erased. The specs don't mention anything\n\t\t\t// for the Set command, so we just assume the same is okay\n\t\t\tthis.weekday ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.action === ScheduleEntryLockSetAction.Erase) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"erase\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\tweekday: getEnumMemberName(\n\t\t\t\t\tScheduleEntryLockWeekday,\n\t\t\t\t\tthis.weekday!,\n\t\t\t\t),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\t\"end time\": formatTime(\n\t\t\t\t\tthis.stopHour ?? 0,\n\t\t\t\t\tthis.stopMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCWeekDayScheduleReportOptions =\n\t& ScheduleEntryLockSlotId\n\t& AllOrNone<ScheduleEntryLockWeekDaySchedule>;\n\n@CCCommand(ScheduleEntryLockCommand.WeekDayScheduleReport)\nexport class ScheduleEntryLockCCWeekDayScheduleReport\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCWeekDayScheduleReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.weekday = options.weekday;\n\t\tthis.startHour = options.startHour;\n\t\tthis.startMinute = options.startMinute;\n\t\tthis.stopHour = options.stopHour;\n\t\tthis.stopMinute = options.stopMinute;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCWeekDayScheduleReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\tlet ccOptions: ScheduleEntryLockCCWeekDayScheduleReportOptions = {\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t};\n\n\t\tlet weekday: ScheduleEntryLockWeekday | undefined;\n\t\tlet startHour: number | undefined;\n\t\tlet startMinute: number | undefined;\n\t\tlet stopHour: number | undefined;\n\t\tlet stopMinute: number | undefined;\n\n\t\tif (raw.payload.length >= 7) {\n\t\t\tif (raw.payload[2] !== 0xff) {\n\t\t\t\tweekday = raw.payload[2];\n\t\t\t}\n\t\t\tif (raw.payload[3] !== 0xff) {\n\t\t\t\tstartHour = raw.payload[3];\n\t\t\t}\n\t\t\tif (raw.payload[4] !== 0xff) {\n\t\t\t\tstartMinute = raw.payload[4];\n\t\t\t}\n\t\t\tif (raw.payload[5] !== 0xff) {\n\t\t\t\tstopHour = raw.payload[5];\n\t\t\t}\n\t\t\tif (raw.payload[6] !== 0xff) {\n\t\t\t\tstopMinute = raw.payload[6];\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tweekday != undefined\n\t\t\t&& startHour != undefined\n\t\t\t&& startMinute != undefined\n\t\t\t&& stopHour != undefined\n\t\t\t&& stopMinute != undefined\n\t\t) {\n\t\t\tccOptions = {\n\t\t\t\t...ccOptions,\n\t\t\t\tweekday,\n\t\t\t\tstartHour,\n\t\t\t\tstartMinute,\n\t\t\t\tstopHour,\n\t\t\t\tstopMinute,\n\t\t\t};\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t...ccOptions,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\tpublic weekday?: ScheduleEntryLockWeekday;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tpersistSchedule.call(\n\t\t\tthis,\n\t\t\tctx,\n\t\t\tScheduleEntryLockScheduleKind.WeekDay,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.weekday != undefined\n\t\t\t\t? {\n\t\t\t\t\tweekday: this.weekday,\n\t\t\t\t\tstartHour: this.startHour!,\n\t\t\t\t\tstartMinute: this.startMinute!,\n\t\t\t\t\tstopHour: this.stopHour!,\n\t\t\t\t\tstopMinute: this.stopMinute!,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.weekday ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.weekday == undefined) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tschedule: \"(empty)\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tweekday: getEnumMemberName(\n\t\t\t\t\tScheduleEntryLockWeekday,\n\t\t\t\t\tthis.weekday,\n\t\t\t\t),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\t\"end time\": formatTime(\n\t\t\t\t\tthis.stopHour ?? 0,\n\t\t\t\t\tthis.stopMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCWeekDayScheduleGetOptions =\n\tScheduleEntryLockSlotId;\n\n@CCCommand(ScheduleEntryLockCommand.WeekDayScheduleGet)\n@expectedCCResponse(ScheduleEntryLockCCWeekDayScheduleReport)\nexport class ScheduleEntryLockCCWeekDayScheduleGet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCWeekDayScheduleGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCWeekDayScheduleGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n/** @publicAPI */\nexport type ScheduleEntryLockCCYearDayScheduleSetOptions =\n\t& ScheduleEntryLockSlotId\n\t& (\n\t\t| {\n\t\t\taction: ScheduleEntryLockSetAction.Erase;\n\t\t}\n\t\t| ({\n\t\t\taction: ScheduleEntryLockSetAction.Set;\n\t\t} & ScheduleEntryLockYearDaySchedule)\n\t);\n\n@CCCommand(ScheduleEntryLockCommand.YearDayScheduleSet)\n@useSupervision()\nexport class ScheduleEntryLockCCYearDayScheduleSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCYearDayScheduleSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.action = options.action;\n\t\tif (options.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.startYear = options.startYear;\n\t\t\tthis.startMonth = options.startMonth;\n\t\t\tthis.startDay = options.startDay;\n\t\t\tthis.startHour = options.startHour;\n\t\t\tthis.startMinute = options.startMinute;\n\t\t\tthis.stopYear = options.stopYear;\n\t\t\tthis.stopMonth = options.stopMonth;\n\t\t\tthis.stopDay = options.stopDay;\n\t\t\tthis.stopHour = options.stopHour;\n\t\t\tthis.stopMinute = options.stopMinute;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCYearDayScheduleSet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst action: ScheduleEntryLockSetAction = raw.payload[0];\n\n\t\tvalidatePayload(\n\t\t\taction === ScheduleEntryLockSetAction.Set\n\t\t\t\t|| action === ScheduleEntryLockSetAction.Erase,\n\t\t);\n\t\tconst userId = raw.payload[1];\n\t\tconst slotId = raw.payload[2];\n\n\t\tif (action !== ScheduleEntryLockSetAction.Set) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\taction,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 13);\n\t\tconst startYear = raw.payload[3];\n\t\tconst startMonth = raw.payload[4];\n\t\tconst startDay = raw.payload[5];\n\t\tconst startHour = raw.payload[6];\n\t\tconst startMinute = raw.payload[7];\n\t\tconst stopYear = raw.payload[8];\n\t\tconst stopMonth = raw.payload[9];\n\t\tconst stopDay = raw.payload[10];\n\t\tconst stopHour = raw.payload[11];\n\t\tconst stopMinute = raw.payload[12];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\taction,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t\tstartYear,\n\t\t\tstartMonth,\n\t\t\tstartDay,\n\t\t\tstartHour,\n\t\t\tstartMinute,\n\t\t\tstopYear,\n\t\t\tstopMonth,\n\t\t\tstopDay,\n\t\t\tstopHour,\n\t\t\tstopMinute,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic action: ScheduleEntryLockSetAction;\n\n\tpublic startYear?: number;\n\tpublic startMonth?: number;\n\tpublic startDay?: number;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopYear?: number;\n\tpublic stopMonth?: number;\n\tpublic stopDay?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.action,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\t// The report should have these fields set to 0xff\n\t\t\t// if the slot is erased. The specs don't mention anything\n\t\t\t// for the Set command, so we just assume the same is okay\n\t\t\tthis.startYear ?? 0xff,\n\t\t\tthis.startMonth ?? 0xff,\n\t\t\tthis.startDay ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopYear ?? 0xff,\n\t\t\tthis.stopMonth ?? 0xff,\n\t\t\tthis.stopDay ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.action === ScheduleEntryLockSetAction.Erase) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"erase\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\t\"start date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.startYear ?? 0,\n\t\t\t\t\t\tthis.startMonth ?? 0,\n\t\t\t\t\t\tthis.startDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.startHour ?? 0, this.startMinute ?? 0)}`,\n\t\t\t\t\"end date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.stopYear ?? 0,\n\t\t\t\t\t\tthis.stopMonth ?? 0,\n\t\t\t\t\t\tthis.stopDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.stopHour ?? 0, this.stopMinute ?? 0)}`,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCYearDayScheduleReportOptions =\n\t& ScheduleEntryLockSlotId\n\t& AllOrNone<ScheduleEntryLockYearDaySchedule>;\n\n@CCCommand(ScheduleEntryLockCommand.YearDayScheduleReport)\nexport class ScheduleEntryLockCCYearDayScheduleReport\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCYearDayScheduleReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.startYear = options.startYear;\n\t\tthis.startMonth = options.startMonth;\n\t\tthis.startDay = options.startDay;\n\t\tthis.startHour = options.startHour;\n\t\tthis.startMinute = options.startMinute;\n\t\tthis.stopYear = options.stopYear;\n\t\tthis.stopMonth = options.stopMonth;\n\t\tthis.stopDay = options.stopDay;\n\t\tthis.stopHour = options.stopHour;\n\t\tthis.stopMinute = options.stopMinute;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCYearDayScheduleReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\tlet ccOptions: ScheduleEntryLockCCYearDayScheduleReportOptions = {\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t};\n\n\t\tlet startYear: number | undefined;\n\t\tlet startMonth: number | undefined;\n\t\tlet startDay: number | undefined;\n\t\tlet startHour: number | undefined;\n\t\tlet startMinute: number | undefined;\n\t\tlet stopYear: number | undefined;\n\t\tlet stopMonth: number | undefined;\n\t\tlet stopDay: number | undefined;\n\t\tlet stopHour: number | undefined;\n\t\tlet stopMinute: number | undefined;\n\n\t\tif (raw.payload.length >= 12) {\n\t\t\tif (raw.payload[2] !== 0xff) {\n\t\t\t\tstartYear = raw.payload[2];\n\t\t\t}\n\t\t\tif (raw.payload[3] !== 0xff) {\n\t\t\t\tstartMonth = raw.payload[3];\n\t\t\t}\n\t\t\tif (raw.payload[4] !== 0xff) {\n\t\t\t\tstartDay = raw.payload[4];\n\t\t\t}\n\t\t\tif (raw.payload[5] !== 0xff) {\n\t\t\t\tstartHour = raw.payload[5];\n\t\t\t}\n\t\t\tif (raw.payload[6] !== 0xff) {\n\t\t\t\tstartMinute = raw.payload[6];\n\t\t\t}\n\t\t\tif (raw.payload[7] !== 0xff) {\n\t\t\t\tstopYear = raw.payload[7];\n\t\t\t}\n\t\t\tif (raw.payload[8] !== 0xff) {\n\t\t\t\tstopMonth = raw.payload[8];\n\t\t\t}\n\t\t\tif (raw.payload[9] !== 0xff) {\n\t\t\t\tstopDay = raw.payload[9];\n\t\t\t}\n\t\t\tif (raw.payload[10] !== 0xff) {\n\t\t\t\tstopHour = raw.payload[10];\n\t\t\t}\n\t\t\tif (raw.payload[11] !== 0xff) {\n\t\t\t\tstopMinute = raw.payload[11];\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tstartYear != undefined\n\t\t\t&& startMonth != undefined\n\t\t\t&& startDay != undefined\n\t\t\t&& startHour != undefined\n\t\t\t&& startMinute != undefined\n\t\t\t&& stopYear != undefined\n\t\t\t&& stopMonth != undefined\n\t\t\t&& stopDay != undefined\n\t\t\t&& stopHour != undefined\n\t\t\t&& stopMinute != undefined\n\t\t) {\n\t\t\tccOptions = {\n\t\t\t\t...ccOptions,\n\t\t\t\tstartYear,\n\t\t\t\tstartMonth,\n\t\t\t\tstartDay,\n\t\t\t\tstartHour,\n\t\t\t\tstartMinute,\n\t\t\t\tstopYear,\n\t\t\t\tstopMonth,\n\t\t\t\tstopDay,\n\t\t\t\tstopHour,\n\t\t\t\tstopMinute,\n\t\t\t};\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t...ccOptions,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\tpublic startYear?: number;\n\tpublic startMonth?: number;\n\tpublic startDay?: number;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopYear?: number;\n\tpublic stopMonth?: number;\n\tpublic stopDay?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tpersistSchedule.call(\n\t\t\tthis,\n\t\t\tctx,\n\t\t\tScheduleEntryLockScheduleKind.YearDay,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.startYear != undefined\n\t\t\t\t? {\n\t\t\t\t\tstartYear: this.startYear,\n\t\t\t\t\tstartMonth: this.startMonth!,\n\t\t\t\t\tstartDay: this.startDay!,\n\t\t\t\t\tstartHour: this.startHour!,\n\t\t\t\t\tstartMinute: this.startMinute!,\n\t\t\t\t\tstopYear: this.stopYear!,\n\t\t\t\t\tstopMonth: this.stopMonth!,\n\t\t\t\t\tstopDay: this.stopDay!,\n\t\t\t\t\tstopHour: this.stopHour!,\n\t\t\t\t\tstopMinute: this.stopMinute!,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.startYear ?? 0xff,\n\t\t\tthis.startMonth ?? 0xff,\n\t\t\tthis.startDay ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopYear ?? 0xff,\n\t\t\tthis.stopMonth ?? 0xff,\n\t\t\tthis.stopDay ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.startYear !== undefined) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tschedule: \"(empty)\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\t\"start date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.startYear ?? 0,\n\t\t\t\t\t\tthis.startMonth ?? 0,\n\t\t\t\t\t\tthis.startDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.startHour ?? 0, this.startMinute ?? 0)}`,\n\t\t\t\t\"end date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.stopYear ?? 0,\n\t\t\t\t\t\tthis.stopMonth ?? 0,\n\t\t\t\t\t\tthis.stopDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.stopHour ?? 0, this.stopMinute ?? 0)}`,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCYearDayScheduleGetOptions =\n\tScheduleEntryLockSlotId;\n\n@CCCommand(ScheduleEntryLockCommand.YearDayScheduleGet)\n@expectedCCResponse(ScheduleEntryLockCCYearDayScheduleReport)\nexport class ScheduleEntryLockCCYearDayScheduleGet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCYearDayScheduleGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCYearDayScheduleGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCTimeOffsetSetOptions {\n\tstandardOffset: number;\n\tdstOffset: number;\n}\n\n@CCCommand(ScheduleEntryLockCommand.TimeOffsetSet)\n@useSupervision()\nexport class ScheduleEntryLockCCTimeOffsetSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCTimeOffsetSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.standardOffset = options.standardOffset;\n\t\tthis.dstOffset = options.dstOffset;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCTimeOffsetSet {\n\t\tconst { standardOffset, dstOffset } = parseTimezone(raw.payload);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tstandardOffset,\n\t\t\tdstOffset,\n\t\t});\n\t}\n\n\tpublic standardOffset: number;\n\tpublic dstOffset: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = encodeTimezone({\n\t\t\tstandardOffset: this.standardOffset,\n\t\t\tdstOffset: this.dstOffset,\n\t\t});\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"standard time offset\": `${this.standardOffset} minutes`,\n\t\t\t\t\"DST offset\": `${this.dstOffset} minutes`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCTimeOffsetReportOptions {\n\tstandardOffset: number;\n\tdstOffset: number;\n}\n\n@CCCommand(ScheduleEntryLockCommand.TimeOffsetReport)\nexport class ScheduleEntryLockCCTimeOffsetReport extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCTimeOffsetReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.standardOffset = options.standardOffset;\n\t\tthis.dstOffset = options.dstOffset;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCTimeOffsetReport {\n\t\tconst { standardOffset, dstOffset } = parseTimezone(raw.payload);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tstandardOffset,\n\t\t\tdstOffset,\n\t\t});\n\t}\n\n\tpublic standardOffset: number;\n\tpublic dstOffset: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = encodeTimezone({\n\t\t\tstandardOffset: this.standardOffset,\n\t\t\tdstOffset: this.dstOffset,\n\t\t});\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"standard time offset\": `${this.standardOffset} minutes`,\n\t\t\t\t\"DST offset\": `${this.dstOffset} minutes`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ScheduleEntryLockCommand.TimeOffsetGet)\n@expectedCCResponse(ScheduleEntryLockCCTimeOffsetReport)\nexport class ScheduleEntryLockCCTimeOffsetGet extends ScheduleEntryLockCC {}\n\n/** @publicAPI */\nexport type ScheduleEntryLockCCDailyRepeatingScheduleSetOptions =\n\t& ScheduleEntryLockSlotId\n\t& (\n\t\t| {\n\t\t\taction: ScheduleEntryLockSetAction.Erase;\n\t\t}\n\t\t| ({\n\t\t\taction: ScheduleEntryLockSetAction.Set;\n\t\t} & ScheduleEntryLockDailyRepeatingSchedule)\n\t);\n\n@CCCommand(ScheduleEntryLockCommand.DailyRepeatingScheduleSet)\n@useSupervision()\nexport class ScheduleEntryLockCCDailyRepeatingScheduleSet\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleSetOptions\n\t\t>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.action = options.action;\n\t\tif (options.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.weekdays = options.weekdays;\n\t\t\tthis.startHour = options.startHour;\n\t\t\tthis.startMinute = options.startMinute;\n\t\t\tthis.durationHour = options.durationHour;\n\t\t\tthis.durationMinute = options.durationMinute;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCDailyRepeatingScheduleSet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst action: ScheduleEntryLockSetAction = raw.payload[0];\n\n\t\tvalidatePayload(\n\t\t\taction === ScheduleEntryLockSetAction.Set\n\t\t\t\t|| action === ScheduleEntryLockSetAction.Erase,\n\t\t);\n\t\tconst userId = raw.payload[1];\n\t\tconst slotId = raw.payload[2];\n\n\t\tif (action !== ScheduleEntryLockSetAction.Set) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\taction,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 8);\n\t\tconst weekdays: ScheduleEntryLockWeekday[] = parseBitMask(\n\t\t\traw.payload.subarray(3, 4),\n\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t);\n\t\tconst startHour = raw.payload[4];\n\t\tconst startMinute = raw.payload[5];\n\t\tconst durationHour = raw.payload[6];\n\t\tconst durationMinute = raw.payload[7];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\taction,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t\tweekdays,\n\t\t\tstartHour,\n\t\t\tstartMinute,\n\t\t\tdurationHour,\n\t\t\tdurationMinute,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic action: ScheduleEntryLockSetAction;\n\n\tpublic weekdays?: ScheduleEntryLockWeekday[];\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic durationHour?: number;\n\tpublic durationMinute?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.action, this.userId, this.slotId]);\n\t\tif (this.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tencodeBitMask(\n\t\t\t\t\tthis.weekdays!,\n\t\t\t\t\tScheduleEntryLockWeekday.Saturday,\n\t\t\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t\t\t),\n\t\t\t\tBytes.from([\n\t\t\t\t\tthis.startHour!,\n\t\t\t\t\tthis.startMinute!,\n\t\t\t\t\tthis.durationHour!,\n\t\t\t\t\tthis.durationMinute!,\n\t\t\t\t]),\n\t\t\t]);\n\t\t} else {\n\t\t\t// Not sure if this is correct\n\t\t\tthis.payload = Bytes.concat([this.payload, Bytes.alloc(5, 0xff)]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.action === ScheduleEntryLockSetAction.Erase) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"erase\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\tweekdays: this.weekdays!.map((w) =>\n\t\t\t\t\tgetEnumMemberName(ScheduleEntryLockWeekday, w)\n\t\t\t\t).join(\", \"),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\tduration: formatTime(\n\t\t\t\t\tthis.durationHour ?? 0,\n\t\t\t\t\tthis.durationMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCDailyRepeatingScheduleReportOptions =\n\t& ScheduleEntryLockSlotId\n\t& AllOrNone<ScheduleEntryLockDailyRepeatingSchedule>;\n\n@CCCommand(ScheduleEntryLockCommand.DailyRepeatingScheduleReport)\nexport class ScheduleEntryLockCCDailyRepeatingScheduleReport\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleReportOptions\n\t\t>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.weekdays = options.weekdays;\n\t\tthis.startHour = options.startHour;\n\t\tthis.startMinute = options.startMinute;\n\t\tthis.durationHour = options.durationHour;\n\t\tthis.durationMinute = options.durationMinute;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCDailyRepeatingScheduleReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\tif (raw.payload.length >= 7 && raw.payload[2] !== 0) {\n\t\t\t// Only parse the schedule if it is present and some weekday is selected\n\t\t\tconst weekdays: ScheduleEntryLockWeekday[] = parseBitMask(\n\t\t\t\traw.payload.subarray(2, 3),\n\t\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t\t);\n\t\t\tconst startHour = raw.payload[3];\n\t\t\tconst startMinute = raw.payload[4];\n\t\t\tconst durationHour = raw.payload[5];\n\t\t\tconst durationMinute = raw.payload[6];\n\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t\tweekdays,\n\t\t\t\tstartHour,\n\t\t\t\tstartMinute,\n\t\t\t\tdurationHour,\n\t\t\t\tdurationMinute,\n\t\t\t});\n\t\t} else {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic weekdays?: ScheduleEntryLockWeekday[];\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic durationHour?: number;\n\tpublic durationMinute?: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tpersistSchedule.call(\n\t\t\tthis,\n\t\t\tctx,\n\t\t\tScheduleEntryLockScheduleKind.DailyRepeating,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.weekdays?.length\n\t\t\t\t? {\n\t\t\t\t\tweekdays: this.weekdays,\n\t\t\t\t\tstartHour: this.startHour!,\n\t\t\t\t\tstartMinute: this.startMinute!,\n\t\t\t\t\tdurationHour: this.durationHour!,\n\t\t\t\t\tdurationMinute: this.durationMinute!,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\tif (this.weekdays) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tencodeBitMask(\n\t\t\t\t\tthis.weekdays,\n\t\t\t\t\tScheduleEntryLockWeekday.Saturday,\n\t\t\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t\t\t),\n\t\t\t\tBytes.from([\n\t\t\t\t\tthis.startHour!,\n\t\t\t\t\tthis.startMinute!,\n\t\t\t\t\tthis.durationHour!,\n\t\t\t\t\tthis.durationMinute!,\n\t\t\t\t]),\n\t\t\t]);\n\t\t} else {\n\t\t\t// Not sure if this is correct, but at least we won't parse it incorrectly ourselves when setting everything to 0\n\t\t\tthis.payload = Bytes.concat([this.payload, Bytes.alloc(5, 0)]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (!this.weekdays) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tschedule: \"(empty)\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\tweekdays: this.weekdays\n\t\t\t\t\t.map((w) => getEnumMemberName(ScheduleEntryLockWeekday, w))\n\t\t\t\t\t.join(\", \"),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\tduration: formatTime(\n\t\t\t\t\tthis.durationHour ?? 0,\n\t\t\t\t\tthis.durationMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCDailyRepeatingScheduleGetOptions =\n\tScheduleEntryLockSlotId;\n\n@CCCommand(ScheduleEntryLockCommand.DailyRepeatingScheduleGet)\n@expectedCCResponse(ScheduleEntryLockCCDailyRepeatingScheduleReport)\nexport class ScheduleEntryLockCCDailyRepeatingScheduleGet\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleGetOptions\n\t\t>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCDailyRepeatingScheduleGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
4
|
+
"sourcesContent": ["import type { CCEncodingContext, CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype EndpointId,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tencodeBitMask,\n\tgetDSTInfo,\n\tisUnsupervisedOrSucceeded,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core\";\nimport {\n\ttype AllOrNone,\n\tBytes,\n\tformatDate,\n\tformatTime,\n\tgetEnumMemberName,\n\tpick,\n} from \"@zwave-js/shared\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype PersistValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tccValueProperty,\n\tccValues,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport {\n\tScheduleEntryLockCommand,\n\ttype ScheduleEntryLockDailyRepeatingSchedule,\n\tScheduleEntryLockScheduleKind,\n\tScheduleEntryLockSetAction,\n\ttype ScheduleEntryLockSlotId,\n\ttype ScheduleEntryLockWeekDaySchedule,\n\tScheduleEntryLockWeekday,\n\ttype ScheduleEntryLockYearDaySchedule,\n\ttype Timezone,\n} from \"../lib/_Types.js\";\nimport { encodeTimezone, parseTimezone } from \"../lib/serializers.js\";\nimport { UserCodeCC } from \"./UserCodeCC.js\";\n\nexport const ScheduleEntryLockCCValues = V.defineCCValues(\n\tCommandClasses[\"Schedule Entry Lock\"],\n\t{\n\t\t...V.staticProperty(\"numWeekDaySlots\", undefined, { internal: true }),\n\t\t...V.staticProperty(\"numYearDaySlots\", undefined, { internal: true }),\n\t\t...V.staticProperty(\"numDailyRepeatingSlots\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"userEnabled\",\n\t\t\t\"userEnabled\",\n\t\t\t(userId: number) => userId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"userEnabled\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"scheduleKind\",\n\t\t\t\"scheduleKind\",\n\t\t\t(userId: number) => userId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"scheduleKind\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"schedule\",\n\t\t\t\"schedule\",\n\t\t\t(\n\t\t\t\tscheduleKind: ScheduleEntryLockScheduleKind,\n\t\t\t\tuserId: number,\n\t\t\t\tslotId: number,\n\t\t\t) => (scheduleKind << 16) | (userId << 8) | slotId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"schedule\" && typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true },\n\t\t),\n\t},\n);\n\n/** Caches information about a schedule */\nfunction persistSchedule(\n\tthis: ScheduleEntryLockCC,\n\tctx: GetValueDB,\n\tscheduleKind: ScheduleEntryLockScheduleKind,\n\tuserId: number,\n\tslotId: number,\n\tschedule:\n\t\t| ScheduleEntryLockWeekDaySchedule\n\t\t| ScheduleEntryLockYearDaySchedule\n\t\t| ScheduleEntryLockDailyRepeatingSchedule\n\t\t| false\n\t\t| undefined,\n): void {\n\tconst scheduleValue = ScheduleEntryLockCCValues.schedule(\n\t\tscheduleKind,\n\t\tuserId,\n\t\tslotId,\n\t);\n\n\tif (schedule != undefined) {\n\t\tthis.setValue(ctx, scheduleValue, schedule);\n\t} else {\n\t\tthis.removeValue(ctx, scheduleValue);\n\t}\n}\n\n/** Updates the schedule kind assumed to be active for user in the cache */\nfunction setUserCodeScheduleKindCached(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n\tuserId: number,\n\tscheduleKind: ScheduleEntryLockScheduleKind,\n): void {\n\tctx\n\t\t.getValueDB(endpoint.nodeId)\n\t\t.setValue(\n\t\t\tScheduleEntryLockCCValues.scheduleKind(userId).endpoint(\n\t\t\t\tendpoint.index,\n\t\t\t),\n\t\t\tscheduleKind,\n\t\t);\n}\n\n/** Updates whether scheduling is active for one or all user(s) in the cache */\nfunction setUserCodeScheduleEnabledCached(\n\tctx: GetValueDB,\n\tendpoint: EndpointId,\n\tuserId: number | undefined,\n\tenabled: boolean,\n): void {\n\tconst setEnabled = (userId: number) => {\n\t\tctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.setValue(\n\t\t\t\tScheduleEntryLockCCValues.userEnabled(userId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t\tenabled,\n\t\t\t);\n\t};\n\n\tif (userId == undefined) {\n\t\t// Enable/disable all users\n\t\tconst numUsers = UserCodeCC.getSupportedUsersCached(ctx, endpoint)\n\t\t\t?? 0;\n\n\t\tfor (let userId = 1; userId <= numUsers; userId++) {\n\t\t\tsetEnabled(userId);\n\t\t}\n\t} else {\n\t\tsetEnabled(userId);\n\t}\n}\n\n@API(CommandClasses[\"Schedule Entry Lock\"])\nexport class ScheduleEntryLockCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ScheduleEntryLockCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ScheduleEntryLockCommand.EnableSet:\n\t\t\tcase ScheduleEntryLockCommand.EnableAllSet:\n\t\t\tcase ScheduleEntryLockCommand.WeekDayScheduleSet:\n\t\t\tcase ScheduleEntryLockCommand.WeekDayScheduleGet:\n\t\t\tcase ScheduleEntryLockCommand.YearDayScheduleSet:\n\t\t\tcase ScheduleEntryLockCommand.YearDayScheduleGet:\n\t\t\tcase ScheduleEntryLockCommand.SupportedGet:\n\t\t\t\treturn true; // V1\n\n\t\t\tcase ScheduleEntryLockCommand.TimeOffsetSet:\n\t\t\tcase ScheduleEntryLockCommand.TimeOffsetGet:\n\t\t\t\treturn this.version >= 2;\n\n\t\t\tcase ScheduleEntryLockCommand.DailyRepeatingScheduleSet:\n\t\t\tcase ScheduleEntryLockCommand.DailyRepeatingScheduleGet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t/**\n\t * Enables or disables schedules. If a user ID is given, that user's\n\t * schedules will be enabled or disabled. If no user ID is given, all schedules\n\t * will be affected.\n\t */\n\t@validateArgs()\n\tpublic async setEnabled(\n\t\tenabled: boolean,\n\t\tuserId?: number,\n\t): Promise<SupervisionResult | undefined> {\n\t\tlet result: SupervisionResult | undefined;\n\t\tif (userId != undefined) {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tScheduleEntryLockCommand,\n\t\t\t\tScheduleEntryLockCommand.EnableSet,\n\t\t\t);\n\n\t\t\tconst cc = new ScheduleEntryLockCCEnableSet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tuserId,\n\t\t\t\tenabled,\n\t\t\t});\n\n\t\t\tresult = await this.host.sendCommand(cc, this.commandOptions);\n\t\t} else {\n\t\t\tthis.assertSupportsCommand(\n\t\t\t\tScheduleEntryLockCommand,\n\t\t\t\tScheduleEntryLockCommand.EnableAllSet,\n\t\t\t);\n\n\t\t\tconst cc = new ScheduleEntryLockCCEnableAllSet({\n\t\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t\tenabled,\n\t\t\t});\n\n\t\t\tresult = await this.host.sendCommand(cc, this.commandOptions);\n\t\t}\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Remember the new state in the cache\n\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t\tuserId,\n\t\t\t\tenabled,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t// oxlint-disable-next-line typescript/explicit-module-boundary-types\n\tpublic async getNumSlots() {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result) {\n\t\t\treturn pick(result, [\n\t\t\t\t\"numWeekDaySlots\",\n\t\t\t\t\"numYearDaySlots\",\n\t\t\t\t\"numDailyRepeatingSlots\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setWeekDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t\tschedule?: ScheduleEntryLockWeekDaySchedule,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.WeekDayScheduleSet,\n\t\t);\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst numSlots = ScheduleEntryLockCC.getNumWeekDaySlotsCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t);\n\n\t\t\tif (slot.slotId < 1 || slot.slotId > numSlots) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The schedule slot # must be between 1 and the number of supported day-of-week slots ${numSlots}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (schedule) {\n\t\t\tif (\n\t\t\t\tschedule.stopHour < schedule.startHour\n\t\t\t\t|| schedule.stopHour === schedule.startHour\n\t\t\t\t\t&& schedule.stopMinute <= schedule.startMinute\n\t\t\t) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The stop time must be after the start time.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new ScheduleEntryLockCCWeekDayScheduleSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t\t...(schedule\n\t\t\t\t? {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Set,\n\t\t\t\t\t...schedule,\n\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Erase,\n\t\t\t\t}),\n\t\t});\n\n\t\tconst result = await this.host.sendCommand(cc, this.commandOptions);\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Editing (but not erasing) a schedule will enable scheduling for that user\n\t\t\t// and switch it to the current scheduling kind\n\t\t\tif (!!schedule) {\n\t\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tsetUserCodeScheduleKindCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\tScheduleEntryLockScheduleKind.WeekDay,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// And cache the schedule\n\t\t\tpersistSchedule.call(\n\t\t\t\tcc,\n\t\t\t\tthis.host,\n\t\t\t\tScheduleEntryLockScheduleKind.WeekDay,\n\t\t\t\tslot.userId,\n\t\t\t\tslot.slotId,\n\t\t\t\tschedule ?? false,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@validateArgs()\n\tpublic async getWeekDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t): Promise<MaybeNotKnown<ScheduleEntryLockWeekDaySchedule>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.WeekDayScheduleSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCWeekDayScheduleGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCWeekDayScheduleReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result?.weekday != undefined) {\n\t\t\treturn {\n\t\t\t\tweekday: result.weekday,\n\t\t\t\tstartHour: result.startHour!,\n\t\t\t\tstartMinute: result.startMinute!,\n\t\t\t\tstopHour: result.stopHour!,\n\t\t\t\tstopMinute: result.stopMinute!,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setYearDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t\tschedule?: ScheduleEntryLockYearDaySchedule,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.YearDayScheduleSet,\n\t\t);\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst numSlots = ScheduleEntryLockCC.getNumYearDaySlotsCached(\n\t\t\t\tthis.host,\n\t\t\t\tthis.endpoint,\n\t\t\t);\n\n\t\t\tif (slot.slotId < 1 || slot.slotId > numSlots) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The schedule slot # must be between 1 and the number of supported day-of-year slots ${numSlots}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tif (schedule) {\n\t\t\tconst startDate = new Date(\n\t\t\t\tschedule.startYear,\n\t\t\t\tschedule.startMonth - 1,\n\t\t\t\tschedule.startDay,\n\t\t\t\tschedule.startHour,\n\t\t\t\tschedule.startMinute,\n\t\t\t);\n\t\t\tconst stopDate = new Date(\n\t\t\t\tschedule.stopYear,\n\t\t\t\tschedule.stopMonth - 1,\n\t\t\t\tschedule.stopDay,\n\t\t\t\tschedule.stopHour,\n\t\t\t\tschedule.stopMinute,\n\t\t\t);\n\t\t\tif (stopDate <= startDate) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The stop date must be after the start date.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new ScheduleEntryLockCCYearDayScheduleSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t\t...(schedule\n\t\t\t\t? {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Set,\n\t\t\t\t\t...schedule,\n\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Erase,\n\t\t\t\t}),\n\t\t});\n\n\t\tconst result = await this.host.sendCommand(cc, this.commandOptions);\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Editing (but not erasing) a schedule will enable scheduling for that user\n\t\t\t// and switch it to the current scheduling kind\n\t\t\tif (!!schedule) {\n\t\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tsetUserCodeScheduleKindCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\tScheduleEntryLockScheduleKind.YearDay,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// And cache the schedule\n\t\t\tpersistSchedule.call(\n\t\t\t\tcc,\n\t\t\t\tthis.host,\n\t\t\t\tScheduleEntryLockScheduleKind.YearDay,\n\t\t\t\tslot.userId,\n\t\t\t\tslot.slotId,\n\t\t\t\tschedule ?? false,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@validateArgs()\n\tpublic async getYearDaySchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t): Promise<MaybeNotKnown<ScheduleEntryLockYearDaySchedule>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.YearDayScheduleSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCYearDayScheduleGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCYearDayScheduleReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result?.startYear != undefined) {\n\t\t\treturn {\n\t\t\t\tstartYear: result.startYear,\n\t\t\t\tstartMonth: result.startMonth!,\n\t\t\t\tstartDay: result.startDay!,\n\t\t\t\tstartHour: result.startHour!,\n\t\t\t\tstartMinute: result.startMinute!,\n\t\t\t\tstopYear: result.stopYear!,\n\t\t\t\tstopMonth: result.stopMonth!,\n\t\t\t\tstopDay: result.stopDay!,\n\t\t\t\tstopHour: result.stopHour!,\n\t\t\t\tstopMinute: result.stopMinute!,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setDailyRepeatingSchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t\tschedule?: ScheduleEntryLockDailyRepeatingSchedule,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.DailyRepeatingScheduleSet,\n\t\t);\n\n\t\tif (this.isSinglecast()) {\n\t\t\tconst numSlots = ScheduleEntryLockCC\n\t\t\t\t.getNumDailyRepeatingSlotsCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t);\n\n\t\t\tif (slot.slotId < 1 || slot.slotId > numSlots) {\n\t\t\t\tthrow new ZWaveError(\n\t\t\t\t\t`The schedule slot # must be between 1 and the number of supported daily repeating slots ${numSlots}.`,\n\t\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cc = new ScheduleEntryLockCCDailyRepeatingScheduleSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t\t...(schedule\n\t\t\t\t? {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Set,\n\t\t\t\t\t...schedule,\n\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\taction: ScheduleEntryLockSetAction.Erase,\n\t\t\t\t}),\n\t\t});\n\n\t\tconst result = await this.host.sendCommand(cc, this.commandOptions);\n\n\t\tif (this.isSinglecast() && isUnsupervisedOrSucceeded(result)) {\n\t\t\t// Editing (but not erasing) a schedule will enable scheduling for that user\n\t\t\t// and switch it to the current scheduling kind\n\t\t\tif (!!schedule) {\n\t\t\t\tsetUserCodeScheduleEnabledCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\ttrue,\n\t\t\t\t);\n\t\t\t\tsetUserCodeScheduleKindCached(\n\t\t\t\t\tthis.host,\n\t\t\t\t\tthis.endpoint,\n\t\t\t\t\tslot.userId,\n\t\t\t\t\tScheduleEntryLockScheduleKind.DailyRepeating,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// And cache the schedule\n\t\t\tpersistSchedule.call(\n\t\t\t\tcc,\n\t\t\t\tthis.host,\n\t\t\t\tScheduleEntryLockScheduleKind.DailyRepeating,\n\t\t\t\tslot.userId,\n\t\t\t\tslot.slotId,\n\t\t\t\tschedule ?? false,\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t@validateArgs()\n\tpublic async getDailyRepeatingSchedule(\n\t\tslot: ScheduleEntryLockSlotId,\n\t): Promise<MaybeNotKnown<ScheduleEntryLockDailyRepeatingSchedule>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.DailyRepeatingScheduleSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCDailyRepeatingScheduleGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...slot,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result?.weekdays != undefined) {\n\t\t\treturn {\n\t\t\t\tweekdays: result.weekdays,\n\t\t\t\tstartHour: result.startHour!,\n\t\t\t\tstartMinute: result.startMinute!,\n\t\t\t\tdurationHour: result.durationHour!,\n\t\t\t\tdurationMinute: result.durationMinute!,\n\t\t\t};\n\t\t}\n\t}\n\n\tpublic async getTimezone(): Promise<MaybeNotKnown<Timezone>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.TimeOffsetGet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCTimeOffsetGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst result = await this.host.sendCommand<\n\t\t\tScheduleEntryLockCCTimeOffsetReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\n\t\tif (result) {\n\t\t\treturn pick(result, [\"standardOffset\", \"dstOffset\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setTimezone(\n\t\ttimezone: Timezone,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tScheduleEntryLockCommand,\n\t\t\tScheduleEntryLockCommand.TimeOffsetSet,\n\t\t);\n\n\t\tconst cc = new ScheduleEntryLockCCTimeOffsetSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...timezone,\n\t\t});\n\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Schedule Entry Lock\"])\n@implementedVersion(3)\n@ccValues(ScheduleEntryLockCCValues)\nexport class ScheduleEntryLockCC extends CommandClass {\n\tdeclare ccCommand: ScheduleEntryLockCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\n\t\tconst endpoint = this.getEndpoint(ctx)!;\n\t\tconst api = CCAPI.create(\n\t\t\tCommandClasses[\"Schedule Entry Lock\"],\n\t\t\tctx,\n\t\t\tendpoint,\n\t\t).withOptions({\n\t\t\tpriority: MessagePriority.NodeQuery,\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: `Interviewing ${this.ccName}...`,\n\t\t\tdirection: \"none\",\n\t\t});\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying supported number of schedule slots...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst slotsResp = await api.getNumSlots();\n\t\tif (slotsResp) {\n\t\t\tlet logMessage = `received supported number of schedule slots:\nday of week: ${slotsResp.numWeekDaySlots}\nday of year: ${slotsResp.numYearDaySlots}`;\n\t\t\tif (slotsResp.numDailyRepeatingSlots != undefined) {\n\t\t\t\tlogMessage += `\ndaily repeating: ${slotsResp.numDailyRepeatingSlots}`;\n\t\t\t}\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\n\t\t// If the timezone is not configured with the Time CC, do it here\n\t\tif (\n\t\t\tapi.supportsCommand(ScheduleEntryLockCommand.TimeOffsetSet)\n\t\t\t&& (!endpoint.supportsCC(CommandClasses.Time)\n\t\t\t\t|| endpoint.getCCVersion(CommandClasses.Time) < 2)\n\t\t) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"setting timezone information...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\t// Set the correct timezone on this node\n\t\t\tconst timezone = getDSTInfo();\n\t\t\tawait api.setTimezone(timezone);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\t/**\n\t * Returns the number of supported day-of-week slots.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getNumWeekDaySlotsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.numWeekDaySlots.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of supported day-of-year slots.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getNumYearDaySlotsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.numYearDaySlots.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns the number of supported daily-repeating slots.\n\t * This only works AFTER the interview process\n\t */\n\tpublic static getNumDailyRepeatingSlotsCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t): number {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.numDailyRepeatingSlots.endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t) || 0;\n\t}\n\n\t/**\n\t * Returns whether scheduling for a given user ID (most likely) enabled. Since the Schedule Entry Lock CC\n\t * provides no way to query the enabled state, Z-Wave JS tracks this in its own cache.\n\t *\n\t * This only works AFTER the interview process and is likely to be wrong if a device\n\t * with existing schedules is queried. To be sure, disable scheduling for all users and enable\n\t * only the desired ones.\n\t */\n\tpublic static getUserCodeScheduleEnabledCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tuserId: number,\n\t): boolean {\n\t\treturn !!ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.userEnabled(userId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\t/**\n\t * Returns which scheduling kind is (most likely) enabled for a given user ID . Since the Schedule Entry Lock CC\n\t * provides no way to query the current state, Z-Wave JS tracks this in its own cache.\n\t *\n\t * This only works AFTER the interview process and is likely to be wrong if a device\n\t * with existing schedules is queried. To be sure, edit a schedule of the desired kind\n\t * which will automatically switch the user to that scheduling kind.\n\t */\n\tpublic static getUserCodeScheduleKindCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tuserId: number,\n\t): MaybeNotKnown<ScheduleEntryLockScheduleKind> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue<ScheduleEntryLockScheduleKind>(\n\t\t\t\tScheduleEntryLockCCValues.scheduleKind(userId).endpoint(\n\t\t\t\t\tendpoint.index,\n\t\t\t\t),\n\t\t\t);\n\t}\n\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind.WeekDay,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<ScheduleEntryLockWeekDaySchedule | false>;\n\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind.YearDay,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<ScheduleEntryLockYearDaySchedule | false>;\n\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind.DailyRepeating,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<ScheduleEntryLockDailyRepeatingSchedule | false>;\n\n\t// Catch-all overload for applications which haven't narrowed `scheduleKind`\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<\n\t\t| ScheduleEntryLockWeekDaySchedule\n\t\t| ScheduleEntryLockYearDaySchedule\n\t\t| ScheduleEntryLockDailyRepeatingSchedule\n\t\t| false\n\t>;\n\n\t/**\n\t * Returns the assumed state of a schedule. Since the Schedule Entry Lock CC\n\t * provides no way to query the current state, Z-Wave JS tracks this in its own cache.\n\t *\n\t * A return value of `false` means the slot is empty, a return value of `undefined` means the information is not cached yet.\n\t *\n\t * This only works AFTER the interview process.\n\t */\n\tpublic static getScheduleCached(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tscheduleKind: ScheduleEntryLockScheduleKind,\n\t\tuserId: number,\n\t\tslotId: number,\n\t): MaybeNotKnown<\n\t\t| ScheduleEntryLockWeekDaySchedule\n\t\t| ScheduleEntryLockYearDaySchedule\n\t\t| ScheduleEntryLockDailyRepeatingSchedule\n\t\t| false\n\t> {\n\t\treturn ctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.getValue(\n\t\t\t\tScheduleEntryLockCCValues.schedule(\n\t\t\t\t\tscheduleKind,\n\t\t\t\t\tuserId,\n\t\t\t\t\tslotId,\n\t\t\t\t).endpoint(endpoint.index),\n\t\t\t);\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCEnableSetOptions {\n\tuserId: number;\n\tenabled: boolean;\n}\n\n@CCCommand(ScheduleEntryLockCommand.EnableSet)\n@useSupervision()\nexport class ScheduleEntryLockCCEnableSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCEnableSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.enabled = options.enabled;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCEnableSet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst enabled: boolean = raw.payload[1] === 0x01;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tenabled,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic enabled: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.enabled ? 0x01 : 0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\taction: this.enabled ? \"enable\" : \"disable\",\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCEnableAllSetOptions {\n\tenabled: boolean;\n}\n\n@CCCommand(ScheduleEntryLockCommand.EnableAllSet)\n@useSupervision()\nexport class ScheduleEntryLockCCEnableAllSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCEnableAllSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.enabled = options.enabled;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCEnableAllSet {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst enabled: boolean = raw.payload[0] === 0x01;\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tenabled,\n\t\t});\n\t}\n\n\tpublic enabled: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.enabled ? 0x01 : 0x00]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\taction: this.enabled ? \"enable all\" : \"disable all\",\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCSupportedReportOptions {\n\tnumWeekDaySlots: number;\n\tnumYearDaySlots: number;\n\tnumDailyRepeatingSlots?: number;\n}\n\n@CCCommand(ScheduleEntryLockCommand.SupportedReport)\n@ccValueProperty(\"numWeekDaySlots\", ScheduleEntryLockCCValues.numWeekDaySlots)\n@ccValueProperty(\"numYearDaySlots\", ScheduleEntryLockCCValues.numYearDaySlots)\n@ccValueProperty(\n\t\"numDailyRepeatingSlots\",\n\tScheduleEntryLockCCValues.numDailyRepeatingSlots,\n)\nexport class ScheduleEntryLockCCSupportedReport extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.numWeekDaySlots = options.numWeekDaySlots;\n\t\tthis.numYearDaySlots = options.numYearDaySlots;\n\t\tthis.numDailyRepeatingSlots = options.numDailyRepeatingSlots;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst numWeekDaySlots = raw.payload[0];\n\t\tconst numYearDaySlots = raw.payload[1];\n\t\tlet numDailyRepeatingSlots: number | undefined;\n\t\tif (raw.payload.length >= 3) {\n\t\t\tnumDailyRepeatingSlots = raw.payload[2];\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tnumWeekDaySlots,\n\t\t\tnumYearDaySlots,\n\t\t\tnumDailyRepeatingSlots,\n\t\t});\n\t}\n\n\tpublic numWeekDaySlots: number;\n\n\tpublic numYearDaySlots: number;\n\n\tpublic numDailyRepeatingSlots: number | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.numWeekDaySlots,\n\t\t\tthis.numYearDaySlots,\n\t\t\tthis.numDailyRepeatingSlots ?? 0,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"no. of weekday schedule slots\": this.numWeekDaySlots,\n\t\t\t\"no. of day-of-year schedule slots\": this.numYearDaySlots,\n\t\t};\n\t\tif (this.numDailyRepeatingSlots != undefined) {\n\t\t\tmessage[\"no. of daily repeating schedule slots\"] =\n\t\t\t\tthis.numDailyRepeatingSlots;\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n@CCCommand(ScheduleEntryLockCommand.SupportedGet)\n@expectedCCResponse(ScheduleEntryLockCCSupportedReport)\nexport class ScheduleEntryLockCCSupportedGet extends ScheduleEntryLockCC {}\n\n/** @publicAPI */\nexport type ScheduleEntryLockCCWeekDayScheduleSetOptions =\n\t& ScheduleEntryLockSlotId\n\t& (\n\t\t| {\n\t\t\taction: ScheduleEntryLockSetAction.Erase;\n\t\t}\n\t\t| ({\n\t\t\taction: ScheduleEntryLockSetAction.Set;\n\t\t} & ScheduleEntryLockWeekDaySchedule)\n\t);\n\n@CCCommand(ScheduleEntryLockCommand.WeekDayScheduleSet)\n@useSupervision()\nexport class ScheduleEntryLockCCWeekDayScheduleSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCWeekDayScheduleSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.action = options.action;\n\t\tif (options.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.weekday = options.weekday;\n\t\t\tthis.startHour = options.startHour;\n\t\t\tthis.startMinute = options.startMinute;\n\t\t\tthis.stopHour = options.stopHour;\n\t\t\tthis.stopMinute = options.stopMinute;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCWeekDayScheduleSet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst action: ScheduleEntryLockSetAction = raw.payload[0];\n\n\t\tvalidatePayload(\n\t\t\taction === ScheduleEntryLockSetAction.Set\n\t\t\t\t|| action === ScheduleEntryLockSetAction.Erase,\n\t\t);\n\t\tconst userId = raw.payload[1];\n\t\tconst slotId = raw.payload[2];\n\n\t\tif (action !== ScheduleEntryLockSetAction.Set) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\taction,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 8);\n\t\tconst weekday: ScheduleEntryLockWeekday = raw.payload[3];\n\t\tconst startHour = raw.payload[4];\n\t\tconst startMinute = raw.payload[5];\n\t\tconst stopHour = raw.payload[6];\n\t\tconst stopMinute = raw.payload[7];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\taction,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t\tweekday,\n\t\t\tstartHour,\n\t\t\tstartMinute,\n\t\t\tstopHour,\n\t\t\tstopMinute,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic action: ScheduleEntryLockSetAction;\n\n\tpublic weekday?: ScheduleEntryLockWeekday;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.action,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\t// The report should have these fields set to 0xff\n\t\t\t// if the slot is erased. The specs don't mention anything\n\t\t\t// for the Set command, so we just assume the same is okay\n\t\t\tthis.weekday ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.action === ScheduleEntryLockSetAction.Erase) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"erase\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\tweekday: getEnumMemberName(\n\t\t\t\t\tScheduleEntryLockWeekday,\n\t\t\t\t\tthis.weekday!,\n\t\t\t\t),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\t\"end time\": formatTime(\n\t\t\t\t\tthis.stopHour ?? 0,\n\t\t\t\t\tthis.stopMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCWeekDayScheduleReportOptions =\n\t& ScheduleEntryLockSlotId\n\t& AllOrNone<ScheduleEntryLockWeekDaySchedule>;\n\n@CCCommand(ScheduleEntryLockCommand.WeekDayScheduleReport)\nexport class ScheduleEntryLockCCWeekDayScheduleReport\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCWeekDayScheduleReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.weekday = options.weekday;\n\t\tthis.startHour = options.startHour;\n\t\tthis.startMinute = options.startMinute;\n\t\tthis.stopHour = options.stopHour;\n\t\tthis.stopMinute = options.stopMinute;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCWeekDayScheduleReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\tlet ccOptions: ScheduleEntryLockCCWeekDayScheduleReportOptions = {\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t};\n\n\t\tlet weekday: ScheduleEntryLockWeekday | undefined;\n\t\tlet startHour: number | undefined;\n\t\tlet startMinute: number | undefined;\n\t\tlet stopHour: number | undefined;\n\t\tlet stopMinute: number | undefined;\n\n\t\tif (raw.payload.length >= 7) {\n\t\t\tif (raw.payload[2] !== 0xff) {\n\t\t\t\tweekday = raw.payload[2];\n\t\t\t}\n\t\t\tif (raw.payload[3] !== 0xff) {\n\t\t\t\tstartHour = raw.payload[3];\n\t\t\t}\n\t\t\tif (raw.payload[4] !== 0xff) {\n\t\t\t\tstartMinute = raw.payload[4];\n\t\t\t}\n\t\t\tif (raw.payload[5] !== 0xff) {\n\t\t\t\tstopHour = raw.payload[5];\n\t\t\t}\n\t\t\tif (raw.payload[6] !== 0xff) {\n\t\t\t\tstopMinute = raw.payload[6];\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tweekday != undefined\n\t\t\t&& startHour != undefined\n\t\t\t&& startMinute != undefined\n\t\t\t&& stopHour != undefined\n\t\t\t&& stopMinute != undefined\n\t\t) {\n\t\t\tccOptions = {\n\t\t\t\t...ccOptions,\n\t\t\t\tweekday,\n\t\t\t\tstartHour,\n\t\t\t\tstartMinute,\n\t\t\t\tstopHour,\n\t\t\t\tstopMinute,\n\t\t\t};\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t...ccOptions,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\tpublic weekday?: ScheduleEntryLockWeekday;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tpersistSchedule.call(\n\t\t\tthis,\n\t\t\tctx,\n\t\t\tScheduleEntryLockScheduleKind.WeekDay,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.weekday != undefined\n\t\t\t\t? {\n\t\t\t\t\tweekday: this.weekday,\n\t\t\t\t\tstartHour: this.startHour!,\n\t\t\t\t\tstartMinute: this.startMinute!,\n\t\t\t\t\tstopHour: this.stopHour!,\n\t\t\t\t\tstopMinute: this.stopMinute!,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.weekday ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.weekday == undefined) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tschedule: \"(empty)\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tweekday: getEnumMemberName(\n\t\t\t\t\tScheduleEntryLockWeekday,\n\t\t\t\t\tthis.weekday,\n\t\t\t\t),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\t\"end time\": formatTime(\n\t\t\t\t\tthis.stopHour ?? 0,\n\t\t\t\t\tthis.stopMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCWeekDayScheduleGetOptions =\n\tScheduleEntryLockSlotId;\n\n@CCCommand(ScheduleEntryLockCommand.WeekDayScheduleGet)\n@expectedCCResponse(ScheduleEntryLockCCWeekDayScheduleReport)\nexport class ScheduleEntryLockCCWeekDayScheduleGet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCWeekDayScheduleGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCWeekDayScheduleGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n/** @publicAPI */\nexport type ScheduleEntryLockCCYearDayScheduleSetOptions =\n\t& ScheduleEntryLockSlotId\n\t& (\n\t\t| {\n\t\t\taction: ScheduleEntryLockSetAction.Erase;\n\t\t}\n\t\t| ({\n\t\t\taction: ScheduleEntryLockSetAction.Set;\n\t\t} & ScheduleEntryLockYearDaySchedule)\n\t);\n\n@CCCommand(ScheduleEntryLockCommand.YearDayScheduleSet)\n@useSupervision()\nexport class ScheduleEntryLockCCYearDayScheduleSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCYearDayScheduleSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.action = options.action;\n\t\tif (options.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.startYear = options.startYear;\n\t\t\tthis.startMonth = options.startMonth;\n\t\t\tthis.startDay = options.startDay;\n\t\t\tthis.startHour = options.startHour;\n\t\t\tthis.startMinute = options.startMinute;\n\t\t\tthis.stopYear = options.stopYear;\n\t\t\tthis.stopMonth = options.stopMonth;\n\t\t\tthis.stopDay = options.stopDay;\n\t\t\tthis.stopHour = options.stopHour;\n\t\t\tthis.stopMinute = options.stopMinute;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCYearDayScheduleSet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst action: ScheduleEntryLockSetAction = raw.payload[0];\n\n\t\tvalidatePayload(\n\t\t\taction === ScheduleEntryLockSetAction.Set\n\t\t\t\t|| action === ScheduleEntryLockSetAction.Erase,\n\t\t);\n\t\tconst userId = raw.payload[1];\n\t\tconst slotId = raw.payload[2];\n\n\t\tif (action !== ScheduleEntryLockSetAction.Set) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\taction,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 13);\n\t\tconst startYear = raw.payload[3];\n\t\tconst startMonth = raw.payload[4];\n\t\tconst startDay = raw.payload[5];\n\t\tconst startHour = raw.payload[6];\n\t\tconst startMinute = raw.payload[7];\n\t\tconst stopYear = raw.payload[8];\n\t\tconst stopMonth = raw.payload[9];\n\t\tconst stopDay = raw.payload[10];\n\t\tconst stopHour = raw.payload[11];\n\t\tconst stopMinute = raw.payload[12];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\taction,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t\tstartYear,\n\t\t\tstartMonth,\n\t\t\tstartDay,\n\t\t\tstartHour,\n\t\t\tstartMinute,\n\t\t\tstopYear,\n\t\t\tstopMonth,\n\t\t\tstopDay,\n\t\t\tstopHour,\n\t\t\tstopMinute,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic action: ScheduleEntryLockSetAction;\n\n\tpublic startYear?: number;\n\tpublic startMonth?: number;\n\tpublic startDay?: number;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopYear?: number;\n\tpublic stopMonth?: number;\n\tpublic stopDay?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.action,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\t// The report should have these fields set to 0xff\n\t\t\t// if the slot is erased. The specs don't mention anything\n\t\t\t// for the Set command, so we just assume the same is okay\n\t\t\tthis.startYear ?? 0xff,\n\t\t\tthis.startMonth ?? 0xff,\n\t\t\tthis.startDay ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopYear ?? 0xff,\n\t\t\tthis.stopMonth ?? 0xff,\n\t\t\tthis.stopDay ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.action === ScheduleEntryLockSetAction.Erase) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"erase\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\t\"start date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.startYear ?? 0,\n\t\t\t\t\t\tthis.startMonth ?? 0,\n\t\t\t\t\t\tthis.startDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.startHour ?? 0, this.startMinute ?? 0)}`,\n\t\t\t\t\"end date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.stopYear ?? 0,\n\t\t\t\t\t\tthis.stopMonth ?? 0,\n\t\t\t\t\t\tthis.stopDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.stopHour ?? 0, this.stopMinute ?? 0)}`,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCYearDayScheduleReportOptions =\n\t& ScheduleEntryLockSlotId\n\t& AllOrNone<ScheduleEntryLockYearDaySchedule>;\n\n@CCCommand(ScheduleEntryLockCommand.YearDayScheduleReport)\nexport class ScheduleEntryLockCCYearDayScheduleReport\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCYearDayScheduleReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.startYear = options.startYear;\n\t\tthis.startMonth = options.startMonth;\n\t\tthis.startDay = options.startDay;\n\t\tthis.startHour = options.startHour;\n\t\tthis.startMinute = options.startMinute;\n\t\tthis.stopYear = options.stopYear;\n\t\tthis.stopMonth = options.stopMonth;\n\t\tthis.stopDay = options.stopDay;\n\t\tthis.stopHour = options.stopHour;\n\t\tthis.stopMinute = options.stopMinute;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCYearDayScheduleReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\tlet ccOptions: ScheduleEntryLockCCYearDayScheduleReportOptions = {\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t};\n\n\t\tlet startYear: number | undefined;\n\t\tlet startMonth: number | undefined;\n\t\tlet startDay: number | undefined;\n\t\tlet startHour: number | undefined;\n\t\tlet startMinute: number | undefined;\n\t\tlet stopYear: number | undefined;\n\t\tlet stopMonth: number | undefined;\n\t\tlet stopDay: number | undefined;\n\t\tlet stopHour: number | undefined;\n\t\tlet stopMinute: number | undefined;\n\n\t\tif (raw.payload.length >= 12) {\n\t\t\tif (raw.payload[2] !== 0xff) {\n\t\t\t\tstartYear = raw.payload[2];\n\t\t\t}\n\t\t\tif (raw.payload[3] !== 0xff) {\n\t\t\t\tstartMonth = raw.payload[3];\n\t\t\t}\n\t\t\tif (raw.payload[4] !== 0xff) {\n\t\t\t\tstartDay = raw.payload[4];\n\t\t\t}\n\t\t\tif (raw.payload[5] !== 0xff) {\n\t\t\t\tstartHour = raw.payload[5];\n\t\t\t}\n\t\t\tif (raw.payload[6] !== 0xff) {\n\t\t\t\tstartMinute = raw.payload[6];\n\t\t\t}\n\t\t\tif (raw.payload[7] !== 0xff) {\n\t\t\t\tstopYear = raw.payload[7];\n\t\t\t}\n\t\t\tif (raw.payload[8] !== 0xff) {\n\t\t\t\tstopMonth = raw.payload[8];\n\t\t\t}\n\t\t\tif (raw.payload[9] !== 0xff) {\n\t\t\t\tstopDay = raw.payload[9];\n\t\t\t}\n\t\t\tif (raw.payload[10] !== 0xff) {\n\t\t\t\tstopHour = raw.payload[10];\n\t\t\t}\n\t\t\tif (raw.payload[11] !== 0xff) {\n\t\t\t\tstopMinute = raw.payload[11];\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\tstartYear != undefined\n\t\t\t&& startMonth != undefined\n\t\t\t&& startDay != undefined\n\t\t\t&& startHour != undefined\n\t\t\t&& startMinute != undefined\n\t\t\t&& stopYear != undefined\n\t\t\t&& stopMonth != undefined\n\t\t\t&& stopDay != undefined\n\t\t\t&& stopHour != undefined\n\t\t\t&& stopMinute != undefined\n\t\t) {\n\t\t\tccOptions = {\n\t\t\t\t...ccOptions,\n\t\t\t\tstartYear,\n\t\t\t\tstartMonth,\n\t\t\t\tstartDay,\n\t\t\t\tstartHour,\n\t\t\t\tstartMinute,\n\t\t\t\tstopYear,\n\t\t\t\tstopMonth,\n\t\t\t\tstopDay,\n\t\t\t\tstopHour,\n\t\t\t\tstopMinute,\n\t\t\t};\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t...ccOptions,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\tpublic startYear?: number;\n\tpublic startMonth?: number;\n\tpublic startDay?: number;\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic stopYear?: number;\n\tpublic stopMonth?: number;\n\tpublic stopDay?: number;\n\tpublic stopHour?: number;\n\tpublic stopMinute?: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tpersistSchedule.call(\n\t\t\tthis,\n\t\t\tctx,\n\t\t\tScheduleEntryLockScheduleKind.YearDay,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.startYear != undefined\n\t\t\t\t? {\n\t\t\t\t\tstartYear: this.startYear,\n\t\t\t\t\tstartMonth: this.startMonth!,\n\t\t\t\t\tstartDay: this.startDay!,\n\t\t\t\t\tstartHour: this.startHour!,\n\t\t\t\t\tstartMinute: this.startMinute!,\n\t\t\t\t\tstopYear: this.stopYear!,\n\t\t\t\t\tstopMonth: this.stopMonth!,\n\t\t\t\t\tstopDay: this.stopDay!,\n\t\t\t\t\tstopHour: this.stopHour!,\n\t\t\t\t\tstopMinute: this.stopMinute!,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.startYear ?? 0xff,\n\t\t\tthis.startMonth ?? 0xff,\n\t\t\tthis.startDay ?? 0xff,\n\t\t\tthis.startHour ?? 0xff,\n\t\t\tthis.startMinute ?? 0xff,\n\t\t\tthis.stopYear ?? 0xff,\n\t\t\tthis.stopMonth ?? 0xff,\n\t\t\tthis.stopDay ?? 0xff,\n\t\t\tthis.stopHour ?? 0xff,\n\t\t\tthis.stopMinute ?? 0xff,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.startYear !== undefined) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tschedule: \"(empty)\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\t\"start date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.startYear ?? 0,\n\t\t\t\t\t\tthis.startMonth ?? 0,\n\t\t\t\t\t\tthis.startDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.startHour ?? 0, this.startMinute ?? 0)}`,\n\t\t\t\t\"end date\": `${\n\t\t\t\t\tformatDate(\n\t\t\t\t\t\tthis.stopYear ?? 0,\n\t\t\t\t\t\tthis.stopMonth ?? 0,\n\t\t\t\t\t\tthis.stopDay ?? 0,\n\t\t\t\t\t)\n\t\t\t\t} ${formatTime(this.stopHour ?? 0, this.stopMinute ?? 0)}`,\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCYearDayScheduleGetOptions =\n\tScheduleEntryLockSlotId;\n\n@CCCommand(ScheduleEntryLockCommand.YearDayScheduleGet)\n@expectedCCResponse(ScheduleEntryLockCCYearDayScheduleReport)\nexport class ScheduleEntryLockCCYearDayScheduleGet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCYearDayScheduleGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCYearDayScheduleGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCTimeOffsetSetOptions {\n\tstandardOffset: number;\n\tdstOffset: number;\n}\n\n@CCCommand(ScheduleEntryLockCommand.TimeOffsetSet)\n@useSupervision()\nexport class ScheduleEntryLockCCTimeOffsetSet extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCTimeOffsetSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.standardOffset = options.standardOffset;\n\t\tthis.dstOffset = options.dstOffset;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCTimeOffsetSet {\n\t\tconst { standardOffset, dstOffset } = parseTimezone(raw.payload);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tstandardOffset,\n\t\t\tdstOffset,\n\t\t});\n\t}\n\n\tpublic standardOffset: number;\n\tpublic dstOffset: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = encodeTimezone({\n\t\t\tstandardOffset: this.standardOffset,\n\t\t\tdstOffset: this.dstOffset,\n\t\t});\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"standard time offset\": `${this.standardOffset} minutes`,\n\t\t\t\t\"DST offset\": `${this.dstOffset} minutes`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ScheduleEntryLockCCTimeOffsetReportOptions {\n\tstandardOffset: number;\n\tdstOffset: number;\n}\n\n@CCCommand(ScheduleEntryLockCommand.TimeOffsetReport)\nexport class ScheduleEntryLockCCTimeOffsetReport extends ScheduleEntryLockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ScheduleEntryLockCCTimeOffsetReportOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.standardOffset = options.standardOffset;\n\t\tthis.dstOffset = options.dstOffset;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCTimeOffsetReport {\n\t\tconst { standardOffset, dstOffset } = parseTimezone(raw.payload);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tstandardOffset,\n\t\t\tdstOffset,\n\t\t});\n\t}\n\n\tpublic standardOffset: number;\n\tpublic dstOffset: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = encodeTimezone({\n\t\t\tstandardOffset: this.standardOffset,\n\t\t\tdstOffset: this.dstOffset,\n\t\t});\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"standard time offset\": `${this.standardOffset} minutes`,\n\t\t\t\t\"DST offset\": `${this.dstOffset} minutes`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ScheduleEntryLockCommand.TimeOffsetGet)\n@expectedCCResponse(ScheduleEntryLockCCTimeOffsetReport)\nexport class ScheduleEntryLockCCTimeOffsetGet extends ScheduleEntryLockCC {}\n\n/** @publicAPI */\nexport type ScheduleEntryLockCCDailyRepeatingScheduleSetOptions =\n\t& ScheduleEntryLockSlotId\n\t& (\n\t\t| {\n\t\t\taction: ScheduleEntryLockSetAction.Erase;\n\t\t}\n\t\t| ({\n\t\t\taction: ScheduleEntryLockSetAction.Set;\n\t\t} & ScheduleEntryLockDailyRepeatingSchedule)\n\t);\n\n@CCCommand(ScheduleEntryLockCommand.DailyRepeatingScheduleSet)\n@useSupervision()\nexport class ScheduleEntryLockCCDailyRepeatingScheduleSet\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleSetOptions\n\t\t>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.action = options.action;\n\t\tif (options.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.weekdays = options.weekdays;\n\t\t\tthis.startHour = options.startHour;\n\t\t\tthis.startMinute = options.startMinute;\n\t\t\tthis.durationHour = options.durationHour;\n\t\t\tthis.durationMinute = options.durationMinute;\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCDailyRepeatingScheduleSet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst action: ScheduleEntryLockSetAction = raw.payload[0];\n\n\t\tvalidatePayload(\n\t\t\taction === ScheduleEntryLockSetAction.Set\n\t\t\t\t|| action === ScheduleEntryLockSetAction.Erase,\n\t\t);\n\t\tconst userId = raw.payload[1];\n\t\tconst slotId = raw.payload[2];\n\n\t\tif (action !== ScheduleEntryLockSetAction.Set) {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\taction,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\n\t\tvalidatePayload(raw.payload.length >= 8);\n\t\tconst weekdays: ScheduleEntryLockWeekday[] = parseBitMask(\n\t\t\traw.payload.subarray(3, 4),\n\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t);\n\t\tconst startHour = raw.payload[4];\n\t\tconst startMinute = raw.payload[5];\n\t\tconst durationHour = raw.payload[6];\n\t\tconst durationMinute = raw.payload[7];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\taction,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t\tweekdays,\n\t\t\tstartHour,\n\t\t\tstartMinute,\n\t\t\tdurationHour,\n\t\t\tdurationMinute,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic action: ScheduleEntryLockSetAction;\n\n\tpublic weekdays?: ScheduleEntryLockWeekday[];\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic durationHour?: number;\n\tpublic durationMinute?: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.action, this.userId, this.slotId]);\n\t\tif (this.action === ScheduleEntryLockSetAction.Set) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tencodeBitMask(\n\t\t\t\t\tthis.weekdays!,\n\t\t\t\t\tScheduleEntryLockWeekday.Saturday,\n\t\t\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t\t\t),\n\t\t\t\tBytes.from([\n\t\t\t\t\tthis.startHour!,\n\t\t\t\t\tthis.startMinute!,\n\t\t\t\t\tthis.durationHour!,\n\t\t\t\t\tthis.durationMinute!,\n\t\t\t\t]),\n\t\t\t]);\n\t\t} else {\n\t\t\t// Not sure if this is correct\n\t\t\tthis.payload = Bytes.concat([this.payload, Bytes.alloc(5, 0xff)]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (this.action === ScheduleEntryLockSetAction.Erase) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"erase\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\tweekdays: this.weekdays!.map((w) =>\n\t\t\t\t\tgetEnumMemberName(ScheduleEntryLockWeekday, w)\n\t\t\t\t).join(\", \"),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\tduration: formatTime(\n\t\t\t\t\tthis.durationHour ?? 0,\n\t\t\t\t\tthis.durationMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCDailyRepeatingScheduleReportOptions =\n\t& ScheduleEntryLockSlotId\n\t& AllOrNone<ScheduleEntryLockDailyRepeatingSchedule>;\n\n@CCCommand(ScheduleEntryLockCommand.DailyRepeatingScheduleReport)\nexport class ScheduleEntryLockCCDailyRepeatingScheduleReport\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleReportOptions\n\t\t>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t\tthis.weekdays = options.weekdays;\n\t\tthis.startHour = options.startHour;\n\t\tthis.startMinute = options.startMinute;\n\t\tthis.durationHour = options.durationHour;\n\t\tthis.durationMinute = options.durationMinute;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCDailyRepeatingScheduleReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\tif (raw.payload.length >= 7 && raw.payload[2] !== 0) {\n\t\t\t// Only parse the schedule if it is present and some weekday is selected\n\t\t\tconst weekdays: ScheduleEntryLockWeekday[] = parseBitMask(\n\t\t\t\traw.payload.subarray(2, 3),\n\t\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t\t);\n\t\t\tconst startHour = raw.payload[3];\n\t\t\tconst startMinute = raw.payload[4];\n\t\t\tconst durationHour = raw.payload[5];\n\t\t\tconst durationMinute = raw.payload[6];\n\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t\tweekdays,\n\t\t\t\tstartHour,\n\t\t\t\tstartMinute,\n\t\t\t\tdurationHour,\n\t\t\t\tdurationMinute,\n\t\t\t});\n\t\t} else {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tuserId,\n\t\t\t\tslotId,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic weekdays?: ScheduleEntryLockWeekday[];\n\tpublic startHour?: number;\n\tpublic startMinute?: number;\n\tpublic durationHour?: number;\n\tpublic durationMinute?: number;\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\tpersistSchedule.call(\n\t\t\tthis,\n\t\t\tctx,\n\t\t\tScheduleEntryLockScheduleKind.DailyRepeating,\n\t\t\tthis.userId,\n\t\t\tthis.slotId,\n\t\t\tthis.weekdays?.length\n\t\t\t\t? {\n\t\t\t\t\tweekdays: this.weekdays,\n\t\t\t\t\tstartHour: this.startHour!,\n\t\t\t\t\tstartMinute: this.startMinute!,\n\t\t\t\t\tdurationHour: this.durationHour!,\n\t\t\t\t\tdurationMinute: this.durationMinute!,\n\t\t\t\t}\n\t\t\t\t: false,\n\t\t);\n\n\t\treturn true;\n\t}\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\tif (this.weekdays) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tencodeBitMask(\n\t\t\t\t\tthis.weekdays,\n\t\t\t\t\tScheduleEntryLockWeekday.Saturday,\n\t\t\t\t\tScheduleEntryLockWeekday.Sunday,\n\t\t\t\t),\n\t\t\t\tBytes.from([\n\t\t\t\t\tthis.startHour!,\n\t\t\t\t\tthis.startMinute!,\n\t\t\t\t\tthis.durationHour!,\n\t\t\t\t\tthis.durationMinute!,\n\t\t\t\t]),\n\t\t\t]);\n\t\t} else {\n\t\t\t// Not sure if this is correct, but at least we won't parse it incorrectly ourselves when setting everything to 0\n\t\t\tthis.payload = Bytes.concat([this.payload, Bytes.alloc(5, 0)]);\n\t\t}\n\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tlet message: MessageRecord;\n\t\tif (!this.weekdays) {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\tschedule: \"(empty)\",\n\t\t\t};\n\t\t} else {\n\t\t\tmessage = {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t\taction: \"set\",\n\t\t\t\tweekdays: this.weekdays\n\t\t\t\t\t.map((w) => getEnumMemberName(ScheduleEntryLockWeekday, w))\n\t\t\t\t\t.join(\", \"),\n\t\t\t\t\"start time\": formatTime(\n\t\t\t\t\tthis.startHour ?? 0,\n\t\t\t\t\tthis.startMinute ?? 0,\n\t\t\t\t),\n\t\t\t\tduration: formatTime(\n\t\t\t\t\tthis.durationHour ?? 0,\n\t\t\t\t\tthis.durationMinute ?? 0,\n\t\t\t\t),\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport type ScheduleEntryLockCCDailyRepeatingScheduleGetOptions =\n\tScheduleEntryLockSlotId;\n\n@CCCommand(ScheduleEntryLockCommand.DailyRepeatingScheduleGet)\n@expectedCCResponse(ScheduleEntryLockCCDailyRepeatingScheduleReport)\nexport class ScheduleEntryLockCCDailyRepeatingScheduleGet\n\textends ScheduleEntryLockCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<\n\t\t\tScheduleEntryLockCCDailyRepeatingScheduleGetOptions\n\t\t>,\n\t) {\n\t\tsuper(options);\n\t\tthis.userId = options.userId;\n\t\tthis.slotId = options.slotId;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ScheduleEntryLockCCDailyRepeatingScheduleGet {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst userId = raw.payload[0];\n\t\tconst slotId = raw.payload[1];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tuserId,\n\t\t\tslotId,\n\t\t});\n\t}\n\n\tpublic userId: number;\n\tpublic slotId: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.userId, this.slotId]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: {\n\t\t\t\t\"user ID\": this.userId,\n\t\t\t\t\"slot #\": this.slotId,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAiBO;AACP,oBAOO;AAEP,iBAAsB;AACtB,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAUO;AACP,yBAA8C;AAC9C,wBAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6C3B,SAAS,gBAER,KACA,cACA,QACA,QACA,UAKY;AAEZ,QAAM,gBAAgB,oDAA0B,SAC/C,cACA,QACA,MAAM;AAGP,MAAI,YAAY,QAAW;AAC1B,SAAK,SAAS,KAAK,eAAe,QAAQ;EAC3C,OAAO;AACN,SA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IAGZ,YACC,SAEC;AAED,YAAM,OAAO;AACb,WAAK,SAAS,QAAQ;AACtB,WAAK,SAAS,QAAQ;IACvB;IAEO,OAAO,KACb,KACA,KAAqB;AAErB,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,SAAS,IAAI,QAAQ,CAAC;AAC5B,YAAM,SAAS,IAAI,QAAQ,CAAC;AAE5B,aAAO,IAAI,KAAK;QACf,QAAQ,IAAI;QACZ;QACA;OACA;IACF;IAEO;IACA;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,oBAAM,KAAK,CAAC,KAAK,QAAQ,KAAK,MAAM,CAAC;AACpD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,WAAW,KAAK;UAChB,UAAU,KAAK;;;IAGlB;;;;",
|
|
6
6
|
"names": ["userId"]
|
|
7
7
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { CCEncodingContext, CCParsingContext } from "@zwave-js/cc";
|
|
2
2
|
import { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, SecurityClass, type SecurityManagers, type WithAddress } from "@zwave-js/core";
|
|
3
|
-
import { Bytes } from "@zwave-js/shared";
|
|
3
|
+
import { Bytes, type BytesView } from "@zwave-js/shared";
|
|
4
4
|
import { CCAPI } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass, type InterviewContext } from "../lib/CommandClass.js";
|
|
6
6
|
import { Security2Extension } from "../lib/Security2/Extension.js";
|
|
7
7
|
import { ECDHProfiles, KEXFailType, KEXSchemes } from "../lib/Security2/shared.js";
|
|
8
8
|
import { Security2Command } from "../lib/_Types.js";
|
|
9
9
|
export interface DecryptionResult {
|
|
10
|
-
plaintext:
|
|
10
|
+
plaintext: BytesView;
|
|
11
11
|
authOK: boolean;
|
|
12
|
-
key?:
|
|
13
|
-
iv?:
|
|
12
|
+
key?: BytesView;
|
|
13
|
+
iv?: BytesView;
|
|
14
14
|
securityClass: SecurityClass | undefined;
|
|
15
15
|
}
|
|
16
16
|
export declare class Security2CCAPI extends CCAPI {
|
|
@@ -23,7 +23,7 @@ export declare class Security2CCAPI extends CCAPI {
|
|
|
23
23
|
/** Notifies the target node that the MPAN state is out of sync */
|
|
24
24
|
sendMOS(): Promise<boolean>;
|
|
25
25
|
/** Sends the given MPAN to the node */
|
|
26
|
-
sendMPAN(groupId: number, innerMPANState:
|
|
26
|
+
sendMPAN(groupId: number, innerMPANState: BytesView): Promise<boolean>;
|
|
27
27
|
/**
|
|
28
28
|
* Queries the securely supported commands for the current security class
|
|
29
29
|
* @param securityClass Can be used to overwrite the security class to use. If this doesn't match the current one, new nonces will need to be exchanged.
|
|
@@ -41,9 +41,9 @@ export declare class Security2CCAPI extends CCAPI {
|
|
|
41
41
|
confirmGrantedKeys(params: Omit<Security2CCKEXSetOptions, "echo">): Promise<Security2CCKEXReport | Security2CCKEXFail | undefined>;
|
|
42
42
|
/** Notifies the other node that the ongoing key exchange was aborted */
|
|
43
43
|
abortKeyExchange(failType: KEXFailType): Promise<void>;
|
|
44
|
-
sendPublicKey(publicKey:
|
|
44
|
+
sendPublicKey(publicKey: BytesView, includingNode?: boolean): Promise<void>;
|
|
45
45
|
requestNetworkKey(securityClass: SecurityClass): Promise<void>;
|
|
46
|
-
sendNetworkKey(securityClass: SecurityClass, networkKey:
|
|
46
|
+
sendNetworkKey(securityClass: SecurityClass, networkKey: BytesView): Promise<void>;
|
|
47
47
|
verifyNetworkKey(): Promise<void>;
|
|
48
48
|
confirmKeyVerification(): Promise<void>;
|
|
49
49
|
endKeyExchange(): Promise<void>;
|
|
@@ -94,7 +94,7 @@ export declare class Security2CCMessageEncapsulation extends Security2CC {
|
|
|
94
94
|
prepareRetransmission(): void;
|
|
95
95
|
hasMOSExtension(): boolean;
|
|
96
96
|
/** Returns the Sender's Entropy Input if this command contains an SPAN extension */
|
|
97
|
-
getSenderEI():
|
|
97
|
+
getSenderEI(): BytesView | undefined;
|
|
98
98
|
/** Returns the multicast group ID if this command contains an MGRP extension */
|
|
99
99
|
getMulticastGroupId(): number | undefined;
|
|
100
100
|
private maybeAddSPANExtension;
|
|
@@ -107,7 +107,7 @@ export type Security2CCNonceReportOptions = {
|
|
|
107
107
|
} & ({
|
|
108
108
|
MOS: boolean;
|
|
109
109
|
SOS: true;
|
|
110
|
-
receiverEI:
|
|
110
|
+
receiverEI: BytesView;
|
|
111
111
|
} | {
|
|
112
112
|
MOS: true;
|
|
113
113
|
SOS: false;
|
|
@@ -120,7 +120,7 @@ export declare class Security2CCNonceReport extends Security2CC {
|
|
|
120
120
|
private ensureSequenceNumber;
|
|
121
121
|
readonly SOS: boolean;
|
|
122
122
|
readonly MOS: boolean;
|
|
123
|
-
readonly receiverEI?:
|
|
123
|
+
readonly receiverEI?: BytesView;
|
|
124
124
|
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
125
125
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
126
126
|
}
|
|
@@ -189,25 +189,25 @@ export declare class Security2CCKEXFail extends Security2CC {
|
|
|
189
189
|
}
|
|
190
190
|
export interface Security2CCPublicKeyReportOptions {
|
|
191
191
|
includingNode: boolean;
|
|
192
|
-
publicKey:
|
|
192
|
+
publicKey: BytesView;
|
|
193
193
|
}
|
|
194
194
|
export declare class Security2CCPublicKeyReport extends Security2CC {
|
|
195
195
|
constructor(options: WithAddress<Security2CCPublicKeyReportOptions>);
|
|
196
196
|
static from(raw: CCRaw, ctx: CCParsingContext): Security2CCPublicKeyReport;
|
|
197
197
|
includingNode: boolean;
|
|
198
|
-
publicKey:
|
|
198
|
+
publicKey: BytesView;
|
|
199
199
|
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
200
200
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
201
201
|
}
|
|
202
202
|
export interface Security2CCNetworkKeyReportOptions {
|
|
203
203
|
grantedKey: SecurityClass;
|
|
204
|
-
networkKey:
|
|
204
|
+
networkKey: BytesView;
|
|
205
205
|
}
|
|
206
206
|
export declare class Security2CCNetworkKeyReport extends Security2CC {
|
|
207
207
|
constructor(options: WithAddress<Security2CCNetworkKeyReportOptions>);
|
|
208
208
|
static from(raw: CCRaw, ctx: CCParsingContext): Security2CCNetworkKeyReport;
|
|
209
209
|
grantedKey: SecurityClass;
|
|
210
|
-
networkKey:
|
|
210
|
+
networkKey: BytesView;
|
|
211
211
|
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
212
212
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
213
213
|
}
|
|
@@ -157,10 +157,11 @@ async function decryptSinglecast(ctx, securityManager, sendingNodeId, curSequenc
|
|
|
157
157
|
const decryptWithNonce = /* @__PURE__ */ __name(async (nonce) => {
|
|
158
158
|
const { keyCCM: key } = securityManager.getKeysForNode(sendingNodeId);
|
|
159
159
|
const iv = nonce;
|
|
160
|
+
const ret = await (0, import_core.decryptAES128CCM)(ciphertext, key, iv, authData, authTag);
|
|
160
161
|
return {
|
|
161
162
|
key,
|
|
162
163
|
iv,
|
|
163
|
-
...
|
|
164
|
+
...ret
|
|
164
165
|
};
|
|
165
166
|
}, "decryptWithNonce");
|
|
166
167
|
const getNonceAndDecrypt = /* @__PURE__ */ __name(async () => {
|
|
@@ -480,7 +481,7 @@ let Security2CCAPI = (() => {
|
|
|
480
481
|
});
|
|
481
482
|
await this.host.sendCommand(cc, this.commandOptions);
|
|
482
483
|
}
|
|
483
|
-
//
|
|
484
|
+
// oxlint-disable-next-line typescript/explicit-module-boundary-types
|
|
484
485
|
async getKeyExchangeParameters() {
|
|
485
486
|
this.assertSupportsCommand(import_Types.Security2Command, import_Types.Security2Command.KEXGet);
|
|
486
487
|
const cc = new Security2CCKEXGet({
|
|
@@ -843,8 +844,8 @@ function failNoMPAN() {
|
|
|
843
844
|
import_core.validatePayload.fail(import_core.ZWaveErrorCodes.Security2CC_NoMPAN);
|
|
844
845
|
}
|
|
845
846
|
__name(failNoMPAN, "failNoMPAN");
|
|
846
|
-
function getCCResponseForMessageEncapsulation(sent) {
|
|
847
|
-
if (sent.encapsulated?.expectsCCResponse()) {
|
|
847
|
+
function getCCResponseForMessageEncapsulation(ctx, sent) {
|
|
848
|
+
if (sent.encapsulated?.expectsCCResponse(ctx)) {
|
|
848
849
|
const ret = [
|
|
849
850
|
Security2CCMessageEncapsulation,
|
|
850
851
|
Security2CCNonceReport
|
|
@@ -1459,7 +1460,7 @@ let Security2CCKEXGet = (() => {
|
|
|
1459
1460
|
};
|
|
1460
1461
|
return Security2CCKEXGet2 = _classThis;
|
|
1461
1462
|
})();
|
|
1462
|
-
function getExpectedResponseForKEXSet(sent) {
|
|
1463
|
+
function getExpectedResponseForKEXSet(ctx, sent) {
|
|
1463
1464
|
if (sent.echo) {
|
|
1464
1465
|
return [Security2CCKEXReport, Security2CCKEXFail];
|
|
1465
1466
|
} else {
|