@zwave-js/cc 14.3.10 → 15.0.0-beta.1
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.d.ts +68 -68
- package/build/cjs/cc/AlarmSensorCC.js +12 -50
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +72 -73
- package/build/cjs/cc/AssociationCC.js +9 -26
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +71 -71
- package/build/cjs/cc/AssociationGroupInfoCC.js +11 -22
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +66 -72
- package/build/cjs/cc/BarrierOperatorCC.js +12 -44
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +64 -65
- package/build/cjs/cc/BasicCC.js +15 -46
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.d.ts +162 -165
- package/build/cjs/cc/BatteryCC.js +7 -84
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +36 -36
- package/build/cjs/cc/BinarySensorCC.js +9 -29
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +34 -34
- package/build/cjs/cc/BinarySwitchCC.js +6 -22
- package/build/cjs/cc/BinarySwitchCC.js.map +2 -2
- package/build/cjs/cc/CRC16CC.d.ts +4 -8
- package/build/cjs/cc/CRC16CC.js +4 -27
- package/build/cjs/cc/CRC16CC.js.map +2 -2
- package/build/cjs/cc/CentralSceneCC.d.ts +74 -74
- package/build/cjs/cc/CentralSceneCC.js +7 -30
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +38 -40
- package/build/cjs/cc/ClimateControlScheduleCC.js +5 -24
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
- package/build/cjs/cc/ClockCC.d.ts +3 -3
- package/build/cjs/cc/ClockCC.js.map +2 -2
- package/build/cjs/cc/ColorSwitchCC.d.ts +117 -117
- package/build/cjs/cc/ColorSwitchCC.js +23 -75
- package/build/cjs/cc/ColorSwitchCC.js.map +2 -2
- package/build/cjs/cc/ConfigurationCC._validateArgs.js +1 -1
- package/build/cjs/cc/ConfigurationCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/ConfigurationCC.d.ts +48 -52
- package/build/cjs/cc/ConfigurationCC.js +11 -39
- package/build/cjs/cc/ConfigurationCC.js.map +2 -2
- package/build/cjs/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +2 -2
- package/build/cjs/cc/DoorLockCC._validateArgs.js +1 -1
- package/build/cjs/cc/DoorLockCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/DoorLockCC.d.ts +362 -361
- package/build/cjs/cc/DoorLockCC.js +51 -156
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +14 -14
- package/build/cjs/cc/DoorLockLoggingCC.js +4 -8
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +16 -16
- package/build/cjs/cc/EnergyProductionCC.js +5 -17
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +71 -71
- package/build/cjs/cc/EntryControlCC.js +9 -36
- package/build/cjs/cc/EntryControlCC.js.map +2 -2
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +2 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js +26 -0
- package/build/cjs/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.d.ts +101 -88
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +159 -34
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +31 -33
- package/build/cjs/cc/HumidityControlModeCC.js +6 -15
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +9 -11
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -12
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +50 -50
- package/build/cjs/cc/HumidityControlSetpointCC.js +10 -28
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
- package/build/cjs/cc/InclusionControllerCC.d.ts +4 -4
- package/build/cjs/cc/InclusionControllerCC.js.map +2 -2
- package/build/cjs/cc/IndicatorCC.d.ts +119 -119
- package/build/cjs/cc/IndicatorCC.js +15 -61
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +581 -585
- package/build/cjs/cc/IrrigationCC.js +29 -233
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +21 -21
- package/build/cjs/cc/LanguageCC.js +4 -15
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +9 -9
- package/build/cjs/cc/LockCC.js +4 -12
- package/build/cjs/cc/LockCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.d.ts +2 -2
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.d.ts +67 -67
- package/build/cjs/cc/ManufacturerSpecificCC.js +5 -26
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +120 -119
- package/build/cjs/cc/MeterCC.js +25 -69
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +71 -73
- package/build/cjs/cc/MultiChannelAssociationCC.js +10 -28
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +136 -146
- package/build/cjs/cc/MultiChannelCC.js +26 -118
- package/build/cjs/cc/MultiChannelCC.js.map +2 -2
- package/build/cjs/cc/MultiCommandCC.d.ts +4 -8
- package/build/cjs/cc/MultiCommandCC.js +4 -37
- package/build/cjs/cc/MultiCommandCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSensorCC.d.ts +50 -49
- package/build/cjs/cc/MultilevelSensorCC.js +12 -33
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +146 -146
- package/build/cjs/cc/MultilevelSwitchCC.js +13 -107
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +30 -30
- package/build/cjs/cc/NodeNamingCC.js +5 -16
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +210 -208
- package/build/cjs/cc/NotificationCC.js +41 -113
- package/build/cjs/cc/NotificationCC.js.map +2 -2
- package/build/cjs/cc/PowerlevelCC.d.ts +6 -6
- package/build/cjs/cc/PowerlevelCC.js.map +2 -2
- package/build/cjs/cc/ProtectionCC.d.ts +117 -121
- package/build/cjs/cc/ProtectionCC.js +15 -50
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +29 -29
- package/build/cjs/cc/SceneActivationCC.js +4 -17
- package/build/cjs/cc/SceneActivationCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +35 -35
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +9 -21
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +36 -35
- package/build/cjs/cc/SceneControllerConfigurationCC.js +10 -22
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +109 -109
- package/build/cjs/cc/ScheduleEntryLockCC.js +13 -30
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +2 -2
- package/build/cjs/cc/Security2CC.d.ts +15 -21
- package/build/cjs/cc/Security2CC.js +32 -347
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.d.ts +12 -19
- package/build/cjs/cc/SecurityCC.js +12 -106
- package/build/cjs/cc/SecurityCC.js.map +2 -2
- package/build/cjs/cc/SoundSwitchCC.d.ts +58 -58
- package/build/cjs/cc/SoundSwitchCC.js +11 -43
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.d.ts +21 -25
- package/build/cjs/cc/SupervisionCC.js +8 -38
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +37 -39
- package/build/cjs/cc/ThermostatFanModeCC.js +8 -21
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +9 -11
- package/build/cjs/cc/ThermostatFanStateCC.js +4 -12
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +39 -41
- package/build/cjs/cc/ThermostatModeCC.js +8 -21
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +9 -11
- package/build/cjs/cc/ThermostatOperatingStateCC.js +4 -12
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetbackCC.d.ts +4 -4
- package/build/cjs/cc/ThermostatSetbackCC.js.map +2 -2
- package/build/cjs/cc/ThermostatSetpointCC.d.ts +51 -51
- package/build/cjs/cc/ThermostatSetpointCC.js +10 -25
- package/build/cjs/cc/ThermostatSetpointCC.js.map +2 -2
- package/build/cjs/cc/TimeCC.d.ts +6 -6
- package/build/cjs/cc/TimeCC.js.map +2 -2
- package/build/cjs/cc/TimeParametersCC.d.ts +9 -9
- package/build/cjs/cc/TimeParametersCC.js +4 -11
- package/build/cjs/cc/TimeParametersCC.js.map +2 -2
- package/build/cjs/cc/TransportServiceCC.d.ts +7 -12
- package/build/cjs/cc/TransportServiceCC.js +3 -20
- package/build/cjs/cc/TransportServiceCC.js.map +2 -2
- package/build/cjs/cc/UserCodeCC._validateArgs.js +1 -1
- package/build/cjs/cc/UserCodeCC._validateArgs.js.map +1 -1
- package/build/cjs/cc/UserCodeCC.d.ts +236 -236
- package/build/cjs/cc/UserCodeCC.js +33 -98
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +210 -212
- package/build/cjs/cc/VersionCC.js +7 -98
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +44 -44
- package/build/cjs/cc/WakeUpCC.js +6 -26
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +118 -122
- package/build/cjs/cc/WindowCoveringCC.js +16 -128
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +74 -74
- package/build/cjs/cc/ZWavePlusCC.js +4 -25
- package/build/cjs/cc/ZWavePlusCC.js.map +2 -2
- package/build/cjs/cc/ZWaveProtocolCC.d.ts +28 -28
- package/build/cjs/cc/ZWaveProtocolCC.js.map +2 -2
- package/build/cjs/cc/_CCValues.generated.d.ts +15814 -0
- package/build/cjs/cc/_CCValues.generated.js +8723 -0
- package/build/cjs/cc/_CCValues.generated.js.map +7 -0
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index_browser.d.ts +9 -0
- package/build/cjs/index_browser.js +41 -1
- package/build/cjs/index_browser.js.map +2 -2
- package/build/cjs/lib/API.d.ts +7 -5
- package/build/cjs/lib/API.js +1 -1
- package/build/cjs/lib/API.js.map +2 -2
- package/build/cjs/lib/CCValueUtils.d.ts +14 -0
- package/build/cjs/lib/CCValueUtils.js +93 -0
- package/build/cjs/lib/CCValueUtils.js.map +7 -0
- package/build/cjs/lib/CommandClass.d.ts +10 -21
- package/build/cjs/lib/CommandClass.js +51 -106
- package/build/cjs/lib/CommandClass.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +1 -1
- package/build/cjs/lib/CommandClassDecorators.js +3 -3
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Values.d.ts +7 -106
- package/build/cjs/lib/Values.js +13 -107
- package/build/cjs/lib/Values.js.map +3 -3
- package/build/cjs/lib/traits.d.ts +94 -0
- package/build/cjs/lib/traits.js +17 -0
- package/build/cjs/lib/traits.js.map +7 -0
- package/build/cjs/lib/utils.d.ts +2 -2
- package/build/cjs/lib/utils.js.map +2 -2
- package/build/esm/cc/AlarmSensorCC.d.ts +68 -68
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +2 -40
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +72 -73
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +2 -27
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +71 -71
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +2 -19
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +66 -72
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +2 -37
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +64 -65
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +2 -34
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +162 -165
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +3 -80
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +36 -36
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +2 -19
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +34 -34
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +2 -19
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.d.ts +4 -8
- package/build/esm/cc/CRC16CC.d.ts.map +1 -1
- package/build/esm/cc/CRC16CC.js +4 -34
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts +74 -74
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +2 -27
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +38 -40
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +2 -26
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.d.ts +3 -3
- package/build/esm/cc/ClockCC.d.ts.map +1 -1
- package/build/esm/cc/ClockCC.js +0 -1
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts +117 -117
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +2 -58
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.js +1 -1
- package/build/esm/cc/ConfigurationCC._validateArgs.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.d.ts +48 -52
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +2 -40
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.js +1 -1
- package/build/esm/cc/DoorLockCC._validateArgs.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts +362 -361
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +9 -129
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +14 -14
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +2 -6
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +16 -16
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +2 -15
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +71 -71
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +2 -29
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts +2 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js +20 -0
- package/build/esm/cc/FirmwareUpdateMetaDataCC._validateArgs.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts +101 -88
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +160 -53
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +31 -33
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +2 -11
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +9 -11
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +2 -9
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +50 -50
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +2 -23
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.d.ts +4 -4
- package/build/esm/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +0 -2
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.d.ts +119 -119
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +2 -50
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +581 -585
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +3 -231
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +21 -21
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +2 -13
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +9 -9
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +2 -10
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts +2 -2
- package/build/esm/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +0 -2
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +67 -67
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +2 -26
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +120 -119
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +3 -53
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +71 -73
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +2 -30
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +136 -146
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +10 -131
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.d.ts +4 -8
- package/build/esm/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +4 -38
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts +50 -49
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +2 -27
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +146 -146
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +5 -105
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +30 -30
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +2 -14
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +210 -208
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +21 -97
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.d.ts +6 -6
- package/build/esm/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +0 -4
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts +117 -121
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +2 -39
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +29 -29
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +2 -15
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +35 -35
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +2 -16
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +36 -35
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +2 -16
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +109 -109
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +2 -31
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.d.ts +15 -21
- package/build/esm/cc/Security2CC.d.ts.map +1 -1
- package/build/esm/cc/Security2CC.js +27 -475
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.d.ts +12 -19
- package/build/esm/cc/SecurityCC.d.ts.map +1 -1
- package/build/esm/cc/SecurityCC.js +13 -138
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts +58 -58
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +2 -40
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +21 -25
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +6 -41
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +37 -39
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +2 -15
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +9 -11
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +2 -9
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +39 -41
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +2 -17
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +9 -11
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +2 -9
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.d.ts +4 -4
- package/build/esm/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +0 -2
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts +51 -51
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +2 -22
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.d.ts +6 -6
- package/build/esm/cc/TimeCC.d.ts.map +1 -1
- package/build/esm/cc/TimeCC.js +0 -4
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts +9 -9
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +2 -9
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.d.ts +7 -12
- package/build/esm/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +5 -38
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.js +1 -1
- package/build/esm/cc/UserCodeCC._validateArgs.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts +236 -236
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +2 -72
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +210 -212
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +2 -96
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +44 -44
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +2 -22
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +118 -122
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +3 -108
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +74 -74
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +2 -26
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.d.ts +28 -28
- package/build/esm/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +0 -27
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/_CCValues.generated.d.ts +15814 -0
- package/build/esm/cc/_CCValues.generated.d.ts.map +1 -0
- package/build/esm/cc/_CCValues.generated.js +9187 -0
- package/build/esm/cc/_CCValues.generated.js.map +1 -0
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +0 -3
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/index.d.ts +1 -0
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index_browser.d.ts +9 -0
- package/build/esm/index_browser.d.ts.map +1 -1
- package/build/esm/index_browser.js +8 -1
- package/build/esm/index_browser.js.map +1 -1
- package/build/esm/lib/API.d.ts +7 -5
- package/build/esm/lib/API.d.ts.map +1 -1
- package/build/esm/lib/API.js +1 -1
- package/build/esm/lib/API.js.map +1 -1
- package/build/esm/lib/CCValueUtils.d.ts +14 -0
- package/build/esm/lib/CCValueUtils.d.ts.map +1 -0
- package/build/esm/lib/CCValueUtils.js +62 -0
- package/build/esm/lib/CCValueUtils.js.map +1 -0
- package/build/esm/lib/CommandClass.d.ts +10 -21
- package/build/esm/lib/CommandClass.d.ts.map +1 -1
- package/build/esm/lib/CommandClass.js +8 -101
- package/build/esm/lib/CommandClass.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +1 -1
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Values.d.ts +7 -106
- package/build/esm/lib/Values.d.ts.map +1 -1
- package/build/esm/lib/Values.js +7 -104
- package/build/esm/lib/Values.js.map +1 -1
- package/build/esm/lib/traits.d.ts +94 -0
- package/build/esm/lib/traits.d.ts.map +1 -0
- package/build/esm/lib/traits.js +2 -0
- package/build/esm/lib/traits.js.map +1 -0
- package/build/esm/lib/utils.d.ts +2 -2
- package/build/esm/lib/utils.d.ts.map +1 -1
- package/build/esm/lib/utils.js.map +1 -1
- package/package.json +16 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/CentralSceneCC.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tenumValuesToMetadataStates,\n\tgetCCName,\n\tmaybeUnknownToString,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} 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 { CentralSceneCommand, CentralSceneKeys } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\n\nexport const CentralSceneCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses[\"Central Scene\"], {\n\t\t...V.staticProperty(\"sceneCount\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\"supportsSlowRefresh\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\"supportedKeyAttributes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\n\t\t...V.staticProperty(\n\t\t\t\"slowRefresh\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.Boolean,\n\t\t\t\tlabel: \"Send held down notifications at a slow rate\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"When this is true, KeyHeldDown notifications are sent every 55s. When this is false, the notifications are sent every 200ms.\",\n\t\t\t} as const,\n\t\t),\n\t}),\n\n\t...V.defineDynamicCCValues(CommandClasses[\"Central Scene\"], {\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"scene\",\n\t\t\t\"scene\",\n\t\t\t(sceneNumber: number) => sceneNumber.toString().padStart(3, \"0\"),\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"scene\"\n\t\t\t\t&& typeof propertyKey === \"string\"\n\t\t\t\t&& /^\\d{3}$/.test(propertyKey),\n\t\t\t(sceneNumber: number) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `Scene ${sceneNumber.toString().padStart(3, \"0\")}`,\n\t\t\t} as const),\n\t\t\t{ stateful: false } as const,\n\t\t),\n\t}),\n});\n\n@API(CommandClasses[\"Central Scene\"])\nexport class CentralSceneCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: CentralSceneCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase CentralSceneCommand.SupportedGet:\n\t\t\t\treturn this.isSinglecast(); // this is mandatory\n\t\t\tcase CentralSceneCommand.ConfigurationGet:\n\t\t\t\treturn this.version >= 3 && this.isSinglecast();\n\t\t\tcase CentralSceneCommand.ConfigurationSet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tCentralSceneCommand,\n\t\t\tCentralSceneCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new CentralSceneCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tCentralSceneCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"sceneCount\",\n\t\t\t\t\"supportsSlowRefresh\",\n\t\t\t\t\"supportedKeyAttributes\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getConfiguration() {\n\t\tthis.assertSupportsCommand(\n\t\t\tCentralSceneCommand,\n\t\t\tCentralSceneCommand.ConfigurationGet,\n\t\t);\n\n\t\tconst cc = new CentralSceneCCConfigurationGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tCentralSceneCCConfigurationReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"slowRefresh\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setConfiguration(\n\t\tslowRefresh: boolean,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tCentralSceneCommand,\n\t\t\tCentralSceneCommand.ConfigurationSet,\n\t\t);\n\n\t\tconst cc = new CentralSceneCCConfigurationSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tslowRefresh,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(this: CentralSceneCCAPI, { property }, value) {\n\t\t\tif (property !== \"slowRefresh\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"boolean\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn this.setConfiguration(value);\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: CentralSceneCCAPI, { property }) {\n\t\t\tif (property === \"slowRefresh\") {\n\t\t\t\treturn (await this.getConfiguration())?.[property];\n\t\t\t}\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n}\n\n@commandClass(CommandClasses[\"Central Scene\"])\n@implementedVersion(3)\n@ccValues(CentralSceneCCValues)\nexport class CentralSceneCC extends CommandClass {\n\tdeclare ccCommand: CentralSceneCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t];\n\t}\n\n\tpublic skipEndpointInterview(): boolean {\n\t\t// Central scene notifications are issued by the root device\n\t\treturn true;\n\t}\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[\"Central Scene\"],\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\t// If one Association group issues CentralScene notifications,\n\t\t// we must associate ourselves with that channel\n\t\ttry {\n\t\t\tawait ccUtils.assignLifelineIssueingCommand(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tthis.ccId,\n\t\t\t\tCentralSceneCommand.Notification,\n\t\t\t);\n\t\t} catch {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\tgetCCName(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t)\n\t\t\t\t} commands failed!`,\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying supported scenes...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst ccSupported = await api.getSupported();\n\t\tif (ccSupported) {\n\t\t\tconst logMessage = `received supported scenes:\n# of scenes: ${ccSupported.sceneCount}\nsupports slow refresh: ${ccSupported.supportsSlowRefresh}`;\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} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying supported scenes timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// The slow refresh capability should be enabled whenever possible\n\t\tif (api.version >= 3 && ccSupported?.supportsSlowRefresh) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"Enabling slow refresh capability...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.setConfiguration(true);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n}\n\n// @publicAPI\nexport interface CentralSceneCCNotificationOptions {\n\tsequenceNumber: number;\n\tkeyAttribute: CentralSceneKeys;\n\tsceneNumber: number;\n\tslowRefresh?: boolean;\n}\n\n@CCCommand(CentralSceneCommand.Notification)\nexport class CentralSceneCCNotification extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCNotificationOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sequenceNumber = options.sequenceNumber;\n\t\tthis.keyAttribute = options.keyAttribute;\n\t\tthis.sceneNumber = options.sceneNumber;\n\t\tthis.slowRefresh = options.slowRefresh;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CentralSceneCCNotification {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst sequenceNumber = raw.payload[0];\n\t\tconst keyAttribute: CentralSceneKeys = raw.payload[1] & 0b111;\n\t\tconst sceneNumber = raw.payload[2];\n\t\tlet slowRefresh: boolean | undefined;\n\t\tif (keyAttribute === CentralSceneKeys.KeyHeldDown) {\n\t\t\t// A receiving node MUST ignore this field if the command is not\n\t\t\t// carrying the Key Held Down key attribute.\n\t\t\tslowRefresh = !!(raw.payload[1] & 0b1000_0000);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsequenceNumber,\n\t\t\tkeyAttribute,\n\t\t\tsceneNumber,\n\t\t\tslowRefresh,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// In case the interview is not yet completed, we still create some basic metadata\n\t\tconst sceneValue = CentralSceneCCValues.scene(this.sceneNumber);\n\t\tthis.ensureMetadata(ctx, sceneValue);\n\n\t\t// The spec behavior is pretty complicated, so we cannot just store\n\t\t// the value and call it a day. Handling of these notifications will\n\t\t// happen in the receiving node class\n\n\t\treturn true;\n\t}\n\n\tpublic readonly sequenceNumber: number;\n\tpublic readonly keyAttribute: CentralSceneKeys;\n\tpublic readonly sceneNumber: number;\n\tpublic readonly slowRefresh: boolean | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sequence number\": this.sequenceNumber,\n\t\t\t\"key attribute\": getEnumMemberName(\n\t\t\t\tCentralSceneKeys,\n\t\t\t\tthis.keyAttribute,\n\t\t\t),\n\t\t\t\"scene number\": this.sceneNumber,\n\t\t};\n\t\tif (this.slowRefresh != undefined) {\n\t\t\tmessage[\"slow refresh\"] = this.slowRefresh;\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 interface CentralSceneCCSupportedReportOptions {\n\tsceneCount: number;\n\tsupportsSlowRefresh: MaybeNotKnown<boolean>;\n\tsupportedKeyAttributes: Record<number, readonly CentralSceneKeys[]>;\n}\n\n@CCCommand(CentralSceneCommand.SupportedReport)\n@ccValueProperty(\"sceneCount\", CentralSceneCCValues.sceneCount)\n@ccValueProperty(\n\t\"supportsSlowRefresh\",\n\tCentralSceneCCValues.supportsSlowRefresh,\n)\n@ccValueProperty(\n\t\"supportedKeyAttributes\",\n\tCentralSceneCCValues.supportedKeyAttributes,\n)\nexport class CentralSceneCCSupportedReport extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sceneCount = options.sceneCount;\n\t\tthis.supportsSlowRefresh = options.supportsSlowRefresh;\n\t\tfor (\n\t\t\tconst [scene, keys] of Object.entries(\n\t\t\t\toptions.supportedKeyAttributes,\n\t\t\t)\n\t\t) {\n\t\t\tthis._supportedKeyAttributes.set(\n\t\t\t\tparseInt(scene),\n\t\t\t\tkeys,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CentralSceneCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst sceneCount = raw.payload[0];\n\t\tconst supportsSlowRefresh: MaybeNotKnown<boolean> =\n\t\t\t!!(raw.payload[1] & 0b1000_0000);\n\t\tconst bitMaskBytes = (raw.payload[1] & 0b110) >>> 1;\n\t\tconst identicalKeyAttributes = !!(raw.payload[1] & 0b1);\n\t\tconst numEntries = identicalKeyAttributes ? 1 : sceneCount;\n\t\tvalidatePayload(raw.payload.length >= 2 + bitMaskBytes * numEntries);\n\t\tconst supportedKeyAttributes: Record<\n\t\t\tnumber,\n\t\t\treadonly CentralSceneKeys[]\n\t\t> = {};\n\t\tfor (let i = 0; i < numEntries; i++) {\n\t\t\tconst mask = raw.payload.subarray(\n\t\t\t\t2 + i * bitMaskBytes,\n\t\t\t\t2 + (i + 1) * bitMaskBytes,\n\t\t\t);\n\t\t\tsupportedKeyAttributes[i + 1] = parseBitMask(\n\t\t\t\tmask,\n\t\t\t\tCentralSceneKeys.KeyPressed,\n\t\t\t);\n\t\t}\n\n\t\tif (identicalKeyAttributes) {\n\t\t\t// The key attributes are only transmitted for scene 1, copy them to the others\n\t\t\tfor (let i = 2; i <= sceneCount; i++) {\n\t\t\t\tsupportedKeyAttributes[i] = supportedKeyAttributes[1];\n\t\t\t}\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsceneCount,\n\t\t\tsupportsSlowRefresh,\n\t\t\tsupportedKeyAttributes,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Create/extend metadata for all scenes\n\t\tfor (let i = 1; i <= this.sceneCount; i++) {\n\t\t\tconst sceneValue = CentralSceneCCValues.scene(i);\n\t\t\tthis.setMetadata(ctx, sceneValue, {\n\t\t\t\t...sceneValue.meta,\n\t\t\t\tstates: enumValuesToMetadataStates(\n\t\t\t\t\tCentralSceneKeys,\n\t\t\t\t\tthis._supportedKeyAttributes.get(i),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic readonly sceneCount: number;\n\n\t// TODO: Only offer `slowRefresh` if this is true\n\n\tpublic readonly supportsSlowRefresh: MaybeNotKnown<boolean>;\n\n\tprivate _supportedKeyAttributes = new Map<\n\t\tnumber,\n\t\treadonly CentralSceneKeys[]\n\t>();\n\n\tpublic get supportedKeyAttributes(): ReadonlyMap<\n\t\tnumber,\n\t\treadonly CentralSceneKeys[]\n\t> {\n\t\treturn this._supportedKeyAttributes;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"scene count\": this.sceneCount,\n\t\t\t\"supports slow refresh\": maybeUnknownToString(\n\t\t\t\tthis.supportsSlowRefresh,\n\t\t\t),\n\t\t};\n\t\tfor (const [scene, keys] of this.supportedKeyAttributes) {\n\t\t\tmessage[`supported attributes (scene #${scene})`] = keys\n\t\t\t\t.map((k) => `\\n\u00B7 ${getEnumMemberName(CentralSceneKeys, k)}`)\n\t\t\t\t.join(\"\");\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(CentralSceneCommand.SupportedGet)\n@expectedCCResponse(CentralSceneCCSupportedReport)\nexport class CentralSceneCCSupportedGet extends CentralSceneCC {}\n\n// @publicAPI\nexport interface CentralSceneCCConfigurationReportOptions {\n\tslowRefresh: boolean;\n}\n\n@CCCommand(CentralSceneCommand.ConfigurationReport)\n@ccValueProperty(\"slowRefresh\", CentralSceneCCValues.slowRefresh)\nexport class CentralSceneCCConfigurationReport extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCConfigurationReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.slowRefresh = options.slowRefresh;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CentralSceneCCConfigurationReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst slowRefresh = !!(raw.payload[0] & 0b1000_0000);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tslowRefresh,\n\t\t});\n\t}\n\n\tpublic readonly slowRefresh: boolean;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"slow refresh\": this.slowRefresh },\n\t\t};\n\t}\n}\n\n@CCCommand(CentralSceneCommand.ConfigurationGet)\n@expectedCCResponse(CentralSceneCCConfigurationReport)\nexport class CentralSceneCCConfigurationGet extends CentralSceneCC {}\n\n// @publicAPI\nexport interface CentralSceneCCConfigurationSetOptions {\n\tslowRefresh: boolean;\n}\n\n@CCCommand(CentralSceneCommand.ConfigurationSet)\n@useSupervision()\nexport class CentralSceneCCConfigurationSet extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCConfigurationSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.slowRefresh = options.slowRefresh;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): CentralSceneCCConfigurationSet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new CentralSceneCCConfigurationSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic slowRefresh: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.slowRefresh ? 0b1000_0000 : 0]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\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: { \"slow refresh\": this.slowRefresh },\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
4
|
+
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tenumValuesToMetadataStates,\n\tgetCCName,\n\tmaybeUnknownToString,\n\tparseBitMask,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport {\n\tCCAPI,\n\tPOLL_VALUE,\n\ttype PollValueImplementation,\n\tSET_VALUE,\n\ttype SetValueImplementation,\n\tthrowUnsupportedProperty,\n\tthrowWrongValueType,\n} 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 { CentralSceneCommand, CentralSceneKeys } from \"../lib/_Types.js\";\nimport * as ccUtils from \"../lib/utils.js\";\n\nexport const CentralSceneCCValues = V.defineCCValues(\n\tCommandClasses[\"Central Scene\"],\n\t{\n\t\t...V.staticProperty(\"sceneCount\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\"supportsSlowRefresh\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\"supportedKeyAttributes\", undefined, {\n\t\t\tinternal: true,\n\t\t}),\n\t\t...V.staticProperty(\n\t\t\t\"slowRefresh\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.Boolean,\n\t\t\t\tlabel: \"Send held down notifications at a slow rate\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"When this is true, KeyHeldDown notifications are sent every 55s. When this is false, the notifications are sent every 200ms.\",\n\t\t\t} as const,\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"scene\",\n\t\t\t\"scene\",\n\t\t\t(sceneNumber: number) => sceneNumber.toString().padStart(3, \"0\"),\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"scene\"\n\t\t\t\t&& typeof propertyKey === \"string\"\n\t\t\t\t&& /^\\d{3}$/.test(propertyKey),\n\t\t\t(sceneNumber: number) => ({\n\t\t\t\t...ValueMetadata.ReadOnlyUInt8,\n\t\t\t\tlabel: `Scene ${sceneNumber.toString().padStart(3, \"0\")}`,\n\t\t\t} as const),\n\t\t\t{ stateful: false } as const,\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Central Scene\"])\nexport class CentralSceneCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: CentralSceneCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase CentralSceneCommand.SupportedGet:\n\t\t\t\treturn this.isSinglecast(); // this is mandatory\n\t\t\tcase CentralSceneCommand.ConfigurationGet:\n\t\t\t\treturn this.version >= 3 && this.isSinglecast();\n\t\t\tcase CentralSceneCommand.ConfigurationSet:\n\t\t\t\treturn this.version >= 3;\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getSupported() {\n\t\tthis.assertSupportsCommand(\n\t\t\tCentralSceneCommand,\n\t\t\tCentralSceneCommand.SupportedGet,\n\t\t);\n\n\t\tconst cc = new CentralSceneCCSupportedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tCentralSceneCCSupportedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\n\t\t\t\t\"sceneCount\",\n\t\t\t\t\"supportsSlowRefresh\",\n\t\t\t\t\"supportedKeyAttributes\",\n\t\t\t]);\n\t\t}\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getConfiguration() {\n\t\tthis.assertSupportsCommand(\n\t\t\tCentralSceneCommand,\n\t\t\tCentralSceneCommand.ConfigurationGet,\n\t\t);\n\n\t\tconst cc = new CentralSceneCCConfigurationGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tCentralSceneCCConfigurationReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"slowRefresh\"]);\n\t\t}\n\t}\n\n\t@validateArgs()\n\tpublic async setConfiguration(\n\t\tslowRefresh: boolean,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tCentralSceneCommand,\n\t\t\tCentralSceneCommand.ConfigurationSet,\n\t\t);\n\n\t\tconst cc = new CentralSceneCCConfigurationSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tslowRefresh,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\tprotected override get [SET_VALUE](): SetValueImplementation {\n\t\treturn async function(this: CentralSceneCCAPI, { property }, value) {\n\t\t\tif (property !== \"slowRefresh\") {\n\t\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t\t}\n\t\t\tif (typeof value !== \"boolean\") {\n\t\t\t\tthrowWrongValueType(\n\t\t\t\t\tthis.ccId,\n\t\t\t\t\tproperty,\n\t\t\t\t\t\"boolean\",\n\t\t\t\t\ttypeof value,\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn this.setConfiguration(value);\n\t\t};\n\t}\n\n\tprotected get [POLL_VALUE](): PollValueImplementation {\n\t\treturn async function(this: CentralSceneCCAPI, { property }) {\n\t\t\tif (property === \"slowRefresh\") {\n\t\t\t\treturn (await this.getConfiguration())?.[property];\n\t\t\t}\n\t\t\tthrowUnsupportedProperty(this.ccId, property);\n\t\t};\n\t}\n}\n\n@commandClass(CommandClasses[\"Central Scene\"])\n@implementedVersion(3)\n@ccValues(CentralSceneCCValues)\nexport class CentralSceneCC extends CommandClass {\n\tdeclare ccCommand: CentralSceneCommand;\n\n\tpublic determineRequiredCCInterviews(): readonly CommandClasses[] {\n\t\treturn [\n\t\t\t...super.determineRequiredCCInterviews(),\n\t\t\tCommandClasses.Association,\n\t\t\tCommandClasses[\"Multi Channel Association\"],\n\t\t\tCommandClasses[\"Association Group Information\"],\n\t\t];\n\t}\n\n\tpublic skipEndpointInterview(): boolean {\n\t\t// Central scene notifications are issued by the root device\n\t\treturn true;\n\t}\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[\"Central Scene\"],\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\t// If one Association group issues CentralScene notifications,\n\t\t// we must associate ourselves with that channel\n\t\ttry {\n\t\t\tawait ccUtils.assignLifelineIssueingCommand(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tthis.ccId,\n\t\t\t\tCentralSceneCommand.Notification,\n\t\t\t);\n\t\t} catch {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: endpoint.index,\n\t\t\t\tmessage: `Configuring associations to receive ${\n\t\t\t\t\tgetCCName(\n\t\t\t\t\t\tthis.ccId,\n\t\t\t\t\t)\n\t\t\t\t} commands failed!`,\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t}\n\n\t\tctx.logNode(node.id, {\n\t\t\tendpoint: this.endpointIndex,\n\t\t\tmessage: \"Querying supported scenes...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst ccSupported = await api.getSupported();\n\t\tif (ccSupported) {\n\t\t\tconst logMessage = `received supported scenes:\n# of scenes: ${ccSupported.sceneCount}\nsupports slow refresh: ${ccSupported.supportsSlowRefresh}`;\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} else {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Querying supported scenes timed out, skipping interview...\",\n\t\t\t\tlevel: \"warn\",\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\t// The slow refresh capability should be enabled whenever possible\n\t\tif (api.version >= 3 && ccSupported?.supportsSlowRefresh) {\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tendpoint: this.endpointIndex,\n\t\t\t\tmessage: \"Enabling slow refresh capability...\",\n\t\t\t\tdirection: \"outbound\",\n\t\t\t});\n\t\t\tawait api.setConfiguration(true);\n\t\t}\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n}\n\n// @publicAPI\nexport interface CentralSceneCCNotificationOptions {\n\tsequenceNumber: number;\n\tkeyAttribute: CentralSceneKeys;\n\tsceneNumber: number;\n\tslowRefresh?: boolean;\n}\n\n@CCCommand(CentralSceneCommand.Notification)\nexport class CentralSceneCCNotification extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCNotificationOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sequenceNumber = options.sequenceNumber;\n\t\tthis.keyAttribute = options.keyAttribute;\n\t\tthis.sceneNumber = options.sceneNumber;\n\t\tthis.slowRefresh = options.slowRefresh;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CentralSceneCCNotification {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst sequenceNumber = raw.payload[0];\n\t\tconst keyAttribute: CentralSceneKeys = raw.payload[1] & 0b111;\n\t\tconst sceneNumber = raw.payload[2];\n\t\tlet slowRefresh: boolean | undefined;\n\t\tif (keyAttribute === CentralSceneKeys.KeyHeldDown) {\n\t\t\t// A receiving node MUST ignore this field if the command is not\n\t\t\t// carrying the Key Held Down key attribute.\n\t\t\tslowRefresh = !!(raw.payload[1] & 0b1000_0000);\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsequenceNumber,\n\t\t\tkeyAttribute,\n\t\t\tsceneNumber,\n\t\t\tslowRefresh,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// In case the interview is not yet completed, we still create some basic metadata\n\t\tconst sceneValue = CentralSceneCCValues.scene(this.sceneNumber);\n\t\tthis.ensureMetadata(ctx, sceneValue);\n\n\t\t// The spec behavior is pretty complicated, so we cannot just store\n\t\t// the value and call it a day. Handling of these notifications will\n\t\t// happen in the receiving node class\n\n\t\treturn true;\n\t}\n\n\tpublic readonly sequenceNumber: number;\n\tpublic readonly keyAttribute: CentralSceneKeys;\n\tpublic readonly sceneNumber: number;\n\tpublic readonly slowRefresh: boolean | undefined;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"sequence number\": this.sequenceNumber,\n\t\t\t\"key attribute\": getEnumMemberName(\n\t\t\t\tCentralSceneKeys,\n\t\t\t\tthis.keyAttribute,\n\t\t\t),\n\t\t\t\"scene number\": this.sceneNumber,\n\t\t};\n\t\tif (this.slowRefresh != undefined) {\n\t\t\tmessage[\"slow refresh\"] = this.slowRefresh;\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 interface CentralSceneCCSupportedReportOptions {\n\tsceneCount: number;\n\tsupportsSlowRefresh: MaybeNotKnown<boolean>;\n\tsupportedKeyAttributes: Record<number, readonly CentralSceneKeys[]>;\n}\n\n@CCCommand(CentralSceneCommand.SupportedReport)\n@ccValueProperty(\"sceneCount\", CentralSceneCCValues.sceneCount)\n@ccValueProperty(\n\t\"supportsSlowRefresh\",\n\tCentralSceneCCValues.supportsSlowRefresh,\n)\n@ccValueProperty(\n\t\"supportedKeyAttributes\",\n\tCentralSceneCCValues.supportedKeyAttributes,\n)\nexport class CentralSceneCCSupportedReport extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCSupportedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.sceneCount = options.sceneCount;\n\t\tthis.supportsSlowRefresh = options.supportsSlowRefresh;\n\t\tfor (\n\t\t\tconst [scene, keys] of Object.entries(\n\t\t\t\toptions.supportedKeyAttributes,\n\t\t\t)\n\t\t) {\n\t\t\tthis._supportedKeyAttributes.set(\n\t\t\t\tparseInt(scene),\n\t\t\t\tkeys,\n\t\t\t);\n\t\t}\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CentralSceneCCSupportedReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst sceneCount = raw.payload[0];\n\t\tconst supportsSlowRefresh: MaybeNotKnown<boolean> =\n\t\t\t!!(raw.payload[1] & 0b1000_0000);\n\t\tconst bitMaskBytes = (raw.payload[1] & 0b110) >>> 1;\n\t\tconst identicalKeyAttributes = !!(raw.payload[1] & 0b1);\n\t\tconst numEntries = identicalKeyAttributes ? 1 : sceneCount;\n\t\tvalidatePayload(raw.payload.length >= 2 + bitMaskBytes * numEntries);\n\t\tconst supportedKeyAttributes: Record<\n\t\t\tnumber,\n\t\t\treadonly CentralSceneKeys[]\n\t\t> = {};\n\t\tfor (let i = 0; i < numEntries; i++) {\n\t\t\tconst mask = raw.payload.subarray(\n\t\t\t\t2 + i * bitMaskBytes,\n\t\t\t\t2 + (i + 1) * bitMaskBytes,\n\t\t\t);\n\t\t\tsupportedKeyAttributes[i + 1] = parseBitMask(\n\t\t\t\tmask,\n\t\t\t\tCentralSceneKeys.KeyPressed,\n\t\t\t);\n\t\t}\n\n\t\tif (identicalKeyAttributes) {\n\t\t\t// The key attributes are only transmitted for scene 1, copy them to the others\n\t\t\tfor (let i = 2; i <= sceneCount; i++) {\n\t\t\t\tsupportedKeyAttributes[i] = supportedKeyAttributes[1];\n\t\t\t}\n\t\t}\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tsceneCount,\n\t\t\tsupportsSlowRefresh,\n\t\t\tsupportedKeyAttributes,\n\t\t});\n\t}\n\n\tpublic persistValues(ctx: PersistValuesContext): boolean {\n\t\tif (!super.persistValues(ctx)) return false;\n\n\t\t// Create/extend metadata for all scenes\n\t\tfor (let i = 1; i <= this.sceneCount; i++) {\n\t\t\tconst sceneValue = CentralSceneCCValues.scene(i);\n\t\t\tthis.setMetadata(ctx, sceneValue, {\n\t\t\t\t...sceneValue.meta,\n\t\t\t\tstates: enumValuesToMetadataStates(\n\t\t\t\t\tCentralSceneKeys,\n\t\t\t\t\tthis._supportedKeyAttributes.get(i),\n\t\t\t\t),\n\t\t\t});\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tpublic readonly sceneCount: number;\n\n\t// TODO: Only offer `slowRefresh` if this is true\n\n\tpublic readonly supportsSlowRefresh: MaybeNotKnown<boolean>;\n\n\tprivate _supportedKeyAttributes = new Map<\n\t\tnumber,\n\t\treadonly CentralSceneKeys[]\n\t>();\n\n\tpublic get supportedKeyAttributes(): ReadonlyMap<\n\t\tnumber,\n\t\treadonly CentralSceneKeys[]\n\t> {\n\t\treturn this._supportedKeyAttributes;\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"scene count\": this.sceneCount,\n\t\t\t\"supports slow refresh\": maybeUnknownToString(\n\t\t\t\tthis.supportsSlowRefresh,\n\t\t\t),\n\t\t};\n\t\tfor (const [scene, keys] of this.supportedKeyAttributes) {\n\t\t\tmessage[`supported attributes (scene #${scene})`] = keys\n\t\t\t\t.map((k) => `\\n\u00B7 ${getEnumMemberName(CentralSceneKeys, k)}`)\n\t\t\t\t.join(\"\");\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(CentralSceneCommand.SupportedGet)\n@expectedCCResponse(CentralSceneCCSupportedReport)\nexport class CentralSceneCCSupportedGet extends CentralSceneCC {}\n\n// @publicAPI\nexport interface CentralSceneCCConfigurationReportOptions {\n\tslowRefresh: boolean;\n}\n\n@CCCommand(CentralSceneCommand.ConfigurationReport)\n@ccValueProperty(\"slowRefresh\", CentralSceneCCValues.slowRefresh)\nexport class CentralSceneCCConfigurationReport extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCConfigurationReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.slowRefresh = options.slowRefresh;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): CentralSceneCCConfigurationReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst slowRefresh = !!(raw.payload[0] & 0b1000_0000);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tslowRefresh,\n\t\t});\n\t}\n\n\tpublic readonly slowRefresh: boolean;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"slow refresh\": this.slowRefresh },\n\t\t};\n\t}\n}\n\n@CCCommand(CentralSceneCommand.ConfigurationGet)\n@expectedCCResponse(CentralSceneCCConfigurationReport)\nexport class CentralSceneCCConfigurationGet extends CentralSceneCC {}\n\n// @publicAPI\nexport interface CentralSceneCCConfigurationSetOptions {\n\tslowRefresh: boolean;\n}\n\n@CCCommand(CentralSceneCommand.ConfigurationSet)\n@useSupervision()\nexport class CentralSceneCCConfigurationSet extends CentralSceneCC {\n\tpublic constructor(\n\t\toptions: WithAddress<CentralSceneCCConfigurationSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.slowRefresh = options.slowRefresh;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): CentralSceneCCConfigurationSet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new CentralSceneCCConfigurationSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic slowRefresh: boolean;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.slowRefresh ? 0b1000_0000 : 0]);\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: { \"slow refresh\": this.slowRefresh },\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAiBO;AACP,IAAAA,eAAsB;AACtB,IAAAA,eAAwC;AAExC,iBAQO;AACP,0BAKO;AACP,oCASO;AACP,oBAAkB;AAClB,mBAAsD;AACtD,cAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyCZ,qBAAiB,MAAA;8BAD7B,mCAAI,2BAAe,eAAe,CAAC,CAAC;;;;oBACE;;;yCAAA,YAAK;WAAA;;;;;;;;AA8D3C,mBAAA,MAAA,MAAA,8BAAA,EAAA,MAAA,UAAA,MAAA,oBAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,sBAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,kBAAb,OA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AAE,gBAAgB,KAAK,YAAW;;IAE7C;;;;IAKY,kCAA8B,MAAA;8BAF1C,yCAAU,iCAAoB,gBAAgB,OAC9C,kDAAmB,iCAAiC,CAAC;;;;oBACF;sDAAA,YAAc;WAAA;;;;;;;;AAAlE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;;;;IASA,kCAA8B,MAAA;8BAF1C,yCAAU,iCAAoB,gBAAgB,OAC9C,8CAAc,CAAE;;;;oBACmC;sDAAA,YAAc;WAAA;;;;;;;;AAAlE,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IACZ,YACC,SAA2D;AAE3D,YAAM,OAAO;AACb,WAAK,cAAc,QAAQ;IAC5B;IAEO,OAAO,KACb,MACA,MAAsB;AAEtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,KAAK,CAAC,KAAK,cAAc,MAAc,CAAC,CAAC;AAC9D,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS,EAAE,gBAAgB,KAAK,YAAW;;IAE7C;;;;",
|
|
6
6
|
"names": ["import_safe"]
|
|
7
7
|
}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type
|
|
1
|
+
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
|
|
2
|
+
import { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type SupervisionResult, type WithAddress } from "@zwave-js/core/safe";
|
|
3
3
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
4
4
|
import { CCAPI } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
|
|
6
6
|
import { ClimateControlScheduleCommand, ScheduleOverrideType, type SetbackState, type Switchpoint, Weekday } from "../lib/_Types.js";
|
|
7
7
|
export declare const ClimateControlScheduleCCValues: Readonly<{
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
readonly
|
|
11
|
-
readonly
|
|
12
|
-
readonly readable: true;
|
|
13
|
-
readonly writeable: true;
|
|
14
|
-
};
|
|
15
|
-
readonly id: {
|
|
16
|
-
commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
17
|
-
property: "schedule";
|
|
18
|
-
propertyKey: Weekday;
|
|
8
|
+
overrideType: {
|
|
9
|
+
id: {
|
|
10
|
+
readonly commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
11
|
+
readonly property: "overrideType";
|
|
19
12
|
};
|
|
20
|
-
|
|
13
|
+
endpoint: (endpoint?: number) => {
|
|
21
14
|
readonly commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
22
15
|
readonly endpoint: number;
|
|
23
|
-
readonly property: "
|
|
24
|
-
readonly propertyKey: Weekday;
|
|
16
|
+
readonly property: "overrideType";
|
|
25
17
|
};
|
|
26
|
-
}) & {
|
|
27
18
|
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
28
|
-
readonly
|
|
19
|
+
readonly meta: {
|
|
20
|
+
readonly label: "Override type";
|
|
21
|
+
readonly states: Record<number, string>;
|
|
22
|
+
readonly type: "number";
|
|
23
|
+
readonly readable: true;
|
|
24
|
+
readonly writeable: true;
|
|
25
|
+
};
|
|
26
|
+
options: {
|
|
29
27
|
readonly internal: false;
|
|
30
28
|
readonly minVersion: 1;
|
|
31
29
|
readonly secret: false;
|
|
@@ -35,16 +33,16 @@ export declare const ClimateControlScheduleCCValues: Readonly<{
|
|
|
35
33
|
};
|
|
36
34
|
};
|
|
37
35
|
overrideState: {
|
|
38
|
-
|
|
39
|
-
commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
40
|
-
property: "overrideState";
|
|
36
|
+
id: {
|
|
37
|
+
readonly commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
38
|
+
readonly property: "overrideState";
|
|
41
39
|
};
|
|
42
|
-
|
|
40
|
+
endpoint: (endpoint?: number) => {
|
|
43
41
|
readonly commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
44
42
|
readonly endpoint: number;
|
|
45
43
|
readonly property: "overrideState";
|
|
46
44
|
};
|
|
47
|
-
|
|
45
|
+
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
48
46
|
readonly meta: {
|
|
49
47
|
readonly label: "Override state";
|
|
50
48
|
readonly min: -12.8;
|
|
@@ -52,7 +50,7 @@ export declare const ClimateControlScheduleCCValues: Readonly<{
|
|
|
52
50
|
readonly readable: true;
|
|
53
51
|
readonly writeable: true;
|
|
54
52
|
};
|
|
55
|
-
|
|
53
|
+
options: {
|
|
56
54
|
readonly internal: false;
|
|
57
55
|
readonly minVersion: 1;
|
|
58
56
|
readonly secret: false;
|
|
@@ -61,27 +59,27 @@ export declare const ClimateControlScheduleCCValues: Readonly<{
|
|
|
61
59
|
readonly autoCreate: true;
|
|
62
60
|
};
|
|
63
61
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
67
|
-
property: "
|
|
62
|
+
schedule: ((weekday: Weekday) => {
|
|
63
|
+
id: {
|
|
64
|
+
readonly commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
65
|
+
readonly property: "schedule";
|
|
66
|
+
readonly propertyKey: Weekday;
|
|
68
67
|
};
|
|
69
|
-
|
|
68
|
+
endpoint: (endpoint?: number) => {
|
|
70
69
|
readonly commandClass: (typeof CommandClasses)["Climate Control Schedule"];
|
|
71
70
|
readonly endpoint: number;
|
|
72
|
-
readonly property: "
|
|
71
|
+
readonly property: "schedule";
|
|
72
|
+
readonly propertyKey: Weekday;
|
|
73
73
|
};
|
|
74
|
-
readonly is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
75
74
|
readonly meta: {
|
|
76
|
-
readonly label:
|
|
77
|
-
readonly
|
|
78
|
-
[x: number]: string;
|
|
79
|
-
};
|
|
80
|
-
readonly type: "number";
|
|
75
|
+
readonly label: `Schedule (${string})`;
|
|
76
|
+
readonly type: "any";
|
|
81
77
|
readonly readable: true;
|
|
82
78
|
readonly writeable: true;
|
|
83
79
|
};
|
|
84
|
-
|
|
80
|
+
}) & {
|
|
81
|
+
is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
82
|
+
options: {
|
|
85
83
|
readonly internal: false;
|
|
86
84
|
readonly minVersion: 1;
|
|
87
85
|
readonly secret: false;
|
|
@@ -114,7 +112,7 @@ export declare class ClimateControlScheduleCCSet extends ClimateControlScheduleC
|
|
|
114
112
|
static from(_raw: CCRaw, _ctx: CCParsingContext): ClimateControlScheduleCCSet;
|
|
115
113
|
switchPoints: Switchpoint[];
|
|
116
114
|
weekday: Weekday;
|
|
117
|
-
serialize(ctx: CCEncodingContext): Bytes
|
|
115
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
118
116
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
119
117
|
}
|
|
120
118
|
export interface ClimateControlScheduleCCReportOptions {
|
|
@@ -135,7 +133,7 @@ export declare class ClimateControlScheduleCCGet extends ClimateControlScheduleC
|
|
|
135
133
|
constructor(options: WithAddress<ClimateControlScheduleCCGetOptions>);
|
|
136
134
|
static from(_raw: CCRaw, _ctx: CCParsingContext): ClimateControlScheduleCCGet;
|
|
137
135
|
weekday: Weekday;
|
|
138
|
-
serialize(ctx: CCEncodingContext): Bytes
|
|
136
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
139
137
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
140
138
|
}
|
|
141
139
|
export interface ClimateControlScheduleCCChangedReportOptions {
|
|
@@ -171,7 +169,7 @@ export declare class ClimateControlScheduleCCOverrideSet extends ClimateControlS
|
|
|
171
169
|
static from(_raw: CCRaw, _ctx: CCParsingContext): ClimateControlScheduleCCOverrideSet;
|
|
172
170
|
overrideType: ScheduleOverrideType;
|
|
173
171
|
overrideState: SetbackState;
|
|
174
|
-
serialize(ctx: CCEncodingContext): Bytes
|
|
172
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
175
173
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
176
174
|
}
|
|
177
175
|
//# sourceMappingURL=ClimateControlScheduleCC.d.ts.map
|
|
@@ -39,7 +39,7 @@ __export(ClimateControlScheduleCC_exports, {
|
|
|
39
39
|
ClimateControlScheduleCCOverrideSet: () => ClimateControlScheduleCCOverrideSet,
|
|
40
40
|
ClimateControlScheduleCCReport: () => ClimateControlScheduleCCReport,
|
|
41
41
|
ClimateControlScheduleCCSet: () => ClimateControlScheduleCCSet,
|
|
42
|
-
ClimateControlScheduleCCValues: () => ClimateControlScheduleCCValues
|
|
42
|
+
ClimateControlScheduleCCValues: () => import_CCValues_generated.ClimateControlScheduleCCValues
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(ClimateControlScheduleCC_exports);
|
|
45
45
|
var __validateArgs = __toESM(require("./ClimateControlScheduleCC._validateArgs.js"), 1);
|
|
@@ -52,6 +52,7 @@ var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
|
52
52
|
var import_Values = require("../lib/Values.js");
|
|
53
53
|
var import_Types = require("../lib/_Types.js");
|
|
54
54
|
var import_serializers = require("../lib/serializers.js");
|
|
55
|
+
var import_CCValues_generated = require("./_CCValues.generated.js");
|
|
55
56
|
var __runInitializers = function(thisArg, initializers, value) {
|
|
56
57
|
var useValue = arguments.length > 2;
|
|
57
58
|
for (var i = 0; i < initializers.length; i++) {
|
|
@@ -93,26 +94,6 @@ var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializ
|
|
|
93
94
|
done = true;
|
|
94
95
|
};
|
|
95
96
|
const { validateArgs_ClimateControlScheduleCCAPI_set, validateArgs_ClimateControlScheduleCCAPI_get, validateArgs_ClimateControlScheduleCCAPI_setOverride } = __validateArgs;
|
|
96
|
-
const ClimateControlScheduleCCValues = Object.freeze({
|
|
97
|
-
...import_Values.V.defineStaticCCValues(import_safe.CommandClasses["Climate Control Schedule"], {
|
|
98
|
-
...import_Values.V.staticProperty("overrideType", {
|
|
99
|
-
...import_safe.ValueMetadata.Number,
|
|
100
|
-
label: "Override type",
|
|
101
|
-
states: (0, import_safe.enumValuesToMetadataStates)(import_Types.ScheduleOverrideType)
|
|
102
|
-
}),
|
|
103
|
-
...import_Values.V.staticProperty("overrideState", {
|
|
104
|
-
...import_safe.ValueMetadata.Number,
|
|
105
|
-
label: "Override state",
|
|
106
|
-
min: -12.8
|
|
107
|
-
})
|
|
108
|
-
}),
|
|
109
|
-
...import_Values.V.defineDynamicCCValues(import_safe.CommandClasses["Climate Control Schedule"], {
|
|
110
|
-
...import_Values.V.dynamicPropertyAndKeyWithName("schedule", "schedule", (weekday) => weekday, ({ property, propertyKey }) => property === "switchPoints" && typeof propertyKey === "number" && propertyKey >= import_Types.Weekday.Monday && propertyKey <= import_Types.Weekday.Sunday, (weekday) => ({
|
|
111
|
-
...import_safe.ValueMetadata.Any,
|
|
112
|
-
label: `Schedule (${(0, import_safe3.getEnumMemberName)(import_Types.Weekday, weekday)})`
|
|
113
|
-
}))
|
|
114
|
-
})
|
|
115
|
-
});
|
|
116
97
|
let ClimateControlScheduleCCAPI = (() => {
|
|
117
98
|
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Climate Control Schedule"])];
|
|
118
99
|
let _classDescriptor;
|
|
@@ -218,7 +199,7 @@ let ClimateControlScheduleCCAPI = (() => {
|
|
|
218
199
|
return ClimateControlScheduleCCAPI2 = _classThis;
|
|
219
200
|
})();
|
|
220
201
|
let ClimateControlScheduleCC = (() => {
|
|
221
|
-
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Climate Control Schedule"]), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(ClimateControlScheduleCCValues)];
|
|
202
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Climate Control Schedule"]), (0, import_CommandClassDecorators.implementedVersion)(1), (0, import_CommandClassDecorators.ccValues)(import_CCValues_generated.ClimateControlScheduleCCValues)];
|
|
222
203
|
let _classDescriptor;
|
|
223
204
|
let _classExtraInitializers = [];
|
|
224
205
|
let _classThis;
|
|
@@ -299,7 +280,7 @@ let ClimateControlScheduleCCSet = (() => {
|
|
|
299
280
|
return ClimateControlScheduleCCSet2 = _classThis;
|
|
300
281
|
})();
|
|
301
282
|
let ClimateControlScheduleCCReport = (() => {
|
|
302
|
-
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ClimateControlScheduleCommand.Report), (0, import_CommandClassDecorators.ccValueProperty)("schedule", ClimateControlScheduleCCValues.schedule, (self) => [self.weekday])];
|
|
283
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ClimateControlScheduleCommand.Report), (0, import_CommandClassDecorators.ccValueProperty)("schedule", import_CCValues_generated.ClimateControlScheduleCCValues.schedule, (self) => [self.weekday])];
|
|
303
284
|
let _classDescriptor;
|
|
304
285
|
let _classExtraInitializers = [];
|
|
305
286
|
let _classThis;
|
|
@@ -459,7 +440,7 @@ let ClimateControlScheduleCCChangedGet = (() => {
|
|
|
459
440
|
return ClimateControlScheduleCCChangedGet2 = _classThis;
|
|
460
441
|
})();
|
|
461
442
|
let ClimateControlScheduleCCOverrideReport = (() => {
|
|
462
|
-
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ClimateControlScheduleCommand.OverrideReport), (0, import_CommandClassDecorators.ccValueProperty)("overrideType", ClimateControlScheduleCCValues.overrideType), (0, import_CommandClassDecorators.ccValueProperty)("overrideState", ClimateControlScheduleCCValues.overrideState)];
|
|
443
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.ClimateControlScheduleCommand.OverrideReport), (0, import_CommandClassDecorators.ccValueProperty)("overrideType", import_CCValues_generated.ClimateControlScheduleCCValues.overrideType), (0, import_CommandClassDecorators.ccValueProperty)("overrideState", import_CCValues_generated.ClimateControlScheduleCCValues.overrideState)];
|
|
463
444
|
let _classDescriptor;
|
|
464
445
|
let _classExtraInitializers = [];
|
|
465
446
|
let _classThis;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/ClimateControlScheduleCC.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tenumValuesToMetadataStates,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } 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\tClimateControlScheduleCommand,\n\tScheduleOverrideType,\n\ttype SetbackState,\n\ttype Switchpoint,\n\tWeekday,\n} from \"../lib/_Types.js\";\nimport {\n\tdecodeSetbackState,\n\tdecodeSwitchpoint,\n\tencodeSetbackState,\n\tencodeSwitchpoint,\n} from \"../lib/serializers.js\";\n\nexport const ClimateControlScheduleCCValues = Object.freeze({\n\t...V.defineStaticCCValues(CommandClasses[\"Climate Control Schedule\"], {\n\t\t...V.staticProperty(\n\t\t\t\"overrideType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.Number,\n\t\t\t\tlabel: \"Override type\",\n\t\t\t\tstates: enumValuesToMetadataStates(ScheduleOverrideType),\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"overrideState\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.Number,\n\t\t\t\tlabel: \"Override state\",\n\t\t\t\tmin: -12.8,\n\t\t\t} as const,\n\t\t),\n\t}),\n\n\t...V.defineDynamicCCValues(CommandClasses[\"Climate Control Schedule\"], {\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"schedule\",\n\t\t\t\"schedule\",\n\t\t\t(weekday: Weekday) => weekday,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"switchPoints\"\n\t\t\t\t&& typeof propertyKey === \"number\"\n\t\t\t\t&& propertyKey >= Weekday.Monday\n\t\t\t\t&& propertyKey <= Weekday.Sunday,\n\t\t\t(weekday: Weekday) => ({\n\t\t\t\t...ValueMetadata.Any,\n\t\t\t\tlabel: `Schedule (${getEnumMemberName(Weekday, weekday)})`,\n\t\t\t} as const),\n\t\t),\n\t}),\n});\n\n@API(CommandClasses[\"Climate Control Schedule\"])\nexport class ClimateControlScheduleCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ClimateControlScheduleCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ClimateControlScheduleCommand.Set:\n\t\t\tcase ClimateControlScheduleCommand.OverrideSet:\n\t\t\t\treturn true; // mandatory\n\t\t\tcase ClimateControlScheduleCommand.Get:\n\t\t\tcase ClimateControlScheduleCommand.ChangedGet:\n\t\t\tcase ClimateControlScheduleCommand.OverrideGet:\n\t\t\t\treturn this.isSinglecast();\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async set(\n\t\tweekday: Weekday,\n\t\tswitchPoints: Switchpoint[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.Set,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tweekday,\n\t\t\tswitchPoints,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async get(\n\t\tweekday: Weekday,\n\t): Promise<MaybeNotKnown<readonly Switchpoint[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.Get,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tweekday,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tClimateControlScheduleCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.schedule;\n\t}\n\n\tpublic async getChangeCounter(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.ChangedGet,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCChangedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tClimateControlScheduleCCChangedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.changeCounter;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getOverride() {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.OverrideGet,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCOverrideGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tClimateControlScheduleCCOverrideReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn {\n\t\t\t\ttype: response.overrideType,\n\t\t\t\tstate: response.overrideState,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async setOverride(\n\t\ttype: ScheduleOverrideType,\n\t\tstate: SetbackState,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.OverrideSet,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCOverrideSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\toverrideType: type,\n\t\t\toverrideState: state,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Climate Control Schedule\"])\n@implementedVersion(1)\n@ccValues(ClimateControlScheduleCCValues)\nexport class ClimateControlScheduleCC extends CommandClass {\n\tdeclare ccCommand: ClimateControlScheduleCommand;\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCSetOptions {\n\tweekday: Weekday;\n\tswitchPoints: Switchpoint[];\n}\n\n@CCCommand(ClimateControlScheduleCommand.Set)\n@useSupervision()\nexport class ClimateControlScheduleCCSet extends ClimateControlScheduleCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.switchPoints = options.switchPoints;\n\t\tthis.weekday = options.weekday;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ClimateControlScheduleCCSet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClimateControlScheduleCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic switchPoints: Switchpoint[];\n\tpublic weekday: Weekday;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\t// Make sure we have exactly 9 entries\n\t\tconst allSwitchPoints = this.switchPoints.slice(0, 9); // maximum 9\n\t\twhile (allSwitchPoints.length < 9) {\n\t\t\tallSwitchPoints.push({\n\t\t\t\thour: 0,\n\t\t\t\tminute: 0,\n\t\t\t\tstate: \"Unused\",\n\t\t\t});\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.weekday & 0b111]),\n\t\t\t...allSwitchPoints.map((sp) => encodeSwitchpoint(sp)),\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\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\tweekday: getEnumMemberName(Weekday, this.weekday),\n\t\t\t\tswitchpoints: `${\n\t\t\t\t\tthis.switchPoints\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(sp) => `\n\u00B7 ${sp.hour.toString().padStart(2, \"0\")}:${\n\t\t\t\t\t\t\t\tsp.minute.toString().padStart(\n\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t\"0\",\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t} --> ${sp.state}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCReportOptions {\n\tweekday: Weekday;\n\tschedule: Switchpoint[];\n}\n\n@CCCommand(ClimateControlScheduleCommand.Report)\n@ccValueProperty(\n\t\"schedule\",\n\tClimateControlScheduleCCValues.schedule,\n\t(self) => [self.weekday],\n)\nexport class ClimateControlScheduleCCReport extends ClimateControlScheduleCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.weekday = options.weekday;\n\t\tthis.schedule = options.schedule;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ClimateControlScheduleCCReport {\n\t\tvalidatePayload(raw.payload.length >= 28);\n\t\tconst weekday: Weekday = raw.payload[0] & 0b111;\n\t\tconst allSwitchpoints: Switchpoint[] = [];\n\t\tfor (let i = 0; i <= 8; i++) {\n\t\t\tallSwitchpoints.push(\n\t\t\t\tdecodeSwitchpoint(raw.payload.subarray(1 + 3 * i)),\n\t\t\t);\n\t\t}\n\n\t\tconst schedule: Switchpoint[] = allSwitchpoints.filter((sp) =>\n\t\t\tsp.state !== \"Unused\"\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tweekday,\n\t\t\tschedule,\n\t\t});\n\t}\n\n\tpublic readonly weekday: Weekday;\n\n\tpublic readonly schedule: readonly Switchpoint[];\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\tweekday: getEnumMemberName(Weekday, this.weekday),\n\t\t\t\tschedule: `${\n\t\t\t\t\tthis.schedule\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(sp) => `\n\u00B7 ${sp.hour.toString().padStart(2, \"0\")}:${\n\t\t\t\t\t\t\t\tsp.minute.toString().padStart(\n\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t\"0\",\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t} --> ${sp.state}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCGetOptions {\n\tweekday: Weekday;\n}\n\n@CCCommand(ClimateControlScheduleCommand.Get)\n@expectedCCResponse(ClimateControlScheduleCCReport)\nexport class ClimateControlScheduleCCGet extends ClimateControlScheduleCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.weekday = options.weekday;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ClimateControlScheduleCCGet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClimateControlScheduleCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic weekday: Weekday;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.from([this.weekday & 0b111]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\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: { weekday: getEnumMemberName(Weekday, this.weekday) },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCChangedReportOptions {\n\tchangeCounter: number;\n}\n\n@CCCommand(ClimateControlScheduleCommand.ChangedReport)\nexport class ClimateControlScheduleCCChangedReport\n\textends ClimateControlScheduleCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCChangedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.changeCounter = options.changeCounter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ClimateControlScheduleCCChangedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst changeCounter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tchangeCounter,\n\t\t});\n\t}\n\n\tpublic readonly changeCounter: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"change counter\": this.changeCounter },\n\t\t};\n\t}\n}\n\n@CCCommand(ClimateControlScheduleCommand.ChangedGet)\n@expectedCCResponse(ClimateControlScheduleCCChangedReport)\nexport class ClimateControlScheduleCCChangedGet\n\textends ClimateControlScheduleCC\n{}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCOverrideReportOptions {\n\toverrideType: ScheduleOverrideType;\n\toverrideState: SetbackState;\n}\n\n@CCCommand(ClimateControlScheduleCommand.OverrideReport)\n@ccValueProperty(\"overrideType\", ClimateControlScheduleCCValues.overrideType)\n@ccValueProperty(\"overrideState\", ClimateControlScheduleCCValues.overrideState)\nexport class ClimateControlScheduleCCOverrideReport\n\textends ClimateControlScheduleCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCOverrideReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.overrideType = options.overrideType;\n\t\tthis.overrideState = options.overrideState;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ClimateControlScheduleCCOverrideReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst overrideType: ScheduleOverrideType = raw.payload[0] & 0b11;\n\t\tconst overrideState: SetbackState = decodeSetbackState(raw.payload, 1)\n\t\t\t// If we receive an unknown setback state, return the raw value\n\t\t\t|| raw.payload.readInt8(1);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\toverrideType,\n\t\t\toverrideState,\n\t\t});\n\t}\n\n\tpublic readonly overrideType: ScheduleOverrideType;\n\n\tpublic readonly overrideState: SetbackState;\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\"override type\": getEnumMemberName(\n\t\t\t\t\tScheduleOverrideType,\n\t\t\t\t\tthis.overrideType,\n\t\t\t\t),\n\t\t\t\t\"override state\": this.overrideState,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ClimateControlScheduleCommand.OverrideGet)\n@expectedCCResponse(ClimateControlScheduleCCOverrideReport)\nexport class ClimateControlScheduleCCOverrideGet\n\textends ClimateControlScheduleCC\n{}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCOverrideSetOptions {\n\toverrideType: ScheduleOverrideType;\n\toverrideState: SetbackState;\n}\n\n@CCCommand(ClimateControlScheduleCommand.OverrideSet)\n@useSupervision()\nexport class ClimateControlScheduleCCOverrideSet\n\textends ClimateControlScheduleCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCOverrideSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.overrideType = options.overrideType;\n\t\tthis.overrideState = options.overrideState;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ClimateControlScheduleCCOverrideSet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClimateControlScheduleCCOverrideSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic overrideType: ScheduleOverrideType;\n\tpublic overrideState: SetbackState;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.concat([\n\t\t\t[this.overrideType & 0b11],\n\t\t\tencodeSetbackState(this.overrideState),\n\t\t]);\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\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\"override type\": getEnumMemberName(\n\t\t\t\t\tScheduleOverrideType,\n\t\t\t\t\tthis.overrideType,\n\t\t\t\t),\n\t\t\t\t\"override state\": this.overrideState,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
4
|
+
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport {\n\tCommandClasses,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\ttype SupervisionResult,\n\tValueMetadata,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tenumValuesToMetadataStates,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } 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\tClimateControlScheduleCommand,\n\tScheduleOverrideType,\n\ttype SetbackState,\n\ttype Switchpoint,\n\tWeekday,\n} from \"../lib/_Types.js\";\nimport {\n\tdecodeSetbackState,\n\tdecodeSwitchpoint,\n\tencodeSetbackState,\n\tencodeSwitchpoint,\n} from \"../lib/serializers.js\";\n\nexport const ClimateControlScheduleCCValues = V.defineCCValues(\n\tCommandClasses[\"Climate Control Schedule\"],\n\t{\n\t\t...V.staticProperty(\n\t\t\t\"overrideType\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.Number,\n\t\t\t\tlabel: \"Override type\",\n\t\t\t\tstates: enumValuesToMetadataStates(ScheduleOverrideType),\n\t\t\t} as const,\n\t\t),\n\t\t...V.staticProperty(\n\t\t\t\"overrideState\",\n\t\t\t{\n\t\t\t\t...ValueMetadata.Number,\n\t\t\t\tlabel: \"Override state\",\n\t\t\t\tmin: -12.8,\n\t\t\t} as const,\n\t\t),\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"schedule\",\n\t\t\t\"schedule\",\n\t\t\t(weekday: Weekday) => weekday,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"switchPoints\"\n\t\t\t\t&& typeof propertyKey === \"number\"\n\t\t\t\t&& propertyKey >= Weekday.Monday\n\t\t\t\t&& propertyKey <= Weekday.Sunday,\n\t\t\t(weekday: Weekday) => ({\n\t\t\t\t...ValueMetadata.Any,\n\t\t\t\tlabel: `Schedule (${getEnumMemberName(Weekday, weekday)})`,\n\t\t\t} as const),\n\t\t),\n\t},\n);\n\n@API(CommandClasses[\"Climate Control Schedule\"])\nexport class ClimateControlScheduleCCAPI extends CCAPI {\n\tpublic supportsCommand(\n\t\tcmd: ClimateControlScheduleCommand,\n\t): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ClimateControlScheduleCommand.Set:\n\t\t\tcase ClimateControlScheduleCommand.OverrideSet:\n\t\t\t\treturn true; // mandatory\n\t\t\tcase ClimateControlScheduleCommand.Get:\n\t\t\tcase ClimateControlScheduleCommand.ChangedGet:\n\t\t\tcase ClimateControlScheduleCommand.OverrideGet:\n\t\t\t\treturn this.isSinglecast();\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async set(\n\t\tweekday: Weekday,\n\t\tswitchPoints: Switchpoint[],\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.Set,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tweekday,\n\t\t\tswitchPoints,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async get(\n\t\tweekday: Weekday,\n\t): Promise<MaybeNotKnown<readonly Switchpoint[]>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.Get,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\tweekday,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tClimateControlScheduleCCReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.schedule;\n\t}\n\n\tpublic async getChangeCounter(): Promise<MaybeNotKnown<number>> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.ChangedGet,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCChangedGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tClimateControlScheduleCCChangedReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\treturn response?.changeCounter;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async getOverride() {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.OverrideGet,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCOverrideGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<\n\t\t\tClimateControlScheduleCCOverrideReport\n\t\t>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn {\n\t\t\t\ttype: response.overrideType,\n\t\t\t\tstate: response.overrideState,\n\t\t\t};\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async setOverride(\n\t\ttype: ScheduleOverrideType,\n\t\tstate: SetbackState,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(\n\t\t\tClimateControlScheduleCommand,\n\t\t\tClimateControlScheduleCommand.OverrideSet,\n\t\t);\n\n\t\tconst cc = new ClimateControlScheduleCCOverrideSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\toverrideType: type,\n\t\t\toverrideState: state,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses[\"Climate Control Schedule\"])\n@implementedVersion(1)\n@ccValues(ClimateControlScheduleCCValues)\nexport class ClimateControlScheduleCC extends CommandClass {\n\tdeclare ccCommand: ClimateControlScheduleCommand;\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCSetOptions {\n\tweekday: Weekday;\n\tswitchPoints: Switchpoint[];\n}\n\n@CCCommand(ClimateControlScheduleCommand.Set)\n@useSupervision()\nexport class ClimateControlScheduleCCSet extends ClimateControlScheduleCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.switchPoints = options.switchPoints;\n\t\tthis.weekday = options.weekday;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ClimateControlScheduleCCSet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClimateControlScheduleCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic switchPoints: Switchpoint[];\n\tpublic weekday: Weekday;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\t// Make sure we have exactly 9 entries\n\t\tconst allSwitchPoints = this.switchPoints.slice(0, 9); // maximum 9\n\t\twhile (allSwitchPoints.length < 9) {\n\t\t\tallSwitchPoints.push({\n\t\t\t\thour: 0,\n\t\t\t\tminute: 0,\n\t\t\t\tstate: \"Unused\",\n\t\t\t});\n\t\t}\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([this.weekday & 0b111]),\n\t\t\t...allSwitchPoints.map((sp) => encodeSwitchpoint(sp)),\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\tweekday: getEnumMemberName(Weekday, this.weekday),\n\t\t\t\tswitchpoints: `${\n\t\t\t\t\tthis.switchPoints\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(sp) => `\n\u00B7 ${sp.hour.toString().padStart(2, \"0\")}:${\n\t\t\t\t\t\t\t\tsp.minute.toString().padStart(\n\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t\"0\",\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t} --> ${sp.state}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCReportOptions {\n\tweekday: Weekday;\n\tschedule: Switchpoint[];\n}\n\n@CCCommand(ClimateControlScheduleCommand.Report)\n@ccValueProperty(\n\t\"schedule\",\n\tClimateControlScheduleCCValues.schedule,\n\t(self) => [self.weekday],\n)\nexport class ClimateControlScheduleCCReport extends ClimateControlScheduleCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.weekday = options.weekday;\n\t\tthis.schedule = options.schedule;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ClimateControlScheduleCCReport {\n\t\tvalidatePayload(raw.payload.length >= 28);\n\t\tconst weekday: Weekday = raw.payload[0] & 0b111;\n\t\tconst allSwitchpoints: Switchpoint[] = [];\n\t\tfor (let i = 0; i <= 8; i++) {\n\t\t\tallSwitchpoints.push(\n\t\t\t\tdecodeSwitchpoint(raw.payload.subarray(1 + 3 * i)),\n\t\t\t);\n\t\t}\n\n\t\tconst schedule: Switchpoint[] = allSwitchpoints.filter((sp) =>\n\t\t\tsp.state !== \"Unused\"\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tweekday,\n\t\t\tschedule,\n\t\t});\n\t}\n\n\tpublic readonly weekday: Weekday;\n\n\tpublic readonly schedule: readonly Switchpoint[];\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\tweekday: getEnumMemberName(Weekday, this.weekday),\n\t\t\t\tschedule: `${\n\t\t\t\t\tthis.schedule\n\t\t\t\t\t\t.map(\n\t\t\t\t\t\t\t(sp) => `\n\u00B7 ${sp.hour.toString().padStart(2, \"0\")}:${\n\t\t\t\t\t\t\t\tsp.minute.toString().padStart(\n\t\t\t\t\t\t\t\t\t2,\n\t\t\t\t\t\t\t\t\t\"0\",\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t} --> ${sp.state}`,\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.join(\"\")\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCGetOptions {\n\tweekday: Weekday;\n}\n\n@CCCommand(ClimateControlScheduleCommand.Get)\n@expectedCCResponse(ClimateControlScheduleCCReport)\nexport class ClimateControlScheduleCCGet extends ClimateControlScheduleCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.weekday = options.weekday;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ClimateControlScheduleCCGet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClimateControlScheduleCCGet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic weekday: Weekday;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([this.weekday & 0b111]);\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: { weekday: getEnumMemberName(Weekday, this.weekday) },\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCChangedReportOptions {\n\tchangeCounter: number;\n}\n\n@CCCommand(ClimateControlScheduleCommand.ChangedReport)\nexport class ClimateControlScheduleCCChangedReport\n\textends ClimateControlScheduleCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCChangedReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.changeCounter = options.changeCounter;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ClimateControlScheduleCCChangedReport {\n\t\tvalidatePayload(raw.payload.length >= 1);\n\t\tconst changeCounter = raw.payload[0];\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tchangeCounter,\n\t\t});\n\t}\n\n\tpublic readonly changeCounter: number;\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage: { \"change counter\": this.changeCounter },\n\t\t};\n\t}\n}\n\n@CCCommand(ClimateControlScheduleCommand.ChangedGet)\n@expectedCCResponse(ClimateControlScheduleCCChangedReport)\nexport class ClimateControlScheduleCCChangedGet\n\textends ClimateControlScheduleCC\n{}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCOverrideReportOptions {\n\toverrideType: ScheduleOverrideType;\n\toverrideState: SetbackState;\n}\n\n@CCCommand(ClimateControlScheduleCommand.OverrideReport)\n@ccValueProperty(\"overrideType\", ClimateControlScheduleCCValues.overrideType)\n@ccValueProperty(\"overrideState\", ClimateControlScheduleCCValues.overrideState)\nexport class ClimateControlScheduleCCOverrideReport\n\textends ClimateControlScheduleCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCOverrideReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.overrideType = options.overrideType;\n\t\tthis.overrideState = options.overrideState;\n\t}\n\n\tpublic static from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): ClimateControlScheduleCCOverrideReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst overrideType: ScheduleOverrideType = raw.payload[0] & 0b11;\n\t\tconst overrideState: SetbackState = decodeSetbackState(raw.payload, 1)\n\t\t\t// If we receive an unknown setback state, return the raw value\n\t\t\t|| raw.payload.readInt8(1);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\toverrideType,\n\t\t\toverrideState,\n\t\t});\n\t}\n\n\tpublic readonly overrideType: ScheduleOverrideType;\n\n\tpublic readonly overrideState: SetbackState;\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\"override type\": getEnumMemberName(\n\t\t\t\t\tScheduleOverrideType,\n\t\t\t\t\tthis.overrideType,\n\t\t\t\t),\n\t\t\t\t\"override state\": this.overrideState,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ClimateControlScheduleCommand.OverrideGet)\n@expectedCCResponse(ClimateControlScheduleCCOverrideReport)\nexport class ClimateControlScheduleCCOverrideGet\n\textends ClimateControlScheduleCC\n{}\n\n// @publicAPI\nexport interface ClimateControlScheduleCCOverrideSetOptions {\n\toverrideType: ScheduleOverrideType;\n\toverrideState: SetbackState;\n}\n\n@CCCommand(ClimateControlScheduleCommand.OverrideSet)\n@useSupervision()\nexport class ClimateControlScheduleCCOverrideSet\n\textends ClimateControlScheduleCC\n{\n\tpublic constructor(\n\t\toptions: WithAddress<ClimateControlScheduleCCOverrideSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.overrideType = options.overrideType;\n\t\tthis.overrideState = options.overrideState;\n\t}\n\n\tpublic static from(\n\t\t_raw: CCRaw,\n\t\t_ctx: CCParsingContext,\n\t): ClimateControlScheduleCCOverrideSet {\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClimateControlScheduleCCOverrideSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic overrideType: ScheduleOverrideType;\n\tpublic overrideState: SetbackState;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.concat([\n\t\t\t[this.overrideType & 0b11],\n\t\t\tencodeSetbackState(this.overrideState),\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\"override type\": getEnumMemberName(\n\t\t\t\t\tScheduleOverrideType,\n\t\t\t\t\tthis.overrideType,\n\t\t\t\t),\n\t\t\t\t\"override state\": this.overrideState,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kBAYO;AACP,IAAAA,eAAsB;AACtB,IAAAA,eAAkC;AAElC,iBAAsB;AACtB,0BAAyC;AACzC,oCASO;AACP,oBAAkB;AAClB,mBAMO;AACP,yBAKO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuCM,+BAA2B,MAAA;8BADvC,mCAAI,2BAAe,0BAA0B,CAAC,CAAC;;;;oBACC;;;;;mDAAA,YAAK;WAAA;;;;;;;;yBAgBpD,6CAAa,EAAE,aAAa,KAAI,CAAE,CAAC;yBAmBnC,6CAAa,EAAE,aAAa,KAAI,CAAE,CAAC;iCAmEnC,qDAAa,EAAE,aAAa,KAAI,CAAE,CAAC;AArFpC,mBAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA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;;;AAAa,wBAAA,YAAA,uBAAA;;;;;IAYA,uCAAmC,MAAA;8BAF/C,yCAAU,2CAA8B,WAAW,OACnD,8CAAc,CAAE;;;;oBAER;2DAAA,YAAwB;WAAA;;;;;;;;AADjC,mBAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,wBAAA,YAAA,uBAAA;;IAGZ,YACC,SAAgE;AAEhE,YAAM,OAAO;AACb,WAAK,eAAe,QAAQ;AAC5B,WAAK,gBAAgB,QAAQ;IAC9B;IAEO,OAAO,KACb,MACA,MAAsB;AAEtB,YAAM,IAAI,uBACT,GAAG,KAAK,IAAI,qCACZ,4BAAgB,8BAA8B;IAMhD;IAEO;IACA;IAEA,UAAU,KAAsB;AACtC,WAAK,UAAU,mBAAM,OAAO;QAC3B,CAAC,KAAK,eAAe,CAAI;YACzB,uCAAmB,KAAK,aAAa;OACrC;AACD,aAAO,MAAM,UAAU,GAAG;IAC3B;IAEO,WAAW,KAAgB;AACjC,aAAO;QACN,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACR,qBAAiB,gCAChB,mCACA,KAAK,YAAY;UAElB,kBAAkB,KAAK;;;IAG1B;;;;",
|
|
6
6
|
"names": ["import_safe"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
|
|
2
|
+
import type { GetValueDB, MessageOrCCLogEntry, SupervisionResult, WithAddress } from "@zwave-js/core/safe";
|
|
2
3
|
import { type MaybeNotKnown } from "@zwave-js/core/safe";
|
|
3
|
-
import type { CCEncodingContext, CCParsingContext, GetValueDB } from "@zwave-js/host/safe";
|
|
4
4
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
5
5
|
import { CCAPI } from "../lib/API.js";
|
|
6
6
|
import { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
@@ -26,7 +26,7 @@ export declare class ClockCCSet extends ClockCC {
|
|
|
26
26
|
weekday: Weekday;
|
|
27
27
|
hour: number;
|
|
28
28
|
minute: number;
|
|
29
|
-
serialize(ctx: CCEncodingContext): Bytes
|
|
29
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
30
30
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
31
31
|
}
|
|
32
32
|
export interface ClockCCReportOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/ClockCC.ts"],
|
|
4
|
-
"sourcesContent": ["import type {\n\tMessageOrCCLogEntry,\n\tSupervisionResult,\n\tWithAddress,\n} from \"@zwave-js/core/safe\";\nimport {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\tMessagePriority,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
4
|
+
"sourcesContent": ["import { type CCEncodingContext, type CCParsingContext } from \"@zwave-js/cc\";\nimport type {\n\tGetValueDB,\n\tMessageOrCCLogEntry,\n\tSupervisionResult,\n\tWithAddress,\n} from \"@zwave-js/core/safe\";\nimport {\n\tCommandClasses,\n\ttype MaybeNotKnown,\n\tMessagePriority,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName, pick } from \"@zwave-js/shared/safe\";\nimport { validateArgs } from \"@zwave-js/transformers\";\nimport { CCAPI } from \"../lib/API.js\";\nimport {\n\ttype CCRaw,\n\tCommandClass,\n\ttype InterviewContext,\n\ttype RefreshValuesContext,\n} from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tuseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { ClockCommand, Weekday } from \"../lib/_Types.js\";\n\n// @noSetValueAPI - This CC has no simple value to set\n\n@API(CommandClasses.Clock)\nexport class ClockCCAPI extends CCAPI {\n\tpublic supportsCommand(cmd: ClockCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase ClockCommand.Get:\n\t\t\t\treturn this.isSinglecast();\n\t\t\tcase ClockCommand.Set:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n\tpublic async get() {\n\t\tthis.assertSupportsCommand(ClockCommand, ClockCommand.Get);\n\n\t\tconst cc = new ClockCCGet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t});\n\t\tconst response = await this.host.sendCommand<ClockCCReport>(\n\t\t\tcc,\n\t\t\tthis.commandOptions,\n\t\t);\n\t\tif (response) {\n\t\t\treturn pick(response, [\"weekday\", \"hour\", \"minute\"]);\n\t\t}\n\t}\n\n\t@validateArgs({ strictEnums: true })\n\tpublic async set(\n\t\thour: number,\n\t\tminute: number,\n\t\tweekday?: Weekday,\n\t): Promise<SupervisionResult | undefined> {\n\t\tthis.assertSupportsCommand(ClockCommand, ClockCommand.Set);\n\n\t\tconst cc = new ClockCCSet({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\thour,\n\t\t\tminute,\n\t\t\tweekday: weekday ?? Weekday.Unknown,\n\t\t});\n\t\treturn this.host.sendCommand(cc, this.commandOptions);\n\t}\n}\n\n@commandClass(CommandClasses.Clock)\n@implementedVersion(1)\nexport class ClockCC extends CommandClass {\n\tdeclare ccCommand: ClockCommand;\n\n\tpublic async interview(\n\t\tctx: InterviewContext,\n\t): Promise<void> {\n\t\tconst node = this.getNode(ctx)!;\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\tawait this.refreshValues(ctx);\n\n\t\t// Remember that the interview is complete\n\t\tthis.setInterviewComplete(ctx, true);\n\t}\n\n\tpublic async refreshValues(\n\t\tctx: RefreshValuesContext,\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.Clock,\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\tmessage: \"requesting current clock setting...\",\n\t\t\tdirection: \"outbound\",\n\t\t});\n\t\tconst response = await api.get();\n\t\tif (response) {\n\t\t\tconst logMessage = `received current clock setting: ${\n\t\t\t\tresponse.weekday !== Weekday.Unknown\n\t\t\t\t\t? Weekday[response.weekday] + \", \"\n\t\t\t\t\t: \"\"\n\t\t\t}${response.hour < 10 ? \"0\" : \"\"}${response.hour}:${\n\t\t\t\tresponse.minute < 10 ? \"0\" : \"\"\n\t\t\t}${response.minute}`;\n\t\t\tctx.logNode(node.id, {\n\t\t\t\tmessage: logMessage,\n\t\t\t\tdirection: \"inbound\",\n\t\t\t});\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface ClockCCSetOptions {\n\tweekday: Weekday;\n\thour: number;\n\tminute: number;\n}\n\n@CCCommand(ClockCommand.Set)\n@useSupervision()\nexport class ClockCCSet extends ClockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClockCCSetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.weekday = options.weekday;\n\t\tthis.hour = options.hour;\n\t\tthis.minute = options.minute;\n\t}\n\n\tpublic static from(_raw: CCRaw, _ctx: CCParsingContext): ClockCCSet {\n\t\t// TODO: Deserialize payload\n\t\tthrow new ZWaveError(\n\t\t\t`${this.name}: deserialization not implemented`,\n\t\t\tZWaveErrorCodes.Deserialization_NotImplemented,\n\t\t);\n\n\t\t// return new ClockCCSet({\n\t\t// \tnodeId: ctx.sourceNodeId,\n\t\t// });\n\t}\n\n\tpublic weekday: Weekday;\n\tpublic hour: number;\n\tpublic minute: number;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.from([\n\t\t\t((this.weekday & 0b111) << 5) | (this.hour & 0b11111),\n\t\t\tthis.minute,\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\"clock setting\": `${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tWeekday,\n\t\t\t\t\t\tthis.weekday,\n\t\t\t\t\t)\n\t\t\t\t}, ${this.hour.toString().padStart(2, \"0\")}:${\n\t\t\t\t\tthis.minute.toString().padStart(\n\t\t\t\t\t\t2,\n\t\t\t\t\t\t\"0\",\n\t\t\t\t\t)\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n// @publicAPI\nexport interface ClockCCReportOptions {\n\tweekday: Weekday;\n\thour: number;\n\tminute: number;\n}\n\n@CCCommand(ClockCommand.Report)\nexport class ClockCCReport extends ClockCC {\n\tpublic constructor(\n\t\toptions: WithAddress<ClockCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\t// TODO: Check implementation:\n\t\tthis.weekday = options.weekday;\n\t\tthis.hour = options.hour;\n\t\tthis.minute = options.minute;\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): ClockCCReport {\n\t\tvalidatePayload(raw.payload.length >= 2);\n\t\tconst weekday: Weekday = raw.payload[0] >>> 5;\n\t\tconst hour = raw.payload[0] & 0b11111;\n\t\tconst minute = raw.payload[1];\n\t\tvalidatePayload(\n\t\t\tweekday <= Weekday.Sunday,\n\t\t\thour <= 23,\n\t\t\tminute <= 59,\n\t\t);\n\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\tweekday,\n\t\t\thour,\n\t\t\tminute,\n\t\t});\n\t}\n\n\tpublic readonly weekday: Weekday;\n\tpublic readonly hour: number;\n\tpublic readonly minute: number;\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\"clock setting\": `${\n\t\t\t\t\tgetEnumMemberName(\n\t\t\t\t\t\tWeekday,\n\t\t\t\t\t\tthis.weekday,\n\t\t\t\t\t)\n\t\t\t\t}, ${this.hour.toString().padStart(2, \"0\")}:${\n\t\t\t\t\tthis.minute.toString().padStart(\n\t\t\t\t\t\t2,\n\t\t\t\t\t\t\"0\",\n\t\t\t\t\t)\n\t\t\t\t}`,\n\t\t\t},\n\t\t};\n\t}\n}\n\n@CCCommand(ClockCommand.Get)\n@expectedCCResponse(ClockCCReport)\nexport class ClockCCGet extends ClockCC {}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,kBAOO;AACP,IAAAA,eAAsB;AACtB,IAAAA,eAAwC;AAExC,iBAAsB;AACtB,0BAKO;AACP,oCAOO;AACP,mBAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKzB,cAAU,MAAA;8BADtB,mCAAI,2BAAe,KAAK,CAAC;;;;oBACM;;;kCAAA,YAAK;WAAA;;;;;;;;yBA4BnC,4BAAa,EAAE,aAAa,KAAI,CAAE,CAAC;AACpC,mBAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gC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