@zwave-js/cc 14.3.10 → 15.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.d.ts +139 -57
- package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
- package/build/cjs/cc/AssociationCC.d.ts +178 -43
- package/build/cjs/cc/AssociationCC.js +0 -4
- package/build/cjs/cc/AssociationCC.js.map +2 -2
- package/build/cjs/cc/AssociationGroupInfoCC.d.ts +138 -38
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +2 -2
- package/build/cjs/cc/BarrierOperatorCC.d.ts +275 -73
- package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
- package/build/cjs/cc/BasicCC.d.ts +316 -71
- package/build/cjs/cc/BasicCC.js.map +2 -2
- package/build/cjs/cc/BatteryCC.d.ts +759 -164
- package/build/cjs/cc/BatteryCC.js.map +2 -2
- package/build/cjs/cc/BinarySensorCC.d.ts +91 -26
- package/build/cjs/cc/BinarySensorCC.js.map +2 -2
- package/build/cjs/cc/BinarySwitchCC.d.ts +190 -38
- 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 +272 -53
- package/build/cjs/cc/CentralSceneCC.js.map +2 -2
- package/build/cjs/cc/ClimateControlScheduleCC.d.ts +150 -37
- 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 +423 -96
- 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 +101 -37
- package/build/cjs/cc/ConfigurationCC.js +0 -8
- 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 +1731 -419
- package/build/cjs/cc/DoorLockCC.js.map +2 -2
- package/build/cjs/cc/DoorLockLoggingCC.d.ts +64 -12
- package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
- package/build/cjs/cc/EnergyProductionCC.d.ts +29 -14
- package/build/cjs/cc/EnergyProductionCC.js.map +2 -2
- package/build/cjs/cc/EntryControlCC.d.ts +308 -57
- 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 +389 -64
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +154 -8
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.d.ts +125 -27
- package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +64 -18
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlSetpointCC.d.ts +116 -39
- 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 +325 -83
- package/build/cjs/cc/IndicatorCC.js.map +2 -2
- package/build/cjs/cc/IrrigationCC.d.ts +2170 -683
- package/build/cjs/cc/IrrigationCC.js.map +2 -2
- package/build/cjs/cc/LanguageCC.d.ts +128 -26
- package/build/cjs/cc/LanguageCC.js.map +2 -2
- package/build/cjs/cc/LockCC.d.ts +64 -14
- 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 +219 -57
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +2 -2
- package/build/cjs/cc/MeterCC.d.ts +364 -89
- package/build/cjs/cc/MeterCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelAssociationCC.d.ts +138 -40
- package/build/cjs/cc/MultiChannelAssociationCC.js +0 -5
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +2 -2
- package/build/cjs/cc/MultiChannelCC.d.ts +469 -99
- package/build/cjs/cc/MultiChannelCC.js +8 -72
- 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 +118 -33
- package/build/cjs/cc/MultilevelSensorCC.js.map +2 -2
- package/build/cjs/cc/MultilevelSwitchCC.d.ts +490 -125
- package/build/cjs/cc/MultilevelSwitchCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.d.ts +128 -26
- package/build/cjs/cc/NodeNamingCC.js.map +2 -2
- package/build/cjs/cc/NotificationCC.d.ts +603 -161
- package/build/cjs/cc/NotificationCC.js +12 -1
- 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 +496 -94
- package/build/cjs/cc/ProtectionCC.js.map +2 -2
- package/build/cjs/cc/SceneActivationCC.d.ts +127 -28
- package/build/cjs/cc/SceneActivationCC.js.map +2 -2
- package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +52 -25
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
- package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +53 -25
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
- package/build/cjs/cc/ScheduleEntryLockCC.d.ts +268 -64
- 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 +253 -64
- package/build/cjs/cc/SoundSwitchCC.js.map +2 -2
- package/build/cjs/cc/SupervisionCC.d.ts +28 -16
- package/build/cjs/cc/SupervisionCC.js +4 -29
- package/build/cjs/cc/SupervisionCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanModeCC.d.ts +187 -38
- package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatFanStateCC.d.ts +64 -18
- package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
- package/build/cjs/cc/ThermostatModeCC.d.ts +189 -40
- package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
- package/build/cjs/cc/ThermostatOperatingStateCC.d.ts +65 -19
- 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 +116 -36
- 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 +63 -12
- 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 +931 -176
- package/build/cjs/cc/UserCodeCC.js.map +2 -2
- package/build/cjs/cc/VersionCC.d.ts +897 -185
- package/build/cjs/cc/VersionCC.js.map +2 -2
- package/build/cjs/cc/WakeUpCC.d.ts +190 -38
- package/build/cjs/cc/WakeUpCC.js.map +2 -2
- package/build/cjs/cc/WindowCoveringCC.d.ts +193 -103
- package/build/cjs/cc/WindowCoveringCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.d.ts +311 -51
- 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/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/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 +2 -2
- package/build/cjs/lib/Values.js.map +2 -2
- 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 +139 -57
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +0 -1
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts +178 -43
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +0 -13
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts +138 -38
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +0 -6
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts +275 -73
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +0 -3
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts +316 -71
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +0 -2
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts +759 -164
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +1 -2
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts +91 -26
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +0 -3
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts +190 -38
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +0 -2
- 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 +272 -53
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +0 -1
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts +150 -37
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +0 -3
- 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 +423 -96
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +0 -6
- 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 +101 -37
- package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +0 -25
- 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 +1731 -419
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +0 -2
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts +64 -12
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +0 -1
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.d.ts +29 -14
- package/build/esm/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +0 -2
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts +308 -57
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +0 -1
- 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 +389 -64
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +158 -30
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts +125 -27
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +0 -1
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +64 -18
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts +116 -39
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +0 -4
- 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 +325 -83
- package/build/esm/cc/IndicatorCC.d.ts.map +1 -1
- package/build/esm/cc/IndicatorCC.js +0 -7
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts +2170 -683
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +0 -9
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts +128 -26
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +0 -1
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts +64 -14
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +0 -1
- 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 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts +219 -57
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +0 -2
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts +364 -89
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +0 -4
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts +138 -40
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +0 -16
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts +469 -99
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +8 -101
- 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 +118 -33
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +0 -5
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts +490 -125
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +0 -4
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts +128 -26
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +0 -2
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts +603 -161
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +18 -12
- 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 +496 -94
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +0 -3
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts +127 -28
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +0 -1
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +52 -25
- package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +0 -2
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts +53 -25
- package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +0 -2
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts +268 -64
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +0 -14
- 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 +253 -64
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +0 -7
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.d.ts +28 -16
- package/build/esm/cc/SupervisionCC.d.ts.map +1 -1
- package/build/esm/cc/SupervisionCC.js +4 -34
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts +187 -38
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +0 -1
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts +64 -18
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts +189 -40
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +0 -3
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts +65 -19
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- 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 +116 -36
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +0 -6
- 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 +63 -12
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +0 -1
- 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 +931 -176
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +0 -12
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts +897 -185
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +0 -4
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts +190 -38
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +0 -1
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts +193 -103
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +0 -5
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts +311 -51
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +0 -1
- 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/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/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 +2 -2
- package/build/esm/lib/Values.d.ts.map +1 -1
- 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 +13 -13
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { type CCEncodingContext, type CCParsingContext } from "@zwave-js/cc";
|
|
2
|
+
import { CommandClasses, Duration, EncapsulationFlags, type EndpointId, type GetEndpoint, type GetNode, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type NodeId, type SinglecastCC, type SupervisionResult, SupervisionStatus, type SupportsCC, type WithAddress } from "@zwave-js/core/safe";
|
|
3
3
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
4
4
|
import { PhysicalCCAPI } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass } from "../lib/CommandClass.js";
|
|
6
6
|
import { SupervisionCommand } from "../lib/_Types.js";
|
|
7
7
|
export declare const SupervisionCCValues: Readonly<{
|
|
8
8
|
ccSupported: ((ccId: CommandClasses) => {
|
|
9
|
-
readonly meta: {
|
|
9
|
+
readonly meta: Readonly<(import("@zwave-js/core/safe").ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
10
10
|
readonly type: "any";
|
|
11
11
|
readonly readable: true;
|
|
12
12
|
readonly writeable: true;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
14
|
+
readonly type: "any";
|
|
15
|
+
readonly readable: true;
|
|
16
|
+
readonly writeable: true;
|
|
17
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(import("@zwave-js/core/safe").ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
18
|
+
readonly type: "any";
|
|
19
|
+
readonly readable: true;
|
|
20
|
+
readonly writeable: true;
|
|
21
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
22
|
+
readonly type: "any";
|
|
23
|
+
readonly readable: true;
|
|
24
|
+
readonly writeable: true;
|
|
25
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (import("@zwave-js/core/safe").ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
26
|
+
readonly type: "any";
|
|
27
|
+
readonly readable: true;
|
|
28
|
+
readonly writeable: true;
|
|
29
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
30
|
+
readonly type: "any";
|
|
31
|
+
readonly readable: true;
|
|
32
|
+
readonly writeable: true;
|
|
33
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
34
|
+
readonly id: ValueIDBase;
|
|
19
35
|
readonly endpoint: (endpoint?: number | undefined) => {
|
|
20
36
|
readonly commandClass: CommandClasses.Supervision;
|
|
21
37
|
readonly endpoint: number;
|
|
@@ -82,7 +98,7 @@ export declare class SupervisionCCReport extends SupervisionCC {
|
|
|
82
98
|
readonly sessionId: number;
|
|
83
99
|
readonly status: SupervisionStatus;
|
|
84
100
|
readonly duration: Duration | undefined;
|
|
85
|
-
serialize(ctx: CCEncodingContext): Bytes
|
|
101
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
86
102
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
87
103
|
toSupervisionResult(): SupervisionResult;
|
|
88
104
|
}
|
|
@@ -93,15 +109,11 @@ export interface SupervisionCCGetOptions {
|
|
|
93
109
|
}
|
|
94
110
|
export declare class SupervisionCCGet extends SupervisionCC {
|
|
95
111
|
constructor(options: WithAddress<SupervisionCCGetOptions>);
|
|
96
|
-
|
|
97
|
-
static from(raw: CCRaw, ctx: CCParsingContext): SupervisionCCGet;
|
|
98
|
-
static fromAsync(raw: CCRaw, ctx: CCParsingContext): Promise<SupervisionCCGet>;
|
|
112
|
+
static from(raw: CCRaw, ctx: CCParsingContext): Promise<SupervisionCCGet>;
|
|
99
113
|
requestStatusUpdates: boolean;
|
|
100
114
|
sessionId: number;
|
|
101
115
|
encapsulated: CommandClass;
|
|
102
|
-
|
|
103
|
-
serialize(ctx: CCEncodingContext): Bytes;
|
|
104
|
-
serializeAsync(ctx: CCEncodingContext): Promise<Bytes>;
|
|
116
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
105
117
|
protected computeEncapsulationOverhead(): number;
|
|
106
118
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
107
119
|
}
|
|
@@ -361,24 +361,11 @@ let SupervisionCCGet = (() => {
|
|
|
361
361
|
this.encapsulated.endpointIndex = this.endpointIndex;
|
|
362
362
|
this.encapsulated.encapsulatingCC = this;
|
|
363
363
|
}
|
|
364
|
-
|
|
365
|
-
static from(raw, ctx) {
|
|
366
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
367
|
-
const requestStatusUpdates = !!(raw.payload[0] & 128);
|
|
368
|
-
const sessionId = raw.payload[0] & 63;
|
|
369
|
-
const encapsulated = import_CommandClass.CommandClass.parse(raw.payload.subarray(2), ctx);
|
|
370
|
-
return new this({
|
|
371
|
-
nodeId: ctx.sourceNodeId,
|
|
372
|
-
requestStatusUpdates,
|
|
373
|
-
sessionId,
|
|
374
|
-
encapsulated
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
static async fromAsync(raw, ctx) {
|
|
364
|
+
static async from(raw, ctx) {
|
|
378
365
|
(0, import_safe.validatePayload)(raw.payload.length >= 3);
|
|
379
366
|
const requestStatusUpdates = !!(raw.payload[0] & 128);
|
|
380
367
|
const sessionId = raw.payload[0] & 63;
|
|
381
|
-
const encapsulated = await import_CommandClass.CommandClass.
|
|
368
|
+
const encapsulated = await import_CommandClass.CommandClass.parse(raw.payload.subarray(2), ctx);
|
|
382
369
|
return new this({
|
|
383
370
|
nodeId: ctx.sourceNodeId,
|
|
384
371
|
requestStatusUpdates,
|
|
@@ -389,9 +376,8 @@ let SupervisionCCGet = (() => {
|
|
|
389
376
|
requestStatusUpdates;
|
|
390
377
|
sessionId;
|
|
391
378
|
encapsulated;
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
const encapCC = this.encapsulated.serialize(ctx);
|
|
379
|
+
async serialize(ctx) {
|
|
380
|
+
const encapCC = await this.encapsulated.serialize(ctx);
|
|
395
381
|
this.payload = import_safe2.Bytes.concat([
|
|
396
382
|
import_safe2.Bytes.from([
|
|
397
383
|
(this.requestStatusUpdates ? 128 : 0) | this.sessionId & 63,
|
|
@@ -401,17 +387,6 @@ let SupervisionCCGet = (() => {
|
|
|
401
387
|
]);
|
|
402
388
|
return super.serialize(ctx);
|
|
403
389
|
}
|
|
404
|
-
async serializeAsync(ctx) {
|
|
405
|
-
const encapCC = await this.encapsulated.serializeAsync(ctx);
|
|
406
|
-
this.payload = import_safe2.Bytes.concat([
|
|
407
|
-
import_safe2.Bytes.from([
|
|
408
|
-
(this.requestStatusUpdates ? 128 : 0) | this.sessionId & 63,
|
|
409
|
-
encapCC.length
|
|
410
|
-
]),
|
|
411
|
-
encapCC
|
|
412
|
-
]);
|
|
413
|
-
return super.serializeAsync(ctx);
|
|
414
|
-
}
|
|
415
390
|
computeEncapsulationOverhead() {
|
|
416
391
|
return super.computeEncapsulationOverhead() + 2;
|
|
417
392
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cc/SupervisionCC.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n\tCommandClasses,\n\tDuration,\n\tEncapsulationFlags,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype SinglecastCC,\n\ttype SupervisionResult,\n\tSupervisionStatus,\n\ttype SupportsCC,\n\tTransmitOptions,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tisTransmissionError,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport type {\n\tCCEncodingContext,\n\tCCParsingContext,\n\tGetNode,\n\tGetValueDB,\n} from \"@zwave-js/host/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName } from \"@zwave-js/shared/safe\";\nimport { PhysicalCCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tshouldUseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SupervisionCommand } from \"../lib/_Types.js\";\n\nexport const SupervisionCCValues = Object.freeze({\n\t...V.defineDynamicCCValues(CommandClasses.Supervision, {\n\t\t// Used to remember whether a node supports supervision-encapsulation of the given CC\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"ccSupported\",\n\t\t\t\"ccSupported\",\n\t\t\t(ccId: CommandClasses) => ccId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"commandSupported\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true, supportsEndpoints: false },\n\t\t),\n\t}),\n});\n\n// @noSetValueAPI - This CC has no values to set\n// @noInterview - This CC is only used for encapsulation\n\n// Encapsulation CCs are used internally and too frequently that we\n// want to pay the cost of validating each call\n/* eslint-disable @zwave-js/ccapi-validate-args */\n\n@API(CommandClasses.Supervision)\nexport class SupervisionCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: SupervisionCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase SupervisionCommand.Get:\n\t\t\tcase SupervisionCommand.Report:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tpublic async sendReport(\n\t\toptions: SupervisionCCReportOptions & {\n\t\t\tencapsulationFlags?: EncapsulationFlags;\n\t\t\tlowPriority?: boolean;\n\t\t},\n\t): Promise<void> {\n\t\t// Here we don't assert support - some devices only half-support Supervision, so we treat them\n\t\t// as if they don't support it. We still need to be able to respond to the Get command though.\n\n\t\tconst {\n\t\t\tencapsulationFlags = EncapsulationFlags.None,\n\t\t\tlowPriority = false,\n\t\t\t...cmdOptions\n\t\t} = options;\n\t\tconst cc = new SupervisionCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...cmdOptions,\n\t\t});\n\n\t\t// The report must be sent back with the same encapsulation order\n\t\tcc.encapsulationFlags = encapsulationFlags;\n\n\t\ttry {\n\t\t\tawait this.host.sendCommand(cc, {\n\t\t\t\t...this.commandOptions,\n\t\t\t\t// Supervision Reports must be prioritized over normal messages\n\t\t\t\tpriority: lowPriority\n\t\t\t\t\t? MessagePriority.ImmediateLow\n\t\t\t\t\t: MessagePriority.Immediate,\n\t\t\t\t// But we don't want to wait for an ACK because this can lock up the network for seconds\n\t\t\t\t// if the target node is asleep or unreachable\n\t\t\t\ttransmitOptions: TransmitOptions.DEFAULT_NOACK,\n\t\t\t\t// Only try sending the report once. If it fails, the node will ask again\n\t\t\t\tmaxSendAttempts: 1,\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (isTransmissionError(e)) {\n\t\t\t\t// Swallow errors related to transmission failures\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t// Pass other errors through\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses.Supervision)\n@implementedVersion(2)\nexport class SupervisionCC extends CommandClass {\n\tdeclare ccCommand: SupervisionCommand;\n\t// Force singlecast for the supervision CC\n\tdeclare nodeId: number;\n\n\t/** Tests if a command should be supervised and thus requires encapsulation */\n\tpublic static requiresEncapsulation(cc: CommandClass): boolean {\n\t\treturn (\n\t\t\t!!(cc.encapsulationFlags & EncapsulationFlags.Supervision)\n\t\t\t&& !(cc instanceof SupervisionCCGet)\n\t\t\t&& !(cc instanceof SupervisionCCReport)\n\t\t);\n\t}\n\n\t/** Encapsulates a command that targets a specific endpoint */\n\tpublic static encapsulate(\n\t\tcc: CommandClass,\n\t\tsessionId: number,\n\t\trequestStatusUpdates: boolean = true,\n\t): SupervisionCCGet {\n\t\tif (!cc.isSinglecast()) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Supervision is only possible for singlecast commands!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst ret = new SupervisionCCGet({\n\t\t\tnodeId: cc.nodeId,\n\t\t\t// Supervision CC is wrapped inside MultiChannel CCs, so the endpoint must be copied\n\t\t\tendpointIndex: cc.endpointIndex,\n\t\t\tencapsulated: cc,\n\t\t\tsessionId,\n\t\t\trequestStatusUpdates,\n\t\t});\n\n\t\t// Copy the encapsulation flags from the encapsulated command\n\t\t// but omit Supervision, since we're doing that right now\n\t\tret.encapsulationFlags = cc.encapsulationFlags\n\t\t\t& ~EncapsulationFlags.Supervision;\n\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Given a CC instance, this returns the Supervision session ID which is used for this command.\n\t * Returns `undefined` when there is no session ID or the command was sent as multicast.\n\t */\n\tpublic static getSessionId(command: CommandClass): number | undefined {\n\t\tif (\n\t\t\tcommand.isEncapsulatedWith(\n\t\t\t\tCommandClasses.Supervision,\n\t\t\t\tSupervisionCommand.Get,\n\t\t\t)\n\t\t) {\n\t\t\tconst supervisionEncapsulation = command.getEncapsulatingCC(\n\t\t\t\tCommandClasses.Supervision,\n\t\t\t\tSupervisionCommand.Get,\n\t\t\t) as SupervisionCCGet;\n\t\t\tif (\n\t\t\t\tsupervisionEncapsulation.frameType !== \"broadcast\"\n\t\t\t\t&& supervisionEncapsulation.frameType !== \"multicast\"\n\t\t\t) {\n\t\t\t\treturn supervisionEncapsulation.sessionId;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns whether a node supports the given CC with Supervision encapsulation.\n\t */\n\tpublic static getCCSupportedWithSupervision(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tccId: CommandClasses,\n\t): boolean {\n\t\t// By default assume supervision is supported for all CCs, unless we've remembered one not to be\n\t\treturn (\n\t\t\tctx\n\t\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t\t.getValue(\n\t\t\t\t\tSupervisionCCValues.ccSupported(ccId).endpoint(\n\t\t\t\t\t\tendpoint.index,\n\t\t\t\t\t),\n\t\t\t\t) ?? true\n\t\t);\n\t}\n\n\t/**\n\t * Remembers whether a node supports the given CC with Supervision encapsulation.\n\t */\n\tpublic static setCCSupportedWithSupervision(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tccId: CommandClasses,\n\t\tsupported: boolean,\n\t): void {\n\t\tctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.setValue(\n\t\t\t\tSupervisionCCValues.ccSupported(ccId).endpoint(endpoint.index),\n\t\t\t\tsupported,\n\t\t\t);\n\t}\n\n\t/** Returns whether this is a valid command to send supervised */\n\tpublic static mayUseSupervision<T extends CommandClass>(\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetNode<\n\t\t\t\tNodeId & SupportsCC & GetEndpoint<EndpointId>\n\t\t\t>,\n\t\tcommand: T,\n\t): command is SinglecastCC<T> {\n\t\t// Supervision may only be used for singlecast CCs that expect no response\n\t\t// The specs mention that Supervision CAN be used for S2 multicast, but conveniently fail to explain how to respond to that.\n\t\tif (!command.isSinglecast()) return false;\n\t\tif (command.expectsCCResponse()) return false;\n\n\t\t// with a valid node and endpoint\n\t\tconst node = command.getNode(ctx);\n\t\tif (!node) return false;\n\t\tconst endpoint = command.getEndpoint(ctx);\n\t\tif (!endpoint) return false;\n\n\t\t// and only if ...\n\t\treturn (\n\t\t\t// ... the node supports it\n\t\t\tnode.supportsCC(CommandClasses.Supervision)\n\t\t\t// ... the command is marked as \"should use supervision\"\n\t\t\t&& shouldUseSupervision(command)\n\t\t\t// ... and we haven't previously determined that the node doesn't properly support it\n\t\t\t&& SupervisionCC.getCCSupportedWithSupervision(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tcommand.ccId,\n\t\t\t)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport type SupervisionCCReportOptions =\n\t& {\n\t\tmoreUpdatesFollow: boolean;\n\t\trequestWakeUpOnDemand?: boolean;\n\t\tsessionId: number;\n\t}\n\t& (\n\t\t| {\n\t\t\tstatus: SupervisionStatus.Working;\n\t\t\tduration: Duration;\n\t\t}\n\t\t| {\n\t\t\tstatus:\n\t\t\t\t| SupervisionStatus.NoSupport\n\t\t\t\t| SupervisionStatus.Fail\n\t\t\t\t| SupervisionStatus.Success;\n\t\t}\n\t);\n\n@CCCommand(SupervisionCommand.Report)\nexport class SupervisionCCReport extends SupervisionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<SupervisionCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.moreUpdatesFollow = options.moreUpdatesFollow;\n\t\tthis.requestWakeUpOnDemand = !!options.requestWakeUpOnDemand;\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.status = options.status;\n\t\tif (options.status === SupervisionStatus.Working) {\n\t\t\tthis.duration = options.duration;\n\t\t} else {\n\t\t\tthis.duration = new Duration(0, \"seconds\");\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): SupervisionCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst moreUpdatesFollow = !!(raw.payload[0] & 0b1_0_000000);\n\t\tconst requestWakeUpOnDemand = !!(raw.payload[0] & 0b0_1_000000);\n\t\tconst sessionId = raw.payload[0] & 0b111111;\n\t\tconst status: SupervisionStatus = raw.payload[1];\n\n\t\tif (status === SupervisionStatus.Working) {\n\t\t\tconst duration = Duration.parseReport(raw.payload[2])\n\t\t\t\t?? new Duration(0, \"seconds\");\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tmoreUpdatesFollow,\n\t\t\t\trequestWakeUpOnDemand,\n\t\t\t\tsessionId,\n\t\t\t\tstatus,\n\t\t\t\tduration,\n\t\t\t});\n\t\t} else {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tmoreUpdatesFollow,\n\t\t\t\trequestWakeUpOnDemand,\n\t\t\t\tsessionId,\n\t\t\t\tstatus,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic readonly moreUpdatesFollow: boolean;\n\tpublic readonly requestWakeUpOnDemand: boolean;\n\tpublic readonly sessionId: number;\n\tpublic readonly status: SupervisionStatus;\n\tpublic readonly duration: Duration | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.moreUpdatesFollow ? 0b1_0_000000 : 0)\n\t\t\t\t| (this.requestWakeUpOnDemand ? 0b0_1_000000 : 0)\n\t\t\t\t| (this.sessionId & 0b111111),\n\t\t\t\tthis.status,\n\t\t\t]),\n\t\t]);\n\n\t\tif (this.duration) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from([this.duration.serializeReport()]),\n\t\t\t]);\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\tconst message: MessageRecord = {\n\t\t\t\"session id\": this.sessionId,\n\t\t\t\"more updates follow\": this.moreUpdatesFollow,\n\t\t\tstatus: getEnumMemberName(SupervisionStatus, this.status),\n\t\t};\n\t\tif (this.duration) {\n\t\t\tmessage.duration = this.duration.toString();\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic toSupervisionResult(): SupervisionResult {\n\t\tif (this.status === SupervisionStatus.Working) {\n\t\t\treturn {\n\t\t\t\tstatus: this.status,\n\t\t\t\tremainingDuration: this.duration!,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tstatus: this.status,\n\t\t\t};\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface SupervisionCCGetOptions {\n\trequestStatusUpdates: boolean;\n\tencapsulated: CommandClass;\n\tsessionId: number;\n}\n\nfunction testResponseForSupervisionCCGet(\n\tsent: SupervisionCCGet,\n\treceived: SupervisionCCReport,\n) {\n\treturn received.sessionId === sent.sessionId;\n}\n\n@CCCommand(SupervisionCommand.Get)\n@expectedCCResponse(SupervisionCCReport, testResponseForSupervisionCCGet)\nexport class SupervisionCCGet extends SupervisionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<SupervisionCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.requestStatusUpdates = options.requestStatusUpdates;\n\t\tthis.encapsulated = options.encapsulated;\n\t\t// Supervision is inside MultiChannel CCs, so the endpoint must be copied\n\t\tthis.encapsulated.endpointIndex = this.endpointIndex;\n\t\tthis.encapsulated.encapsulatingCC = this as any;\n\t}\n\n\t/** @deprecated Use {@link fromAsync} instead */\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): SupervisionCCGet {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst requestStatusUpdates = !!(raw.payload[0] & 0b1_0_000000);\n\t\tconst sessionId = raw.payload[0] & 0b111111;\n\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\tconst encapsulated = CommandClass.parse(raw.payload.subarray(2), ctx);\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trequestStatusUpdates,\n\t\t\tsessionId,\n\t\t\tencapsulated,\n\t\t});\n\t}\n\n\tpublic static async fromAsync(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): Promise<SupervisionCCGet> {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst requestStatusUpdates = !!(raw.payload[0] & 0b1_0_000000);\n\t\tconst sessionId = raw.payload[0] & 0b111111;\n\n\t\tconst encapsulated = await CommandClass.parseAsync(\n\t\t\traw.payload.subarray(2),\n\t\t\tctx,\n\t\t);\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trequestStatusUpdates,\n\t\t\tsessionId,\n\t\t\tencapsulated,\n\t\t});\n\t}\n\n\tpublic requestStatusUpdates: boolean;\n\tpublic sessionId: number;\n\tpublic encapsulated: CommandClass;\n\n\t/** @deprecated Use {@link serializeAsync} instead */\n\tpublic serialize(ctx: CCEncodingContext): Bytes {\n\t\t// eslint-disable-next-line @typescript-eslint/no-deprecated\n\t\tconst encapCC = this.encapsulated.serialize(ctx);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.requestStatusUpdates ? 0b10_000000 : 0)\n\t\t\t\t| (this.sessionId & 0b111111),\n\t\t\t\tencapCC.length,\n\t\t\t]),\n\t\t\tencapCC,\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 async serializeAsync(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encapCC = await this.encapsulated.serializeAsync(ctx);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.requestStatusUpdates ? 0b10_000000 : 0)\n\t\t\t\t| (this.sessionId & 0b111111),\n\t\t\t\tencapCC.length,\n\t\t\t]),\n\t\t\tencapCC,\n\t\t]);\n\t\treturn super.serializeAsync(ctx);\n\t}\n\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// Supervision CC adds two bytes (control byte + cc length)\n\t\treturn super.computeEncapsulationOverhead() + 2;\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\"session id\": this.sessionId,\n\t\t\t\t\"request updates\": this.requestStatusUpdates,\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\tDuration,\n\tEncapsulationFlags,\n\ttype EndpointId,\n\ttype GetEndpoint,\n\ttype GetNode,\n\ttype GetValueDB,\n\ttype MaybeNotKnown,\n\ttype MessageOrCCLogEntry,\n\tMessagePriority,\n\ttype MessageRecord,\n\ttype NodeId,\n\ttype SinglecastCC,\n\ttype SupervisionResult,\n\tSupervisionStatus,\n\ttype SupportsCC,\n\tTransmitOptions,\n\ttype WithAddress,\n\tZWaveError,\n\tZWaveErrorCodes,\n\tisTransmissionError,\n\tvalidatePayload,\n} from \"@zwave-js/core/safe\";\nimport { Bytes } from \"@zwave-js/shared/safe\";\nimport { getEnumMemberName } from \"@zwave-js/shared/safe\";\nimport { PhysicalCCAPI } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass } from \"../lib/CommandClass.js\";\nimport {\n\tAPI,\n\tCCCommand,\n\tcommandClass,\n\texpectedCCResponse,\n\timplementedVersion,\n\tshouldUseSupervision,\n} from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { SupervisionCommand } from \"../lib/_Types.js\";\n\nexport const SupervisionCCValues = Object.freeze({\n\t...V.defineDynamicCCValues(CommandClasses.Supervision, {\n\t\t// Used to remember whether a node supports supervision-encapsulation of the given CC\n\t\t...V.dynamicPropertyAndKeyWithName(\n\t\t\t\"ccSupported\",\n\t\t\t\"ccSupported\",\n\t\t\t(ccId: CommandClasses) => ccId,\n\t\t\t({ property, propertyKey }) =>\n\t\t\t\tproperty === \"commandSupported\"\n\t\t\t\t&& typeof propertyKey === \"number\",\n\t\t\tundefined,\n\t\t\t{ internal: true, supportsEndpoints: false },\n\t\t),\n\t}),\n});\n\n// @noSetValueAPI - This CC has no values to set\n// @noInterview - This CC is only used for encapsulation\n\n// Encapsulation CCs are used internally and too frequently that we\n// want to pay the cost of validating each call\n/* eslint-disable @zwave-js/ccapi-validate-args */\n\n@API(CommandClasses.Supervision)\nexport class SupervisionCCAPI extends PhysicalCCAPI {\n\tpublic supportsCommand(cmd: SupervisionCommand): MaybeNotKnown<boolean> {\n\t\tswitch (cmd) {\n\t\t\tcase SupervisionCommand.Get:\n\t\t\tcase SupervisionCommand.Report:\n\t\t\t\treturn true; // This is mandatory\n\t\t}\n\t\treturn super.supportsCommand(cmd);\n\t}\n\n\tpublic async sendReport(\n\t\toptions: SupervisionCCReportOptions & {\n\t\t\tencapsulationFlags?: EncapsulationFlags;\n\t\t\tlowPriority?: boolean;\n\t\t},\n\t): Promise<void> {\n\t\t// Here we don't assert support - some devices only half-support Supervision, so we treat them\n\t\t// as if they don't support it. We still need to be able to respond to the Get command though.\n\n\t\tconst {\n\t\t\tencapsulationFlags = EncapsulationFlags.None,\n\t\t\tlowPriority = false,\n\t\t\t...cmdOptions\n\t\t} = options;\n\t\tconst cc = new SupervisionCCReport({\n\t\t\tnodeId: this.endpoint.nodeId,\n\t\t\tendpointIndex: this.endpoint.index,\n\t\t\t...cmdOptions,\n\t\t});\n\n\t\t// The report must be sent back with the same encapsulation order\n\t\tcc.encapsulationFlags = encapsulationFlags;\n\n\t\ttry {\n\t\t\tawait this.host.sendCommand(cc, {\n\t\t\t\t...this.commandOptions,\n\t\t\t\t// Supervision Reports must be prioritized over normal messages\n\t\t\t\tpriority: lowPriority\n\t\t\t\t\t? MessagePriority.ImmediateLow\n\t\t\t\t\t: MessagePriority.Immediate,\n\t\t\t\t// But we don't want to wait for an ACK because this can lock up the network for seconds\n\t\t\t\t// if the target node is asleep or unreachable\n\t\t\t\ttransmitOptions: TransmitOptions.DEFAULT_NOACK,\n\t\t\t\t// Only try sending the report once. If it fails, the node will ask again\n\t\t\t\tmaxSendAttempts: 1,\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (isTransmissionError(e)) {\n\t\t\t\t// Swallow errors related to transmission failures\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\t// Pass other errors through\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t}\n\t}\n}\n\n@commandClass(CommandClasses.Supervision)\n@implementedVersion(2)\nexport class SupervisionCC extends CommandClass {\n\tdeclare ccCommand: SupervisionCommand;\n\t// Force singlecast for the supervision CC\n\tdeclare nodeId: number;\n\n\t/** Tests if a command should be supervised and thus requires encapsulation */\n\tpublic static requiresEncapsulation(cc: CommandClass): boolean {\n\t\treturn (\n\t\t\t!!(cc.encapsulationFlags & EncapsulationFlags.Supervision)\n\t\t\t&& !(cc instanceof SupervisionCCGet)\n\t\t\t&& !(cc instanceof SupervisionCCReport)\n\t\t);\n\t}\n\n\t/** Encapsulates a command that targets a specific endpoint */\n\tpublic static encapsulate(\n\t\tcc: CommandClass,\n\t\tsessionId: number,\n\t\trequestStatusUpdates: boolean = true,\n\t): SupervisionCCGet {\n\t\tif (!cc.isSinglecast()) {\n\t\t\tthrow new ZWaveError(\n\t\t\t\t`Supervision is only possible for singlecast commands!`,\n\t\t\t\tZWaveErrorCodes.Argument_Invalid,\n\t\t\t);\n\t\t}\n\n\t\tconst ret = new SupervisionCCGet({\n\t\t\tnodeId: cc.nodeId,\n\t\t\t// Supervision CC is wrapped inside MultiChannel CCs, so the endpoint must be copied\n\t\t\tendpointIndex: cc.endpointIndex,\n\t\t\tencapsulated: cc,\n\t\t\tsessionId,\n\t\t\trequestStatusUpdates,\n\t\t});\n\n\t\t// Copy the encapsulation flags from the encapsulated command\n\t\t// but omit Supervision, since we're doing that right now\n\t\tret.encapsulationFlags = cc.encapsulationFlags\n\t\t\t& ~EncapsulationFlags.Supervision;\n\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Given a CC instance, this returns the Supervision session ID which is used for this command.\n\t * Returns `undefined` when there is no session ID or the command was sent as multicast.\n\t */\n\tpublic static getSessionId(command: CommandClass): number | undefined {\n\t\tif (\n\t\t\tcommand.isEncapsulatedWith(\n\t\t\t\tCommandClasses.Supervision,\n\t\t\t\tSupervisionCommand.Get,\n\t\t\t)\n\t\t) {\n\t\t\tconst supervisionEncapsulation = command.getEncapsulatingCC(\n\t\t\t\tCommandClasses.Supervision,\n\t\t\t\tSupervisionCommand.Get,\n\t\t\t) as SupervisionCCGet;\n\t\t\tif (\n\t\t\t\tsupervisionEncapsulation.frameType !== \"broadcast\"\n\t\t\t\t&& supervisionEncapsulation.frameType !== \"multicast\"\n\t\t\t) {\n\t\t\t\treturn supervisionEncapsulation.sessionId;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns whether a node supports the given CC with Supervision encapsulation.\n\t */\n\tpublic static getCCSupportedWithSupervision(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tccId: CommandClasses,\n\t): boolean {\n\t\t// By default assume supervision is supported for all CCs, unless we've remembered one not to be\n\t\treturn (\n\t\t\tctx\n\t\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t\t.getValue(\n\t\t\t\t\tSupervisionCCValues.ccSupported(ccId).endpoint(\n\t\t\t\t\t\tendpoint.index,\n\t\t\t\t\t),\n\t\t\t\t) ?? true\n\t\t);\n\t}\n\n\t/**\n\t * Remembers whether a node supports the given CC with Supervision encapsulation.\n\t */\n\tpublic static setCCSupportedWithSupervision(\n\t\tctx: GetValueDB,\n\t\tendpoint: EndpointId,\n\t\tccId: CommandClasses,\n\t\tsupported: boolean,\n\t): void {\n\t\tctx\n\t\t\t.getValueDB(endpoint.nodeId)\n\t\t\t.setValue(\n\t\t\t\tSupervisionCCValues.ccSupported(ccId).endpoint(endpoint.index),\n\t\t\t\tsupported,\n\t\t\t);\n\t}\n\n\t/** Returns whether this is a valid command to send supervised */\n\tpublic static mayUseSupervision<T extends CommandClass>(\n\t\tctx:\n\t\t\t& GetValueDB\n\t\t\t& GetNode<\n\t\t\t\tNodeId & SupportsCC & GetEndpoint<EndpointId>\n\t\t\t>,\n\t\tcommand: T,\n\t): command is SinglecastCC<T> {\n\t\t// Supervision may only be used for singlecast CCs that expect no response\n\t\t// The specs mention that Supervision CAN be used for S2 multicast, but conveniently fail to explain how to respond to that.\n\t\tif (!command.isSinglecast()) return false;\n\t\tif (command.expectsCCResponse()) return false;\n\n\t\t// with a valid node and endpoint\n\t\tconst node = command.getNode(ctx);\n\t\tif (!node) return false;\n\t\tconst endpoint = command.getEndpoint(ctx);\n\t\tif (!endpoint) return false;\n\n\t\t// and only if ...\n\t\treturn (\n\t\t\t// ... the node supports it\n\t\t\tnode.supportsCC(CommandClasses.Supervision)\n\t\t\t// ... the command is marked as \"should use supervision\"\n\t\t\t&& shouldUseSupervision(command)\n\t\t\t// ... and we haven't previously determined that the node doesn't properly support it\n\t\t\t&& SupervisionCC.getCCSupportedWithSupervision(\n\t\t\t\tctx,\n\t\t\t\tendpoint,\n\t\t\t\tcommand.ccId,\n\t\t\t)\n\t\t);\n\t}\n}\n\n// @publicAPI\nexport type SupervisionCCReportOptions =\n\t& {\n\t\tmoreUpdatesFollow: boolean;\n\t\trequestWakeUpOnDemand?: boolean;\n\t\tsessionId: number;\n\t}\n\t& (\n\t\t| {\n\t\t\tstatus: SupervisionStatus.Working;\n\t\t\tduration: Duration;\n\t\t}\n\t\t| {\n\t\t\tstatus:\n\t\t\t\t| SupervisionStatus.NoSupport\n\t\t\t\t| SupervisionStatus.Fail\n\t\t\t\t| SupervisionStatus.Success;\n\t\t}\n\t);\n\n@CCCommand(SupervisionCommand.Report)\nexport class SupervisionCCReport extends SupervisionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<SupervisionCCReportOptions>,\n\t) {\n\t\tsuper(options);\n\n\t\tthis.moreUpdatesFollow = options.moreUpdatesFollow;\n\t\tthis.requestWakeUpOnDemand = !!options.requestWakeUpOnDemand;\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.status = options.status;\n\t\tif (options.status === SupervisionStatus.Working) {\n\t\t\tthis.duration = options.duration;\n\t\t} else {\n\t\t\tthis.duration = new Duration(0, \"seconds\");\n\t\t}\n\t}\n\n\tpublic static from(raw: CCRaw, ctx: CCParsingContext): SupervisionCCReport {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst moreUpdatesFollow = !!(raw.payload[0] & 0b1_0_000000);\n\t\tconst requestWakeUpOnDemand = !!(raw.payload[0] & 0b0_1_000000);\n\t\tconst sessionId = raw.payload[0] & 0b111111;\n\t\tconst status: SupervisionStatus = raw.payload[1];\n\n\t\tif (status === SupervisionStatus.Working) {\n\t\t\tconst duration = Duration.parseReport(raw.payload[2])\n\t\t\t\t?? new Duration(0, \"seconds\");\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tmoreUpdatesFollow,\n\t\t\t\trequestWakeUpOnDemand,\n\t\t\t\tsessionId,\n\t\t\t\tstatus,\n\t\t\t\tduration,\n\t\t\t});\n\t\t} else {\n\t\t\treturn new this({\n\t\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\t\tmoreUpdatesFollow,\n\t\t\t\trequestWakeUpOnDemand,\n\t\t\t\tsessionId,\n\t\t\t\tstatus,\n\t\t\t});\n\t\t}\n\t}\n\n\tpublic readonly moreUpdatesFollow: boolean;\n\tpublic readonly requestWakeUpOnDemand: boolean;\n\tpublic readonly sessionId: number;\n\tpublic readonly status: SupervisionStatus;\n\tpublic readonly duration: Duration | undefined;\n\n\tpublic serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.moreUpdatesFollow ? 0b1_0_000000 : 0)\n\t\t\t\t| (this.requestWakeUpOnDemand ? 0b0_1_000000 : 0)\n\t\t\t\t| (this.sessionId & 0b111111),\n\t\t\t\tthis.status,\n\t\t\t]),\n\t\t]);\n\n\t\tif (this.duration) {\n\t\t\tthis.payload = Bytes.concat([\n\t\t\t\tthis.payload,\n\t\t\t\tBytes.from([this.duration.serializeReport()]),\n\t\t\t]);\n\t\t}\n\t\treturn super.serialize(ctx);\n\t}\n\n\tpublic toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n\t\tconst message: MessageRecord = {\n\t\t\t\"session id\": this.sessionId,\n\t\t\t\"more updates follow\": this.moreUpdatesFollow,\n\t\t\tstatus: getEnumMemberName(SupervisionStatus, this.status),\n\t\t};\n\t\tif (this.duration) {\n\t\t\tmessage.duration = this.duration.toString();\n\t\t}\n\t\treturn {\n\t\t\t...super.toLogEntry(ctx),\n\t\t\tmessage,\n\t\t};\n\t}\n\n\tpublic toSupervisionResult(): SupervisionResult {\n\t\tif (this.status === SupervisionStatus.Working) {\n\t\t\treturn {\n\t\t\t\tstatus: this.status,\n\t\t\t\tremainingDuration: this.duration!,\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\tstatus: this.status,\n\t\t\t};\n\t\t}\n\t}\n}\n\n// @publicAPI\nexport interface SupervisionCCGetOptions {\n\trequestStatusUpdates: boolean;\n\tencapsulated: CommandClass;\n\tsessionId: number;\n}\n\nfunction testResponseForSupervisionCCGet(\n\tsent: SupervisionCCGet,\n\treceived: SupervisionCCReport,\n) {\n\treturn received.sessionId === sent.sessionId;\n}\n\n@CCCommand(SupervisionCommand.Get)\n@expectedCCResponse(SupervisionCCReport, testResponseForSupervisionCCGet)\nexport class SupervisionCCGet extends SupervisionCC {\n\tpublic constructor(\n\t\toptions: WithAddress<SupervisionCCGetOptions>,\n\t) {\n\t\tsuper(options);\n\t\tthis.sessionId = options.sessionId;\n\t\tthis.requestStatusUpdates = options.requestStatusUpdates;\n\t\tthis.encapsulated = options.encapsulated;\n\t\t// Supervision is inside MultiChannel CCs, so the endpoint must be copied\n\t\tthis.encapsulated.endpointIndex = this.endpointIndex;\n\t\tthis.encapsulated.encapsulatingCC = this as any;\n\t}\n\n\tpublic static async from(\n\t\traw: CCRaw,\n\t\tctx: CCParsingContext,\n\t): Promise<SupervisionCCGet> {\n\t\tvalidatePayload(raw.payload.length >= 3);\n\t\tconst requestStatusUpdates = !!(raw.payload[0] & 0b1_0_000000);\n\t\tconst sessionId = raw.payload[0] & 0b111111;\n\n\t\tconst encapsulated = await CommandClass.parse(\n\t\t\traw.payload.subarray(2),\n\t\t\tctx,\n\t\t);\n\t\treturn new this({\n\t\t\tnodeId: ctx.sourceNodeId,\n\t\t\trequestStatusUpdates,\n\t\t\tsessionId,\n\t\t\tencapsulated,\n\t\t});\n\t}\n\n\tpublic requestStatusUpdates: boolean;\n\tpublic sessionId: number;\n\tpublic encapsulated: CommandClass;\n\n\tpublic async serialize(ctx: CCEncodingContext): Promise<Bytes> {\n\t\tconst encapCC = await this.encapsulated.serialize(ctx);\n\t\tthis.payload = Bytes.concat([\n\t\t\tBytes.from([\n\t\t\t\t(this.requestStatusUpdates ? 0b10_000000 : 0)\n\t\t\t\t| (this.sessionId & 0b111111),\n\t\t\t\tencapCC.length,\n\t\t\t]),\n\t\t\tencapCC,\n\t\t]);\n\t\treturn super.serialize(ctx);\n\t}\n\n\tprotected computeEncapsulationOverhead(): number {\n\t\t// Supervision CC adds two bytes (control byte + cc length)\n\t\treturn super.computeEncapsulationOverhead() + 2;\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\"session id\": this.sessionId,\n\t\t\t\t\"request updates\": this.requestStatusUpdates,\n\t\t\t},\n\t\t};\n\t}\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["import_safe", "SupervisionCC"]
|
|
7
7
|
}
|
|
@@ -1,91 +1,240 @@
|
|
|
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, ValueMetadata, type WithAddress } from "@zwave-js/core/safe";
|
|
3
3
|
import { Bytes } from "@zwave-js/shared/safe";
|
|
4
4
|
import { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation } from "../lib/API.js";
|
|
5
5
|
import { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext } from "../lib/CommandClass.js";
|
|
6
6
|
import { ThermostatFanMode, ThermostatFanModeCommand } from "../lib/_Types.js";
|
|
7
7
|
export declare const ThermostatFanModeCCValues: Readonly<{
|
|
8
8
|
supportedFanModes: {
|
|
9
|
-
readonly id:
|
|
10
|
-
commandClass: (typeof CommandClasses)["Thermostat Fan Mode"];
|
|
11
|
-
property: "supportedModes";
|
|
12
|
-
};
|
|
9
|
+
readonly id: ValueIDBase;
|
|
13
10
|
readonly endpoint: (endpoint?: number | undefined) => {
|
|
14
11
|
readonly commandClass: (typeof CommandClasses)["Thermostat Fan Mode"];
|
|
15
12
|
readonly endpoint: number;
|
|
16
13
|
readonly property: "supportedModes";
|
|
17
14
|
};
|
|
18
15
|
readonly is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
19
|
-
readonly meta: {
|
|
16
|
+
readonly meta: Readonly<(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
20
17
|
readonly type: "any";
|
|
21
18
|
readonly readable: true;
|
|
22
19
|
readonly writeable: true;
|
|
23
|
-
}
|
|
24
|
-
|
|
20
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
21
|
+
readonly type: "any";
|
|
22
|
+
readonly readable: true;
|
|
23
|
+
readonly writeable: true;
|
|
24
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
25
|
+
readonly type: "any";
|
|
26
|
+
readonly readable: true;
|
|
27
|
+
readonly writeable: true;
|
|
28
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
29
|
+
readonly type: "any";
|
|
30
|
+
readonly readable: true;
|
|
31
|
+
readonly writeable: true;
|
|
32
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
33
|
+
readonly type: "any";
|
|
34
|
+
readonly readable: true;
|
|
35
|
+
readonly writeable: true;
|
|
36
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
37
|
+
readonly type: "any";
|
|
38
|
+
readonly readable: true;
|
|
39
|
+
readonly writeable: true;
|
|
40
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
41
|
+
readonly options: Readonly<(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
42
|
+
readonly internal: false;
|
|
43
|
+
readonly minVersion: 1;
|
|
44
|
+
readonly secret: false;
|
|
25
45
|
readonly stateful: true;
|
|
46
|
+
readonly supportsEndpoints: true;
|
|
47
|
+
readonly autoCreate: true;
|
|
48
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
49
|
+
readonly internal: false;
|
|
50
|
+
readonly minVersion: 1;
|
|
51
|
+
readonly secret: false;
|
|
52
|
+
readonly stateful: true;
|
|
53
|
+
readonly supportsEndpoints: true;
|
|
54
|
+
readonly autoCreate: true;
|
|
55
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>) extends infer T ? { [K in keyof T as [undefined] extends [(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
56
|
+
readonly internal: false;
|
|
57
|
+
readonly minVersion: 1;
|
|
26
58
|
readonly secret: false;
|
|
59
|
+
readonly stateful: true;
|
|
60
|
+
readonly supportsEndpoints: true;
|
|
61
|
+
readonly autoCreate: true;
|
|
62
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
63
|
+
readonly internal: false;
|
|
27
64
|
readonly minVersion: 1;
|
|
65
|
+
readonly secret: false;
|
|
66
|
+
readonly stateful: true;
|
|
28
67
|
readonly supportsEndpoints: true;
|
|
29
68
|
readonly autoCreate: true;
|
|
30
|
-
|
|
31
|
-
|
|
69
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]] ? never : K]: (import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
70
|
+
readonly internal: false;
|
|
71
|
+
readonly minVersion: 1;
|
|
72
|
+
readonly secret: false;
|
|
73
|
+
readonly stateful: true;
|
|
74
|
+
readonly supportsEndpoints: true;
|
|
75
|
+
readonly autoCreate: true;
|
|
76
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
77
|
+
readonly internal: false;
|
|
78
|
+
readonly minVersion: 1;
|
|
79
|
+
readonly secret: false;
|
|
80
|
+
readonly stateful: true;
|
|
81
|
+
readonly supportsEndpoints: true;
|
|
82
|
+
readonly autoCreate: true;
|
|
83
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]; } : never>;
|
|
32
84
|
};
|
|
33
85
|
fanMode: {
|
|
34
|
-
readonly id:
|
|
35
|
-
commandClass: (typeof CommandClasses)["Thermostat Fan Mode"];
|
|
36
|
-
property: "mode";
|
|
37
|
-
};
|
|
86
|
+
readonly id: ValueIDBase;
|
|
38
87
|
readonly endpoint: (endpoint?: number | undefined) => {
|
|
39
88
|
readonly commandClass: (typeof CommandClasses)["Thermostat Fan Mode"];
|
|
40
89
|
readonly endpoint: number;
|
|
41
90
|
readonly property: "mode";
|
|
42
91
|
};
|
|
43
92
|
readonly is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
44
|
-
readonly meta: {
|
|
45
|
-
readonly
|
|
46
|
-
[x: number]: string;
|
|
47
|
-
};
|
|
48
|
-
readonly label: "Thermostat fan mode";
|
|
49
|
-
readonly min: 0;
|
|
50
|
-
readonly max: 255;
|
|
51
|
-
readonly type: "number";
|
|
93
|
+
readonly meta: Readonly<(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
94
|
+
readonly type: "any";
|
|
52
95
|
readonly readable: true;
|
|
53
96
|
readonly writeable: true;
|
|
54
|
-
}
|
|
55
|
-
|
|
97
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
98
|
+
readonly type: "any";
|
|
99
|
+
readonly readable: true;
|
|
100
|
+
readonly writeable: true;
|
|
101
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
102
|
+
readonly type: "any";
|
|
103
|
+
readonly readable: true;
|
|
104
|
+
readonly writeable: true;
|
|
105
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
106
|
+
readonly type: "any";
|
|
107
|
+
readonly readable: true;
|
|
108
|
+
readonly writeable: true;
|
|
109
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
110
|
+
readonly type: "any";
|
|
111
|
+
readonly readable: true;
|
|
112
|
+
readonly writeable: true;
|
|
113
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
114
|
+
readonly type: "any";
|
|
115
|
+
readonly readable: true;
|
|
116
|
+
readonly writeable: true;
|
|
117
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
118
|
+
readonly options: Readonly<(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
56
119
|
readonly internal: false;
|
|
57
120
|
readonly minVersion: 1;
|
|
58
121
|
readonly secret: false;
|
|
59
122
|
readonly stateful: true;
|
|
60
123
|
readonly supportsEndpoints: true;
|
|
61
124
|
readonly autoCreate: true;
|
|
62
|
-
}
|
|
125
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
126
|
+
readonly internal: false;
|
|
127
|
+
readonly minVersion: 1;
|
|
128
|
+
readonly secret: false;
|
|
129
|
+
readonly stateful: true;
|
|
130
|
+
readonly supportsEndpoints: true;
|
|
131
|
+
readonly autoCreate: true;
|
|
132
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>) extends infer T ? { [K in keyof T as [undefined] extends [(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
133
|
+
readonly internal: false;
|
|
134
|
+
readonly minVersion: 1;
|
|
135
|
+
readonly secret: false;
|
|
136
|
+
readonly stateful: true;
|
|
137
|
+
readonly supportsEndpoints: true;
|
|
138
|
+
readonly autoCreate: true;
|
|
139
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
140
|
+
readonly internal: false;
|
|
141
|
+
readonly minVersion: 1;
|
|
142
|
+
readonly secret: false;
|
|
143
|
+
readonly stateful: true;
|
|
144
|
+
readonly supportsEndpoints: true;
|
|
145
|
+
readonly autoCreate: true;
|
|
146
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]] ? never : K]: (import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
147
|
+
readonly internal: false;
|
|
148
|
+
readonly minVersion: 1;
|
|
149
|
+
readonly secret: false;
|
|
150
|
+
readonly stateful: true;
|
|
151
|
+
readonly supportsEndpoints: true;
|
|
152
|
+
readonly autoCreate: true;
|
|
153
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
154
|
+
readonly internal: false;
|
|
155
|
+
readonly minVersion: 1;
|
|
156
|
+
readonly secret: false;
|
|
157
|
+
readonly stateful: true;
|
|
158
|
+
readonly supportsEndpoints: true;
|
|
159
|
+
readonly autoCreate: true;
|
|
160
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]; } : never>;
|
|
63
161
|
};
|
|
64
162
|
turnedOff: {
|
|
65
|
-
readonly id:
|
|
66
|
-
commandClass: (typeof CommandClasses)["Thermostat Fan Mode"];
|
|
67
|
-
property: "off";
|
|
68
|
-
};
|
|
163
|
+
readonly id: ValueIDBase;
|
|
69
164
|
readonly endpoint: (endpoint?: number | undefined) => {
|
|
70
165
|
readonly commandClass: (typeof CommandClasses)["Thermostat Fan Mode"];
|
|
71
166
|
readonly endpoint: number;
|
|
72
167
|
readonly property: "off";
|
|
73
168
|
};
|
|
74
169
|
readonly is: (valueId: import("@zwave-js/core/safe").ValueID) => boolean;
|
|
75
|
-
readonly meta: {
|
|
76
|
-
readonly
|
|
77
|
-
readonly type: "boolean";
|
|
170
|
+
readonly meta: Readonly<(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
171
|
+
readonly type: "any";
|
|
78
172
|
readonly readable: true;
|
|
79
173
|
readonly writeable: true;
|
|
80
|
-
}
|
|
81
|
-
|
|
174
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
175
|
+
readonly type: "any";
|
|
176
|
+
readonly readable: true;
|
|
177
|
+
readonly writeable: true;
|
|
178
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>) extends infer T ? { [K in keyof T as [undefined] extends [(ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
179
|
+
readonly type: "any";
|
|
180
|
+
readonly readable: true;
|
|
181
|
+
readonly writeable: true;
|
|
182
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
183
|
+
readonly type: "any";
|
|
184
|
+
readonly readable: true;
|
|
185
|
+
readonly writeable: true;
|
|
186
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]] ? never : K]: (ValueMetadata extends NonNullable<TBlueprint["meta"]> ? Readonly<{
|
|
187
|
+
readonly type: "any";
|
|
188
|
+
readonly readable: true;
|
|
189
|
+
readonly writeable: true;
|
|
190
|
+
}> : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<Readonly<{
|
|
191
|
+
readonly type: "any";
|
|
192
|
+
readonly readable: true;
|
|
193
|
+
readonly writeable: true;
|
|
194
|
+
}>, ("type" | "readable" | "writeable") & keyof NonNullable<TBlueprint["meta"]>> & TBlueprint["meta"]>)[K]; } : never>;
|
|
195
|
+
readonly options: Readonly<(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
196
|
+
readonly internal: false;
|
|
197
|
+
readonly minVersion: 1;
|
|
198
|
+
readonly secret: false;
|
|
82
199
|
readonly stateful: true;
|
|
200
|
+
readonly supportsEndpoints: true;
|
|
201
|
+
readonly autoCreate: true;
|
|
202
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
203
|
+
readonly internal: false;
|
|
204
|
+
readonly minVersion: 1;
|
|
83
205
|
readonly secret: false;
|
|
206
|
+
readonly stateful: true;
|
|
207
|
+
readonly supportsEndpoints: true;
|
|
208
|
+
readonly autoCreate: true;
|
|
209
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>) extends infer T ? { [K in keyof T as [undefined] extends [(import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
84
210
|
readonly internal: false;
|
|
211
|
+
readonly minVersion: 1;
|
|
212
|
+
readonly secret: false;
|
|
213
|
+
readonly stateful: true;
|
|
85
214
|
readonly supportsEndpoints: true;
|
|
86
215
|
readonly autoCreate: true;
|
|
87
|
-
|
|
88
|
-
|
|
216
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
217
|
+
readonly internal: false;
|
|
218
|
+
readonly minVersion: 1;
|
|
219
|
+
readonly secret: false;
|
|
220
|
+
readonly stateful: true;
|
|
221
|
+
readonly supportsEndpoints: true;
|
|
222
|
+
readonly autoCreate: true;
|
|
223
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]] ? never : K]: (import("@zwave-js/cc").CCValueOptions extends NonNullable<TBlueprint["options"]> ? {
|
|
224
|
+
readonly internal: false;
|
|
225
|
+
readonly minVersion: 1;
|
|
226
|
+
readonly secret: false;
|
|
227
|
+
readonly stateful: true;
|
|
228
|
+
readonly supportsEndpoints: true;
|
|
229
|
+
readonly autoCreate: true;
|
|
230
|
+
} : import("alcalzone-shared/types").Simplify<import("alcalzone-shared/types").Omit<{
|
|
231
|
+
readonly internal: false;
|
|
232
|
+
readonly minVersion: 1;
|
|
233
|
+
readonly secret: false;
|
|
234
|
+
readonly stateful: true;
|
|
235
|
+
readonly supportsEndpoints: true;
|
|
236
|
+
readonly autoCreate: true;
|
|
237
|
+
}, ("stateful" | "secret" | "internal" | "minVersion" | "supportsEndpoints" | "autoCreate") & keyof NonNullable<TBlueprint["options"]>> & TBlueprint["options"]>)[K]; } : never>;
|
|
89
238
|
};
|
|
90
239
|
}>;
|
|
91
240
|
export declare class ThermostatFanModeCCAPI extends CCAPI {
|
|
@@ -110,7 +259,7 @@ export declare class ThermostatFanModeCCSet extends ThermostatFanModeCC {
|
|
|
110
259
|
static from(_raw: CCRaw, _ctx: CCParsingContext): ThermostatFanModeCCSet;
|
|
111
260
|
mode: ThermostatFanMode;
|
|
112
261
|
off: boolean | undefined;
|
|
113
|
-
serialize(ctx: CCEncodingContext): Bytes
|
|
262
|
+
serialize(ctx: CCEncodingContext): Promise<Bytes>;
|
|
114
263
|
toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
|
|
115
264
|
}
|
|
116
265
|
export interface ThermostatFanModeCCReportOptions {
|