@zwave-js/cc 14.0.0-beta.4 → 14.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +381 -266
- package/build/cjs/cc/AlarmSensorCC.js.map +3 -3
- package/build/cjs/cc/AssociationCC.js +669 -503
- package/build/cjs/cc/AssociationCC.js.map +3 -3
- package/build/cjs/cc/AssociationGroupInfoCC.js +633 -492
- package/build/cjs/cc/AssociationGroupInfoCC.js.map +3 -3
- package/build/cjs/cc/BarrierOperatorCC.js +595 -429
- package/build/cjs/cc/BarrierOperatorCC.js.map +3 -3
- package/build/cjs/cc/BasicCC.js +354 -260
- package/build/cjs/cc/BasicCC.js.map +3 -3
- package/build/cjs/cc/BatteryCC.js +427 -345
- package/build/cjs/cc/BatteryCC.js.map +3 -3
- package/build/cjs/cc/BinarySensorCC.js +391 -276
- package/build/cjs/cc/BinarySensorCC.js.map +3 -3
- package/build/cjs/cc/BinarySwitchCC.js +347 -253
- package/build/cjs/cc/BinarySwitchCC.js.map +3 -3
- package/build/cjs/cc/CRC16CC.js +160 -85
- package/build/cjs/cc/CRC16CC.js.map +3 -3
- package/build/cjs/cc/CentralSceneCC.js +459 -324
- package/build/cjs/cc/CentralSceneCC.js.map +3 -3
- package/build/cjs/cc/ClimateControlScheduleCC.js +459 -293
- package/build/cjs/cc/ClimateControlScheduleCC.js.map +3 -3
- package/build/cjs/cc/ClockCC.js +254 -150
- package/build/cjs/cc/ClockCC.js.map +3 -3
- package/build/cjs/cc/ColorSwitchCC.js +758 -610
- package/build/cjs/cc/ColorSwitchCC.js.map +3 -3
- package/build/cjs/cc/ConfigurationCC.js +1700 -1453
- package/build/cjs/cc/ConfigurationCC.js.map +3 -3
- package/build/cjs/cc/DeviceResetLocallyCC.js +125 -49
- package/build/cjs/cc/DeviceResetLocallyCC.js.map +3 -3
- package/build/cjs/cc/DoorLockCC.js +904 -777
- package/build/cjs/cc/DoorLockCC.js.map +3 -3
- package/build/cjs/cc/DoorLockLoggingCC.js +321 -206
- package/build/cjs/cc/DoorLockLoggingCC.js.map +3 -3
- package/build/cjs/cc/EnergyProductionCC.js +249 -160
- package/build/cjs/cc/EnergyProductionCC.js.map +3 -3
- package/build/cjs/cc/EntryControlCC.js +619 -458
- package/build/cjs/cc/EntryControlCC.js.map +3 -3
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js +898 -698
- package/build/cjs/cc/FirmwareUpdateMetaDataCC.js.map +3 -3
- package/build/cjs/cc/HailCC.js +57 -11
- package/build/cjs/cc/HailCC.js.map +2 -2
- package/build/cjs/cc/HumidityControlModeCC.js +359 -233
- package/build/cjs/cc/HumidityControlModeCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlOperatingStateCC.js +189 -103
- package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/HumidityControlSetpointCC.js +682 -495
- package/build/cjs/cc/HumidityControlSetpointCC.js.map +3 -3
- package/build/cjs/cc/InclusionControllerCC.js +205 -114
- package/build/cjs/cc/InclusionControllerCC.js.map +3 -3
- package/build/cjs/cc/IndicatorCC.js +897 -736
- package/build/cjs/cc/IndicatorCC.js.map +3 -3
- package/build/cjs/cc/IrrigationCC.js +1651 -1405
- package/build/cjs/cc/IrrigationCC.js.map +3 -3
- package/build/cjs/cc/LanguageCC.js +268 -171
- package/build/cjs/cc/LanguageCC.js.map +3 -3
- package/build/cjs/cc/LockCC.js +254 -154
- package/build/cjs/cc/LockCC.js.map +3 -3
- package/build/cjs/cc/ManufacturerProprietaryCC.js +189 -129
- package/build/cjs/cc/ManufacturerProprietaryCC.js.map +2 -2
- package/build/cjs/cc/ManufacturerSpecificCC.js +319 -213
- package/build/cjs/cc/ManufacturerSpecificCC.js.map +3 -3
- package/build/cjs/cc/MeterCC.js +827 -707
- package/build/cjs/cc/MeterCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelAssociationCC.js +612 -478
- package/build/cjs/cc/MultiChannelAssociationCC.js.map +3 -3
- package/build/cjs/cc/MultiChannelCC.js +1037 -819
- package/build/cjs/cc/MultiChannelCC.js.map +3 -3
- package/build/cjs/cc/MultiCommandCC.js +172 -97
- package/build/cjs/cc/MultiCommandCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSensorCC.js +589 -449
- package/build/cjs/cc/MultilevelSensorCC.js.map +3 -3
- package/build/cjs/cc/MultilevelSwitchCC.js +587 -439
- package/build/cjs/cc/MultilevelSwitchCC.js.map +3 -3
- package/build/cjs/cc/NoOperationCC.js +89 -27
- package/build/cjs/cc/NoOperationCC.js.map +2 -2
- package/build/cjs/cc/NodeNamingCC.js +417 -277
- package/build/cjs/cc/NodeNamingCC.js.map +3 -3
- package/build/cjs/cc/NotificationCC.js +972 -818
- package/build/cjs/cc/NotificationCC.js.map +3 -3
- package/build/cjs/cc/PowerlevelCC.js +450 -303
- package/build/cjs/cc/PowerlevelCC.js.map +3 -3
- package/build/cjs/cc/ProtectionCC.js +686 -494
- package/build/cjs/cc/ProtectionCC.js.map +3 -3
- package/build/cjs/cc/SceneActivationCC.js +165 -97
- package/build/cjs/cc/SceneActivationCC.js.map +3 -3
- package/build/cjs/cc/SceneActuatorConfigurationCC.js +346 -243
- package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +3 -3
- package/build/cjs/cc/SceneControllerConfigurationCC.js +401 -298
- package/build/cjs/cc/SceneControllerConfigurationCC.js.map +3 -3
- package/build/cjs/cc/ScheduleEntryLockCC.js +1552 -1272
- package/build/cjs/cc/ScheduleEntryLockCC.js.map +3 -3
- package/build/cjs/cc/Security2CC.js +1483 -1219
- package/build/cjs/cc/Security2CC.js.map +3 -3
- package/build/cjs/cc/SecurityCC.js +839 -619
- package/build/cjs/cc/SecurityCC.js.map +3 -3
- package/build/cjs/cc/SoundSwitchCC.js +707 -515
- package/build/cjs/cc/SoundSwitchCC.js.map +3 -3
- package/build/cjs/cc/SupervisionCC.js +327 -237
- package/build/cjs/cc/SupervisionCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanModeCC.js +386 -263
- package/build/cjs/cc/ThermostatFanModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatFanStateCC.js +192 -106
- package/build/cjs/cc/ThermostatFanStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatModeCC.js +425 -302
- package/build/cjs/cc/ThermostatModeCC.js.map +3 -3
- package/build/cjs/cc/ThermostatOperatingStateCC.js +188 -102
- package/build/cjs/cc/ThermostatOperatingStateCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetbackCC.js +277 -173
- package/build/cjs/cc/ThermostatSetbackCC.js.map +3 -3
- package/build/cjs/cc/ThermostatSetpointCC.js +645 -491
- package/build/cjs/cc/ThermostatSetpointCC.js.map +3 -3
- package/build/cjs/cc/TimeCC.js +515 -353
- package/build/cjs/cc/TimeCC.js.map +3 -3
- package/build/cjs/cc/TimeParametersCC.js +302 -202
- package/build/cjs/cc/TimeParametersCC.js.map +3 -3
- package/build/cjs/cc/TransportServiceCC.js +433 -315
- package/build/cjs/cc/TransportServiceCC.js.map +3 -3
- package/build/cjs/cc/UserCodeCC.js +1385 -1102
- package/build/cjs/cc/UserCodeCC.js.map +3 -3
- package/build/cjs/cc/VersionCC.js +696 -562
- package/build/cjs/cc/VersionCC.js.map +3 -3
- package/build/cjs/cc/WakeUpCC.js +499 -346
- package/build/cjs/cc/WakeUpCC.js.map +3 -3
- package/build/cjs/cc/WindowCoveringCC.js +626 -478
- package/build/cjs/cc/WindowCoveringCC.js.map +3 -3
- package/build/cjs/cc/ZWaveLongRangeCC.js +57 -10
- package/build/cjs/cc/ZWaveLongRangeCC.js.map +2 -2
- package/build/cjs/cc/ZWavePlusCC.js +233 -159
- package/build/cjs/cc/ZWavePlusCC.js.map +3 -3
- package/build/cjs/cc/ZWaveProtocolCC.js +1515 -948
- package/build/cjs/cc/ZWaveProtocolCC.js.map +3 -3
- package/build/cjs/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/cjs/cc/manufacturerProprietary/Decorators.js.map +1 -1
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +395 -274
- package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +3 -3
- package/build/cjs/lib/CommandClassDecorators.d.ts +11 -15
- package/build/cjs/lib/CommandClassDecorators.js +19 -20
- package/build/cjs/lib/CommandClassDecorators.js.map +2 -2
- package/build/cjs/lib/Security2/Extension.d.ts +1 -1
- package/build/cjs/lib/Security2/Extension.js +217 -126
- package/build/cjs/lib/Security2/Extension.js.map +3 -3
- package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/esm/cc/AlarmSensorCC.js +389 -291
- package/build/esm/cc/AlarmSensorCC.js.map +1 -1
- package/build/esm/cc/AssociationCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationCC.js +678 -537
- package/build/esm/cc/AssociationCC.js.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/esm/cc/AssociationGroupInfoCC.js +659 -539
- package/build/esm/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/esm/cc/BarrierOperatorCC.js +634 -493
- package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
- package/build/esm/cc/BasicCC.d.ts.map +1 -1
- package/build/esm/cc/BasicCC.js +380 -302
- package/build/esm/cc/BasicCC.js.map +1 -1
- package/build/esm/cc/BatteryCC.d.ts.map +1 -1
- package/build/esm/cc/BatteryCC.js +449 -384
- package/build/esm/cc/BatteryCC.js.map +1 -1
- package/build/esm/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySensorCC.js +395 -297
- package/build/esm/cc/BinarySensorCC.js.map +1 -1
- package/build/esm/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/esm/cc/BinarySwitchCC.js +353 -274
- package/build/esm/cc/BinarySwitchCC.js.map +1 -1
- package/build/esm/cc/CRC16CC.js +162 -98
- package/build/esm/cc/CRC16CC.js.map +1 -1
- package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/esm/cc/CentralSceneCC.js +465 -351
- package/build/esm/cc/CentralSceneCC.js.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/esm/cc/ClimateControlScheduleCC.js +454 -313
- package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/esm/cc/ClockCC.js +248 -159
- package/build/esm/cc/ClockCC.js.map +1 -1
- package/build/esm/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/ColorSwitchCC.js +802 -677
- package/build/esm/cc/ColorSwitchCC.js.map +1 -1
- package/build/esm/cc/ConfigurationCC.js +1899 -1687
- package/build/esm/cc/ConfigurationCC.js.map +1 -1
- package/build/esm/cc/DeviceResetLocallyCC.js +124 -59
- package/build/esm/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/esm/cc/DoorLockCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockCC.js +951 -849
- package/build/esm/cc/DoorLockCC.js.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/esm/cc/DoorLockLoggingCC.js +316 -218
- package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/esm/cc/EnergyProductionCC.js +240 -164
- package/build/esm/cc/EnergyProductionCC.js.map +1 -1
- package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
- package/build/esm/cc/EntryControlCC.js +629 -493
- package/build/esm/cc/EntryControlCC.js.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js +938 -769
- package/build/esm/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/esm/cc/HailCC.js +51 -12
- package/build/esm/cc/HailCC.js.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlModeCC.js +357 -250
- package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlOperatingStateCC.js +182 -109
- package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/HumidityControlSetpointCC.js +706 -546
- package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/esm/cc/InclusionControllerCC.js +197 -119
- package/build/esm/cc/InclusionControllerCC.js.map +1 -1
- package/build/esm/cc/IndicatorCC.js +973 -835
- package/build/esm/cc/IndicatorCC.js.map +1 -1
- package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
- package/build/esm/cc/IrrigationCC.js +1697 -1496
- package/build/esm/cc/IrrigationCC.js.map +1 -1
- package/build/esm/cc/LanguageCC.d.ts.map +1 -1
- package/build/esm/cc/LanguageCC.js +266 -184
- package/build/esm/cc/LanguageCC.js.map +1 -1
- package/build/esm/cc/LockCC.d.ts.map +1 -1
- package/build/esm/cc/LockCC.js +247 -162
- package/build/esm/cc/LockCC.js.map +1 -1
- package/build/esm/cc/ManufacturerProprietaryCC.js +192 -141
- package/build/esm/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/esm/cc/ManufacturerSpecificCC.js +312 -223
- package/build/esm/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/esm/cc/MeterCC.d.ts.map +1 -1
- package/build/esm/cc/MeterCC.js +896 -795
- package/build/esm/cc/MeterCC.js.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelAssociationCC.js +631 -518
- package/build/esm/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/esm/cc/MultiChannelCC.js +1106 -921
- package/build/esm/cc/MultiChannelCC.js.map +1 -1
- package/build/esm/cc/MultiCommandCC.js +166 -102
- package/build/esm/cc/MultiCommandCC.js.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSensorCC.js +616 -497
- package/build/esm/cc/MultilevelSensorCC.js.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/MultilevelSwitchCC.js +621 -496
- package/build/esm/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/esm/cc/NoOperationCC.js +82 -29
- package/build/esm/cc/NoOperationCC.js.map +1 -1
- package/build/esm/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/esm/cc/NodeNamingCC.js +413 -294
- package/build/esm/cc/NodeNamingCC.js.map +1 -1
- package/build/esm/cc/NotificationCC.d.ts.map +1 -1
- package/build/esm/cc/NotificationCC.js +1097 -966
- package/build/esm/cc/NotificationCC.js.map +1 -1
- package/build/esm/cc/PowerlevelCC.js +437 -311
- package/build/esm/cc/PowerlevelCC.js.map +1 -1
- package/build/esm/cc/ProtectionCC.d.ts.map +1 -1
- package/build/esm/cc/ProtectionCC.js +704 -543
- package/build/esm/cc/ProtectionCC.js.map +1 -1
- package/build/esm/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/esm/cc/SceneActivationCC.js +157 -100
- package/build/esm/cc/SceneActivationCC.js.map +1 -1
- package/build/esm/cc/SceneActuatorConfigurationCC.js +357 -269
- package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/esm/cc/SceneControllerConfigurationCC.js +434 -346
- package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/esm/cc/ScheduleEntryLockCC.js +1596 -1357
- package/build/esm/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/esm/cc/Security2CC.js +1633 -1406
- package/build/esm/cc/Security2CC.js.map +1 -1
- package/build/esm/cc/SecurityCC.js +876 -687
- package/build/esm/cc/SecurityCC.js.map +1 -1
- package/build/esm/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/esm/cc/SoundSwitchCC.js +689 -526
- package/build/esm/cc/SoundSwitchCC.js.map +1 -1
- package/build/esm/cc/SupervisionCC.js +349 -272
- package/build/esm/cc/SupervisionCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanModeCC.js +388 -284
- package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatFanStateCC.js +184 -111
- package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatModeCC.js +435 -331
- package/build/esm/cc/ThermostatModeCC.js.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatOperatingStateCC.js +180 -107
- package/build/esm/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetbackCC.js +274 -185
- package/build/esm/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/esm/cc/ThermostatSetpointCC.js +674 -543
- package/build/esm/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/esm/cc/TimeCC.js +499 -360
- package/build/esm/cc/TimeCC.js.map +1 -1
- package/build/esm/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/esm/cc/TimeParametersCC.js +296 -211
- package/build/esm/cc/TimeParametersCC.js.map +1 -1
- package/build/esm/cc/TransportServiceCC.js +464 -363
- package/build/esm/cc/TransportServiceCC.js.map +1 -1
- package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
- package/build/esm/cc/UserCodeCC.js +1443 -1205
- package/build/esm/cc/UserCodeCC.js.map +1 -1
- package/build/esm/cc/VersionCC.d.ts.map +1 -1
- package/build/esm/cc/VersionCC.js +744 -635
- package/build/esm/cc/VersionCC.js.map +1 -1
- package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
- package/build/esm/cc/WakeUpCC.js +494 -364
- package/build/esm/cc/WakeUpCC.js.map +1 -1
- package/build/esm/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/esm/cc/WindowCoveringCC.js +655 -530
- package/build/esm/cc/WindowCoveringCC.js.map +1 -1
- package/build/esm/cc/ZWaveLongRangeCC.js +51 -11
- package/build/esm/cc/ZWaveLongRangeCC.js.map +1 -1
- package/build/esm/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/esm/cc/ZWavePlusCC.js +223 -162
- package/build/esm/cc/ZWavePlusCC.js.map +1 -1
- package/build/esm/cc/ZWaveProtocolCC.js +1443 -953
- package/build/esm/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts +4 -4
- package/build/esm/cc/manufacturerProprietary/Decorators.d.ts.map +1 -1
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js +390 -286
- package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/esm/lib/CommandClassDecorators.d.ts +11 -15
- package/build/esm/lib/CommandClassDecorators.d.ts.map +1 -1
- package/build/esm/lib/CommandClassDecorators.js +24 -24
- package/build/esm/lib/CommandClassDecorators.js.map +1 -1
- package/build/esm/lib/Security2/Extension.d.ts +1 -1
- package/build/esm/lib/Security2/Extension.d.ts.map +1 -1
- package/build/esm/lib/Security2/Extension.js +207 -123
- package/build/esm/lib/Security2/Extension.js.map +1 -1
- package/package.json +6 -6
|
@@ -1,10 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
6
34
|
};
|
|
7
|
-
var SoundSwitchCCTonesNumberReport_1, SoundSwitchCCToneInfoReport_1, SoundSwitchCCToneInfoGet_1, SoundSwitchCCConfigurationSet_1, SoundSwitchCCConfigurationReport_1, SoundSwitchCCTonePlaySet_1, SoundSwitchCCTonePlayReport_1;
|
|
8
35
|
function __assertType(argName, typeName, boundHasError) {
|
|
9
36
|
const { ZWaveError, ZWaveErrorCodes } = require("@zwave-js/core");
|
|
10
37
|
if (boundHasError()) {
|
|
@@ -37,7 +64,7 @@ import { pick } from "@zwave-js/shared/safe";
|
|
|
37
64
|
import { clamp } from "alcalzone-shared/math/index.js";
|
|
38
65
|
import { CCAPI, POLL_VALUE, SET_VALUE, throwUnsupportedProperty, throwWrongValueType, } from "../lib/API.js";
|
|
39
66
|
import { CommandClass, } from "../lib/CommandClass.js";
|
|
40
|
-
import { API, CCCommand,
|
|
67
|
+
import { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from "../lib/CommandClassDecorators.js";
|
|
41
68
|
import { V } from "../lib/Values.js";
|
|
42
69
|
import { SoundSwitchCommand } from "../lib/_Types.js";
|
|
43
70
|
export const SoundSwitchCCValues = Object.freeze({
|
|
@@ -73,561 +100,697 @@ export const SoundSwitchCCValues = Object.freeze({
|
|
|
73
100
|
}),
|
|
74
101
|
}),
|
|
75
102
|
});
|
|
76
|
-
let SoundSwitchCCAPI =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
async getToneCount() {
|
|
91
|
-
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonesNumberGet);
|
|
92
|
-
const cc = new SoundSwitchCCTonesNumberGet({
|
|
93
|
-
nodeId: this.endpoint.nodeId,
|
|
94
|
-
endpointIndex: this.endpoint.index,
|
|
95
|
-
});
|
|
96
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
97
|
-
return response?.toneCount;
|
|
98
|
-
}
|
|
99
|
-
async getToneInfo(toneId) {
|
|
100
|
-
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
101
|
-
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ToneInfoGet);
|
|
102
|
-
const cc = new SoundSwitchCCToneInfoGet({
|
|
103
|
-
nodeId: this.endpoint.nodeId,
|
|
104
|
-
endpointIndex: this.endpoint.index,
|
|
105
|
-
toneId,
|
|
106
|
-
});
|
|
107
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
108
|
-
if (response)
|
|
109
|
-
return pick(response, ["duration", "name"]);
|
|
110
|
-
}
|
|
111
|
-
async setConfiguration(defaultToneId, defaultVolume) {
|
|
112
|
-
__assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
|
|
113
|
-
__assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
|
|
114
|
-
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationSet);
|
|
115
|
-
const cc = new SoundSwitchCCConfigurationSet({
|
|
116
|
-
nodeId: this.endpoint.nodeId,
|
|
117
|
-
endpointIndex: this.endpoint.index,
|
|
118
|
-
defaultToneId,
|
|
119
|
-
defaultVolume,
|
|
120
|
-
});
|
|
121
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
122
|
-
}
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
124
|
-
async getConfiguration() {
|
|
125
|
-
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationGet);
|
|
126
|
-
const cc = new SoundSwitchCCConfigurationGet({
|
|
127
|
-
nodeId: this.endpoint.nodeId,
|
|
128
|
-
endpointIndex: this.endpoint.index,
|
|
129
|
-
});
|
|
130
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
131
|
-
if (response) {
|
|
132
|
-
return pick(response, ["defaultToneId", "defaultVolume"]);
|
|
103
|
+
let SoundSwitchCCAPI = (() => {
|
|
104
|
+
let _classDecorators = [API(CommandClasses["Sound Switch"])];
|
|
105
|
+
let _classDescriptor;
|
|
106
|
+
let _classExtraInitializers = [];
|
|
107
|
+
let _classThis;
|
|
108
|
+
let _classSuper = CCAPI;
|
|
109
|
+
var SoundSwitchCCAPI = class extends _classSuper {
|
|
110
|
+
static { _classThis = this; }
|
|
111
|
+
static {
|
|
112
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
113
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
114
|
+
SoundSwitchCCAPI = _classThis = _classDescriptor.value;
|
|
115
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
116
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
133
117
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
volume,
|
|
147
|
-
});
|
|
148
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
149
|
-
}
|
|
150
|
-
async stopPlaying() {
|
|
151
|
-
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
|
|
152
|
-
const cc = new SoundSwitchCCTonePlaySet({
|
|
153
|
-
nodeId: this.endpoint.nodeId,
|
|
154
|
-
endpointIndex: this.endpoint.index,
|
|
155
|
-
toneId: 0x00,
|
|
156
|
-
volume: 0x00,
|
|
157
|
-
});
|
|
158
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
159
|
-
}
|
|
160
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
161
|
-
async getPlaying() {
|
|
162
|
-
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlayGet);
|
|
163
|
-
const cc = new SoundSwitchCCTonePlayGet({
|
|
164
|
-
nodeId: this.endpoint.nodeId,
|
|
165
|
-
endpointIndex: this.endpoint.index,
|
|
166
|
-
});
|
|
167
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
168
|
-
if (response) {
|
|
169
|
-
return pick(response, ["toneId", "volume"]);
|
|
118
|
+
supportsCommand(cmd) {
|
|
119
|
+
switch (cmd) {
|
|
120
|
+
case SoundSwitchCommand.TonesNumberGet:
|
|
121
|
+
case SoundSwitchCommand.ToneInfoGet:
|
|
122
|
+
case SoundSwitchCommand.ConfigurationGet:
|
|
123
|
+
case SoundSwitchCommand.TonePlayGet:
|
|
124
|
+
return this.isSinglecast();
|
|
125
|
+
case SoundSwitchCommand.ConfigurationSet:
|
|
126
|
+
case SoundSwitchCommand.TonePlaySet:
|
|
127
|
+
return true; // This is mandatory
|
|
128
|
+
}
|
|
129
|
+
return super.supportsCommand(cmd);
|
|
170
130
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
131
|
+
async getToneCount() {
|
|
132
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonesNumberGet);
|
|
133
|
+
const cc = new SoundSwitchCCTonesNumberGet({
|
|
134
|
+
nodeId: this.endpoint.nodeId,
|
|
135
|
+
endpointIndex: this.endpoint.index,
|
|
136
|
+
});
|
|
137
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
138
|
+
return response?.toneCount;
|
|
139
|
+
}
|
|
140
|
+
async getToneInfo(toneId) {
|
|
141
|
+
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
142
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ToneInfoGet);
|
|
143
|
+
const cc = new SoundSwitchCCToneInfoGet({
|
|
144
|
+
nodeId: this.endpoint.nodeId,
|
|
145
|
+
endpointIndex: this.endpoint.index,
|
|
146
|
+
toneId,
|
|
147
|
+
});
|
|
148
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
149
|
+
if (response)
|
|
150
|
+
return pick(response, ["duration", "name"]);
|
|
151
|
+
}
|
|
152
|
+
async setConfiguration(defaultToneId, defaultVolume) {
|
|
153
|
+
__assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
|
|
154
|
+
__assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
|
|
155
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationSet);
|
|
156
|
+
const cc = new SoundSwitchCCConfigurationSet({
|
|
157
|
+
nodeId: this.endpoint.nodeId,
|
|
158
|
+
endpointIndex: this.endpoint.index,
|
|
159
|
+
defaultToneId,
|
|
160
|
+
defaultVolume,
|
|
161
|
+
});
|
|
162
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
163
|
+
}
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
165
|
+
async getConfiguration() {
|
|
166
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.ConfigurationGet);
|
|
167
|
+
const cc = new SoundSwitchCCConfigurationGet({
|
|
168
|
+
nodeId: this.endpoint.nodeId,
|
|
169
|
+
endpointIndex: this.endpoint.index,
|
|
170
|
+
});
|
|
171
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
172
|
+
if (response) {
|
|
173
|
+
return pick(response, ["defaultToneId", "defaultVolume"]);
|
|
179
174
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
175
|
+
}
|
|
176
|
+
async play(toneId, volume) {
|
|
177
|
+
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
178
|
+
__assertType("volume", "(optional) number", __assertType__optional_number.bind(void 0, volume));
|
|
179
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
|
|
180
|
+
if (toneId === 0) {
|
|
181
|
+
throw new ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, ZWaveErrorCodes.Argument_Invalid);
|
|
185
182
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
183
|
+
const cc = new SoundSwitchCCTonePlaySet({
|
|
184
|
+
nodeId: this.endpoint.nodeId,
|
|
185
|
+
endpointIndex: this.endpoint.index,
|
|
186
|
+
toneId,
|
|
187
|
+
volume,
|
|
188
|
+
});
|
|
189
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
190
|
+
}
|
|
191
|
+
async stopPlaying() {
|
|
192
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlaySet);
|
|
193
|
+
const cc = new SoundSwitchCCTonePlaySet({
|
|
194
|
+
nodeId: this.endpoint.nodeId,
|
|
195
|
+
endpointIndex: this.endpoint.index,
|
|
196
|
+
toneId: 0x00,
|
|
197
|
+
volume: 0x00,
|
|
198
|
+
});
|
|
199
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
200
|
+
}
|
|
201
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
202
|
+
async getPlaying() {
|
|
203
|
+
this.assertSupportsCommand(SoundSwitchCommand, SoundSwitchCommand.TonePlayGet);
|
|
204
|
+
const cc = new SoundSwitchCCTonePlayGet({
|
|
205
|
+
nodeId: this.endpoint.nodeId,
|
|
206
|
+
endpointIndex: this.endpoint.index,
|
|
207
|
+
});
|
|
208
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
209
|
+
if (response) {
|
|
210
|
+
return pick(response, ["toneId", "volume"]);
|
|
192
211
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
212
|
+
}
|
|
213
|
+
get [SET_VALUE]() {
|
|
214
|
+
return async function ({ property }, value, options) {
|
|
215
|
+
if (property === "defaultToneId") {
|
|
216
|
+
if (typeof value !== "number") {
|
|
217
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
218
|
+
}
|
|
219
|
+
return this.setConfiguration(value, 0xff);
|
|
196
220
|
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
: this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
|
|
203
|
-
result = await this.play(value, volume);
|
|
221
|
+
else if (property === "defaultVolume") {
|
|
222
|
+
if (typeof value !== "number") {
|
|
223
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
224
|
+
}
|
|
225
|
+
return this.setConfiguration(0x00, /* keep current tone */ value);
|
|
204
226
|
}
|
|
205
|
-
else {
|
|
206
|
-
|
|
227
|
+
else if (property === "volume") {
|
|
228
|
+
if (typeof value !== "number") {
|
|
229
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
230
|
+
}
|
|
231
|
+
// Allow playing a tone by first setting the volume, then the tone ID
|
|
232
|
+
this.tryGetValueDB()?.setValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index), value, { source: "driver", updateTimestamp: false });
|
|
207
233
|
}
|
|
208
|
-
if (
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
234
|
+
else if (property === "toneId") {
|
|
235
|
+
if (typeof value !== "number") {
|
|
236
|
+
throwWrongValueType(this.ccId, property, "number", typeof value);
|
|
237
|
+
}
|
|
238
|
+
let result;
|
|
239
|
+
if (value > 0) {
|
|
240
|
+
// Use provided volume or try to use the current volume if it exists
|
|
241
|
+
const volume = options?.volume !== undefined
|
|
242
|
+
? options.volume
|
|
243
|
+
: this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
|
|
244
|
+
result = await this.play(value, volume);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
result = await this.stopPlaying();
|
|
248
|
+
}
|
|
249
|
+
if (this.isSinglecast()
|
|
250
|
+
&& !supervisedCommandSucceeded(result)) {
|
|
251
|
+
// Verify the current value after a (short) delay, unless the command was supervised and successful
|
|
252
|
+
this.schedulePoll({ property }, value, {
|
|
253
|
+
transition: "fast",
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
return result;
|
|
214
257
|
}
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
throwUnsupportedProperty(this.ccId, property);
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
get [POLL_VALUE]() {
|
|
223
|
-
return async function ({ property }) {
|
|
224
|
-
switch (property) {
|
|
225
|
-
case "defaultToneId":
|
|
226
|
-
case "defaultVolume":
|
|
227
|
-
return (await this.getConfiguration())?.[property];
|
|
228
|
-
case "toneId":
|
|
229
|
-
case "volume":
|
|
230
|
-
return (await this.getPlaying())?.[property];
|
|
231
|
-
default:
|
|
258
|
+
else {
|
|
232
259
|
throwUnsupportedProperty(this.ccId, property);
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
get [POLL_VALUE]() {
|
|
264
|
+
return async function ({ property }) {
|
|
265
|
+
switch (property) {
|
|
266
|
+
case "defaultToneId":
|
|
267
|
+
case "defaultVolume":
|
|
268
|
+
return (await this.getConfiguration())?.[property];
|
|
269
|
+
case "toneId":
|
|
270
|
+
case "volume":
|
|
271
|
+
return (await this.getPlaying())?.[property];
|
|
272
|
+
default:
|
|
273
|
+
throwUnsupportedProperty(this.ccId, property);
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
return SoundSwitchCCAPI = _classThis;
|
|
279
|
+
})();
|
|
240
280
|
export { SoundSwitchCCAPI };
|
|
241
|
-
let SoundSwitchCC =
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
direction: "outbound",
|
|
256
|
-
});
|
|
257
|
-
const toneCount = await api.getToneCount();
|
|
258
|
-
if (toneCount != undefined) {
|
|
259
|
-
const logMessage = `supports ${toneCount} tones`;
|
|
260
|
-
ctx.logNode(node.id, {
|
|
261
|
-
message: logMessage,
|
|
262
|
-
direction: "inbound",
|
|
263
|
-
});
|
|
281
|
+
let SoundSwitchCC = (() => {
|
|
282
|
+
let _classDecorators = [commandClass(CommandClasses["Sound Switch"]), implementedVersion(2), ccValues(SoundSwitchCCValues)];
|
|
283
|
+
let _classDescriptor;
|
|
284
|
+
let _classExtraInitializers = [];
|
|
285
|
+
let _classThis;
|
|
286
|
+
let _classSuper = CommandClass;
|
|
287
|
+
var SoundSwitchCC = class extends _classSuper {
|
|
288
|
+
static { _classThis = this; }
|
|
289
|
+
static {
|
|
290
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
291
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
292
|
+
SoundSwitchCC = _classThis = _classDescriptor.value;
|
|
293
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
294
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
264
295
|
}
|
|
265
|
-
|
|
296
|
+
async interview(ctx) {
|
|
297
|
+
const node = this.getNode(ctx);
|
|
298
|
+
const endpoint = this.getEndpoint(ctx);
|
|
299
|
+
const api = CCAPI.create(CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
|
|
300
|
+
priority: MessagePriority.NodeQuery,
|
|
301
|
+
});
|
|
266
302
|
ctx.logNode(node.id, {
|
|
267
303
|
endpoint: this.endpointIndex,
|
|
268
|
-
message:
|
|
269
|
-
|
|
304
|
+
message: `Interviewing ${this.ccName}...`,
|
|
305
|
+
direction: "none",
|
|
270
306
|
});
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
ctx.logNode(node.id, {
|
|
274
|
-
message: "requesting current sound configuration...",
|
|
275
|
-
direction: "outbound",
|
|
276
|
-
});
|
|
277
|
-
const config = await api.getConfiguration();
|
|
278
|
-
if (config) {
|
|
279
|
-
const logMessage = `received current sound configuration:
|
|
280
|
-
default tone ID: ${config.defaultToneId}
|
|
281
|
-
default volume: ${config.defaultVolume}`;
|
|
282
307
|
ctx.logNode(node.id, {
|
|
283
|
-
message:
|
|
284
|
-
direction: "
|
|
308
|
+
message: "requesting tone count...",
|
|
309
|
+
direction: "outbound",
|
|
285
310
|
});
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
311
|
+
const toneCount = await api.getToneCount();
|
|
312
|
+
if (toneCount != undefined) {
|
|
313
|
+
const logMessage = `supports ${toneCount} tones`;
|
|
314
|
+
ctx.logNode(node.id, {
|
|
315
|
+
message: logMessage,
|
|
316
|
+
direction: "inbound",
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
else {
|
|
320
|
+
ctx.logNode(node.id, {
|
|
321
|
+
endpoint: this.endpointIndex,
|
|
322
|
+
message: "Querying tone count timed out, skipping interview...",
|
|
323
|
+
level: "warn",
|
|
324
|
+
});
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
289
327
|
ctx.logNode(node.id, {
|
|
290
|
-
message:
|
|
328
|
+
message: "requesting current sound configuration...",
|
|
291
329
|
direction: "outbound",
|
|
292
330
|
});
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
|
|
331
|
+
const config = await api.getConfiguration();
|
|
332
|
+
if (config) {
|
|
333
|
+
const logMessage = `received current sound configuration:
|
|
334
|
+
default tone ID: ${config.defaultToneId}
|
|
335
|
+
default volume: ${config.defaultVolume}`;
|
|
336
|
+
ctx.logNode(node.id, {
|
|
337
|
+
message: logMessage,
|
|
338
|
+
direction: "inbound",
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
const metadataStates = {};
|
|
342
|
+
for (let toneId = 1; toneId <= toneCount; toneId++) {
|
|
343
|
+
ctx.logNode(node.id, {
|
|
344
|
+
message: `requesting info for tone #${toneId}`,
|
|
345
|
+
direction: "outbound",
|
|
346
|
+
});
|
|
347
|
+
const info = await api.getToneInfo(toneId);
|
|
348
|
+
if (!info)
|
|
349
|
+
continue;
|
|
350
|
+
const logMessage = `received info for tone #${toneId}:
|
|
297
351
|
name: ${info.name}
|
|
298
352
|
duration: ${info.duration} seconds`;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
353
|
+
ctx.logNode(node.id, {
|
|
354
|
+
message: logMessage,
|
|
355
|
+
direction: "inbound",
|
|
356
|
+
});
|
|
357
|
+
metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
|
|
358
|
+
}
|
|
359
|
+
// Remember tone count and info on the default tone ID metadata
|
|
360
|
+
this.setMetadata(ctx, SoundSwitchCCValues.defaultToneId, {
|
|
361
|
+
...SoundSwitchCCValues.defaultToneId.meta,
|
|
362
|
+
min: 1,
|
|
363
|
+
max: toneCount,
|
|
364
|
+
states: metadataStates,
|
|
365
|
+
});
|
|
366
|
+
// Remember tone count and info on the tone ID metadata
|
|
367
|
+
this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
|
|
368
|
+
...SoundSwitchCCValues.toneId.meta,
|
|
369
|
+
min: 0,
|
|
370
|
+
max: toneCount,
|
|
371
|
+
states: {
|
|
372
|
+
0: "off",
|
|
373
|
+
...metadataStates,
|
|
374
|
+
[0xff]: "default",
|
|
375
|
+
},
|
|
302
376
|
});
|
|
303
|
-
|
|
377
|
+
// Remember that the interview is complete
|
|
378
|
+
this.setInterviewComplete(ctx, true);
|
|
304
379
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
min: 1,
|
|
309
|
-
max: toneCount,
|
|
310
|
-
states: metadataStates,
|
|
311
|
-
});
|
|
312
|
-
// Remember tone count and info on the tone ID metadata
|
|
313
|
-
this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
|
|
314
|
-
...SoundSwitchCCValues.toneId.meta,
|
|
315
|
-
min: 0,
|
|
316
|
-
max: toneCount,
|
|
317
|
-
states: {
|
|
318
|
-
0: "off",
|
|
319
|
-
...metadataStates,
|
|
320
|
-
[0xff]: "default",
|
|
321
|
-
},
|
|
322
|
-
});
|
|
323
|
-
// Remember that the interview is complete
|
|
324
|
-
this.setInterviewComplete(ctx, true);
|
|
325
|
-
}
|
|
326
|
-
};
|
|
327
|
-
SoundSwitchCC = __decorate([
|
|
328
|
-
commandClass(CommandClasses["Sound Switch"]),
|
|
329
|
-
implementedVersion(2),
|
|
330
|
-
ccValues(SoundSwitchCCValues)
|
|
331
|
-
], SoundSwitchCC);
|
|
380
|
+
};
|
|
381
|
+
return SoundSwitchCC = _classThis;
|
|
382
|
+
})();
|
|
332
383
|
export { SoundSwitchCC };
|
|
333
|
-
let SoundSwitchCCTonesNumberReport =
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
384
|
+
let SoundSwitchCCTonesNumberReport = (() => {
|
|
385
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.TonesNumberReport)];
|
|
386
|
+
let _classDescriptor;
|
|
387
|
+
let _classExtraInitializers = [];
|
|
388
|
+
let _classThis;
|
|
389
|
+
let _classSuper = SoundSwitchCC;
|
|
390
|
+
var SoundSwitchCCTonesNumberReport = class extends _classSuper {
|
|
391
|
+
static { _classThis = this; }
|
|
392
|
+
static {
|
|
393
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
394
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
395
|
+
SoundSwitchCCTonesNumberReport = _classThis = _classDescriptor.value;
|
|
396
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
397
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
398
|
+
}
|
|
399
|
+
constructor(options) {
|
|
400
|
+
super(options);
|
|
401
|
+
this.toneCount = options.toneCount;
|
|
402
|
+
}
|
|
403
|
+
static from(raw, ctx) {
|
|
404
|
+
validatePayload(raw.payload.length >= 1);
|
|
405
|
+
const toneCount = raw.payload[0];
|
|
406
|
+
return new this({
|
|
407
|
+
nodeId: ctx.sourceNodeId,
|
|
408
|
+
toneCount,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
toneCount;
|
|
412
|
+
serialize(ctx) {
|
|
413
|
+
this.payload = Bytes.from([this.toneCount]);
|
|
414
|
+
return super.serialize(ctx);
|
|
415
|
+
}
|
|
416
|
+
toLogEntry(ctx) {
|
|
417
|
+
return {
|
|
418
|
+
...super.toLogEntry(ctx),
|
|
419
|
+
message: { "# of tones": this.toneCount },
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
return SoundSwitchCCTonesNumberReport = _classThis;
|
|
424
|
+
})();
|
|
361
425
|
export { SoundSwitchCCTonesNumberReport };
|
|
362
|
-
let SoundSwitchCCTonesNumberGet =
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
426
|
+
let SoundSwitchCCTonesNumberGet = (() => {
|
|
427
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.TonesNumberGet), expectedCCResponse(SoundSwitchCCTonesNumberReport)];
|
|
428
|
+
let _classDescriptor;
|
|
429
|
+
let _classExtraInitializers = [];
|
|
430
|
+
let _classThis;
|
|
431
|
+
let _classSuper = SoundSwitchCC;
|
|
432
|
+
var SoundSwitchCCTonesNumberGet = class extends _classSuper {
|
|
433
|
+
static { _classThis = this; }
|
|
434
|
+
static {
|
|
435
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
436
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
437
|
+
SoundSwitchCCTonesNumberGet = _classThis = _classDescriptor.value;
|
|
438
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
439
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
return SoundSwitchCCTonesNumberGet = _classThis;
|
|
443
|
+
})();
|
|
368
444
|
export { SoundSwitchCCTonesNumberGet };
|
|
369
|
-
let SoundSwitchCCToneInfoReport =
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
445
|
+
let SoundSwitchCCToneInfoReport = (() => {
|
|
446
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.ToneInfoReport)];
|
|
447
|
+
let _classDescriptor;
|
|
448
|
+
let _classExtraInitializers = [];
|
|
449
|
+
let _classThis;
|
|
450
|
+
let _classSuper = SoundSwitchCC;
|
|
451
|
+
var SoundSwitchCCToneInfoReport = class extends _classSuper {
|
|
452
|
+
static { _classThis = this; }
|
|
453
|
+
static {
|
|
454
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
455
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
456
|
+
SoundSwitchCCToneInfoReport = _classThis = _classDescriptor.value;
|
|
457
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
458
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
459
|
+
}
|
|
460
|
+
constructor(options) {
|
|
461
|
+
super(options);
|
|
462
|
+
this.toneId = options.toneId;
|
|
463
|
+
this.duration = options.duration;
|
|
464
|
+
this.name = options.name;
|
|
465
|
+
}
|
|
466
|
+
static from(raw, ctx) {
|
|
467
|
+
validatePayload(raw.payload.length >= 4);
|
|
468
|
+
const toneId = raw.payload[0];
|
|
469
|
+
const duration = raw.payload.readUInt16BE(1);
|
|
470
|
+
const nameLength = raw.payload[3];
|
|
471
|
+
validatePayload(raw.payload.length >= 4 + nameLength);
|
|
472
|
+
const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
|
|
473
|
+
return new this({
|
|
474
|
+
nodeId: ctx.sourceNodeId,
|
|
475
|
+
toneId,
|
|
476
|
+
duration,
|
|
477
|
+
name,
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
toneId;
|
|
481
|
+
duration;
|
|
482
|
+
name;
|
|
483
|
+
serialize(ctx) {
|
|
484
|
+
this.payload = Bytes.concat([
|
|
485
|
+
Bytes.from([this.toneId, 0, 0, this.name.length]),
|
|
486
|
+
Bytes.from(this.name, "utf8"),
|
|
487
|
+
]);
|
|
488
|
+
this.payload.writeUInt16BE(this.duration, 1);
|
|
489
|
+
return super.serialize(ctx);
|
|
490
|
+
}
|
|
491
|
+
toLogEntry(ctx) {
|
|
492
|
+
return {
|
|
493
|
+
...super.toLogEntry(ctx),
|
|
494
|
+
message: {
|
|
495
|
+
"tone id": this.toneId,
|
|
496
|
+
duration: `${this.duration} seconds`,
|
|
497
|
+
name: this.name,
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
};
|
|
502
|
+
return SoundSwitchCCToneInfoReport = _classThis;
|
|
503
|
+
})();
|
|
415
504
|
export { SoundSwitchCCToneInfoReport };
|
|
416
505
|
const testResponseForSoundSwitchToneInfoGet = (sent, received) => {
|
|
417
506
|
return received.toneId === sent.toneId;
|
|
418
507
|
};
|
|
419
|
-
let SoundSwitchCCToneInfoGet =
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
508
|
+
let SoundSwitchCCToneInfoGet = (() => {
|
|
509
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.ToneInfoGet), expectedCCResponse(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)];
|
|
510
|
+
let _classDescriptor;
|
|
511
|
+
let _classExtraInitializers = [];
|
|
512
|
+
let _classThis;
|
|
513
|
+
let _classSuper = SoundSwitchCC;
|
|
514
|
+
var SoundSwitchCCToneInfoGet = class extends _classSuper {
|
|
515
|
+
static { _classThis = this; }
|
|
516
|
+
static {
|
|
517
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
518
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
519
|
+
SoundSwitchCCToneInfoGet = _classThis = _classDescriptor.value;
|
|
520
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
521
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
522
|
+
}
|
|
523
|
+
constructor(options) {
|
|
524
|
+
super(options);
|
|
525
|
+
this.toneId = options.toneId;
|
|
526
|
+
}
|
|
527
|
+
static from(raw, ctx) {
|
|
528
|
+
validatePayload(raw.payload.length >= 1);
|
|
529
|
+
const toneId = raw.payload[0];
|
|
530
|
+
return new this({
|
|
531
|
+
nodeId: ctx.sourceNodeId,
|
|
532
|
+
toneId,
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
toneId;
|
|
536
|
+
serialize(ctx) {
|
|
537
|
+
this.payload = Bytes.from([this.toneId]);
|
|
538
|
+
return super.serialize(ctx);
|
|
539
|
+
}
|
|
540
|
+
toLogEntry(ctx) {
|
|
541
|
+
return {
|
|
542
|
+
...super.toLogEntry(ctx),
|
|
543
|
+
message: { "tone id": this.toneId },
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
};
|
|
547
|
+
return SoundSwitchCCToneInfoGet = _classThis;
|
|
548
|
+
})();
|
|
448
549
|
export { SoundSwitchCCToneInfoGet };
|
|
449
|
-
let SoundSwitchCCConfigurationSet =
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
550
|
+
let SoundSwitchCCConfigurationSet = (() => {
|
|
551
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.ConfigurationSet), useSupervision()];
|
|
552
|
+
let _classDescriptor;
|
|
553
|
+
let _classExtraInitializers = [];
|
|
554
|
+
let _classThis;
|
|
555
|
+
let _classSuper = SoundSwitchCC;
|
|
556
|
+
var SoundSwitchCCConfigurationSet = class extends _classSuper {
|
|
557
|
+
static { _classThis = this; }
|
|
558
|
+
static {
|
|
559
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
560
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
561
|
+
SoundSwitchCCConfigurationSet = _classThis = _classDescriptor.value;
|
|
562
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
563
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
564
|
+
}
|
|
565
|
+
constructor(options) {
|
|
566
|
+
super(options);
|
|
567
|
+
this.defaultVolume = options.defaultVolume;
|
|
568
|
+
this.defaultToneId = options.defaultToneId;
|
|
569
|
+
}
|
|
570
|
+
static from(raw, ctx) {
|
|
571
|
+
validatePayload(raw.payload.length >= 2);
|
|
572
|
+
const defaultVolume = raw.payload[0];
|
|
573
|
+
const defaultToneId = raw.payload[1];
|
|
574
|
+
return new this({
|
|
575
|
+
nodeId: ctx.sourceNodeId,
|
|
576
|
+
defaultVolume,
|
|
577
|
+
defaultToneId,
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
defaultVolume;
|
|
581
|
+
defaultToneId;
|
|
582
|
+
serialize(ctx) {
|
|
583
|
+
this.payload = Bytes.from([this.defaultVolume, this.defaultToneId]);
|
|
584
|
+
return super.serialize(ctx);
|
|
585
|
+
}
|
|
586
|
+
toLogEntry(ctx) {
|
|
587
|
+
return {
|
|
588
|
+
...super.toLogEntry(ctx),
|
|
589
|
+
message: {
|
|
590
|
+
"default volume": `${this.defaultVolume} %`,
|
|
591
|
+
"default tone id": this.defaultToneId,
|
|
592
|
+
},
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
return SoundSwitchCCConfigurationSet = _classThis;
|
|
597
|
+
})();
|
|
485
598
|
export { SoundSwitchCCConfigurationSet };
|
|
486
|
-
let SoundSwitchCCConfigurationReport =
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
599
|
+
let SoundSwitchCCConfigurationReport = (() => {
|
|
600
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.ConfigurationReport), ccValueProperty("defaultVolume", SoundSwitchCCValues.defaultVolume), ccValueProperty("defaultToneId", SoundSwitchCCValues.defaultToneId)];
|
|
601
|
+
let _classDescriptor;
|
|
602
|
+
let _classExtraInitializers = [];
|
|
603
|
+
let _classThis;
|
|
604
|
+
let _classSuper = SoundSwitchCC;
|
|
605
|
+
var SoundSwitchCCConfigurationReport = class extends _classSuper {
|
|
606
|
+
static { _classThis = this; }
|
|
607
|
+
static {
|
|
608
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
609
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
610
|
+
SoundSwitchCCConfigurationReport = _classThis = _classDescriptor.value;
|
|
611
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
612
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
613
|
+
}
|
|
614
|
+
constructor(options) {
|
|
615
|
+
super(options);
|
|
616
|
+
this.defaultVolume = options.defaultVolume;
|
|
617
|
+
this.defaultToneId = options.defaultToneId;
|
|
618
|
+
}
|
|
619
|
+
static from(raw, ctx) {
|
|
620
|
+
validatePayload(raw.payload.length >= 2);
|
|
621
|
+
const defaultVolume = clamp(raw.payload[0], 0, 100);
|
|
622
|
+
const defaultToneId = raw.payload[1];
|
|
623
|
+
return new this({
|
|
624
|
+
nodeId: ctx.sourceNodeId,
|
|
625
|
+
defaultVolume,
|
|
626
|
+
defaultToneId,
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
defaultVolume;
|
|
630
|
+
defaultToneId;
|
|
631
|
+
serialize(ctx) {
|
|
632
|
+
this.payload = Bytes.from([this.defaultVolume, this.defaultToneId]);
|
|
633
|
+
return super.serialize(ctx);
|
|
634
|
+
}
|
|
635
|
+
toLogEntry(ctx) {
|
|
636
|
+
return {
|
|
637
|
+
...super.toLogEntry(ctx),
|
|
638
|
+
message: {
|
|
639
|
+
"default volume": `${this.defaultVolume} %`,
|
|
640
|
+
"default tone id": this.defaultToneId,
|
|
641
|
+
},
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
return SoundSwitchCCConfigurationReport = _classThis;
|
|
646
|
+
})();
|
|
527
647
|
export { SoundSwitchCCConfigurationReport };
|
|
528
|
-
let SoundSwitchCCConfigurationGet =
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
648
|
+
let SoundSwitchCCConfigurationGet = (() => {
|
|
649
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.ConfigurationGet), expectedCCResponse(SoundSwitchCCConfigurationReport)];
|
|
650
|
+
let _classDescriptor;
|
|
651
|
+
let _classExtraInitializers = [];
|
|
652
|
+
let _classThis;
|
|
653
|
+
let _classSuper = SoundSwitchCC;
|
|
654
|
+
var SoundSwitchCCConfigurationGet = class extends _classSuper {
|
|
655
|
+
static { _classThis = this; }
|
|
656
|
+
static {
|
|
657
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
658
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
659
|
+
SoundSwitchCCConfigurationGet = _classThis = _classDescriptor.value;
|
|
660
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
661
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
return SoundSwitchCCConfigurationGet = _classThis;
|
|
665
|
+
})();
|
|
534
666
|
export { SoundSwitchCCConfigurationGet };
|
|
535
|
-
let SoundSwitchCCTonePlaySet =
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
667
|
+
let SoundSwitchCCTonePlaySet = (() => {
|
|
668
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.TonePlaySet), useSupervision()];
|
|
669
|
+
let _classDescriptor;
|
|
670
|
+
let _classExtraInitializers = [];
|
|
671
|
+
let _classThis;
|
|
672
|
+
let _classSuper = SoundSwitchCC;
|
|
673
|
+
var SoundSwitchCCTonePlaySet = class extends _classSuper {
|
|
674
|
+
static { _classThis = this; }
|
|
675
|
+
static {
|
|
676
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
677
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
678
|
+
SoundSwitchCCTonePlaySet = _classThis = _classDescriptor.value;
|
|
679
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
680
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
681
|
+
}
|
|
682
|
+
constructor(options) {
|
|
683
|
+
super(options);
|
|
684
|
+
this.toneId = options.toneId;
|
|
685
|
+
this.volume = options.volume;
|
|
686
|
+
}
|
|
687
|
+
static from(raw, ctx) {
|
|
688
|
+
validatePayload(raw.payload.length >= 1);
|
|
689
|
+
const toneId = raw.payload[0];
|
|
690
|
+
let volume;
|
|
691
|
+
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
692
|
+
volume = raw.payload[1];
|
|
693
|
+
}
|
|
694
|
+
return new this({
|
|
695
|
+
nodeId: ctx.sourceNodeId,
|
|
696
|
+
toneId,
|
|
697
|
+
volume,
|
|
698
|
+
});
|
|
699
|
+
}
|
|
700
|
+
toneId;
|
|
701
|
+
volume;
|
|
702
|
+
serialize(ctx) {
|
|
703
|
+
this.payload = Bytes.from([this.toneId, this.volume ?? 0]);
|
|
704
|
+
return super.serialize(ctx);
|
|
705
|
+
}
|
|
706
|
+
toLogEntry(ctx) {
|
|
707
|
+
const message = {
|
|
708
|
+
"tone id": this.toneId,
|
|
709
|
+
};
|
|
710
|
+
if (this.volume != undefined) {
|
|
711
|
+
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
712
|
+
}
|
|
713
|
+
return {
|
|
714
|
+
...super.toLogEntry(ctx),
|
|
715
|
+
message,
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
};
|
|
719
|
+
return SoundSwitchCCTonePlaySet = _classThis;
|
|
720
|
+
})();
|
|
577
721
|
export { SoundSwitchCCTonePlaySet };
|
|
578
|
-
let SoundSwitchCCTonePlayReport =
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
722
|
+
let SoundSwitchCCTonePlayReport = (() => {
|
|
723
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.TonePlayReport), ccValueProperty("toneId", SoundSwitchCCValues.toneId), ccValueProperty("volume", SoundSwitchCCValues.volume)];
|
|
724
|
+
let _classDescriptor;
|
|
725
|
+
let _classExtraInitializers = [];
|
|
726
|
+
let _classThis;
|
|
727
|
+
let _classSuper = SoundSwitchCC;
|
|
728
|
+
var SoundSwitchCCTonePlayReport = class extends _classSuper {
|
|
729
|
+
static { _classThis = this; }
|
|
730
|
+
static {
|
|
731
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
732
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
733
|
+
SoundSwitchCCTonePlayReport = _classThis = _classDescriptor.value;
|
|
734
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
735
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
736
|
+
}
|
|
737
|
+
constructor(options) {
|
|
738
|
+
super(options);
|
|
739
|
+
this.toneId = options.toneId;
|
|
740
|
+
this.volume = options.volume;
|
|
741
|
+
}
|
|
742
|
+
static from(raw, ctx) {
|
|
743
|
+
validatePayload(raw.payload.length >= 1);
|
|
744
|
+
const toneId = raw.payload[0];
|
|
745
|
+
let volume;
|
|
746
|
+
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
747
|
+
volume = raw.payload[1];
|
|
748
|
+
}
|
|
749
|
+
return new this({
|
|
750
|
+
nodeId: ctx.sourceNodeId,
|
|
751
|
+
toneId,
|
|
752
|
+
volume,
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
toneId;
|
|
756
|
+
volume;
|
|
757
|
+
serialize(ctx) {
|
|
758
|
+
this.payload = Bytes.from([this.toneId, this.volume ?? 0]);
|
|
759
|
+
return super.serialize(ctx);
|
|
760
|
+
}
|
|
761
|
+
toLogEntry(ctx) {
|
|
762
|
+
const message = {
|
|
763
|
+
"tone id": this.toneId,
|
|
764
|
+
};
|
|
765
|
+
if (this.volume != undefined) {
|
|
766
|
+
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
767
|
+
}
|
|
768
|
+
return {
|
|
769
|
+
...super.toLogEntry(ctx),
|
|
770
|
+
message,
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
return SoundSwitchCCTonePlayReport = _classThis;
|
|
775
|
+
})();
|
|
625
776
|
export { SoundSwitchCCTonePlayReport };
|
|
626
|
-
let SoundSwitchCCTonePlayGet =
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
777
|
+
let SoundSwitchCCTonePlayGet = (() => {
|
|
778
|
+
let _classDecorators = [CCCommand(SoundSwitchCommand.TonePlayGet), expectedCCResponse(SoundSwitchCCTonePlayReport)];
|
|
779
|
+
let _classDescriptor;
|
|
780
|
+
let _classExtraInitializers = [];
|
|
781
|
+
let _classThis;
|
|
782
|
+
let _classSuper = SoundSwitchCC;
|
|
783
|
+
var SoundSwitchCCTonePlayGet = class extends _classSuper {
|
|
784
|
+
static { _classThis = this; }
|
|
785
|
+
static {
|
|
786
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
787
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
788
|
+
SoundSwitchCCTonePlayGet = _classThis = _classDescriptor.value;
|
|
789
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
790
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
791
|
+
}
|
|
792
|
+
};
|
|
793
|
+
return SoundSwitchCCTonePlayGet = _classThis;
|
|
794
|
+
})();
|
|
632
795
|
export { SoundSwitchCCTonePlayGet };
|
|
633
796
|
//# sourceMappingURL=SoundSwitchCC.js.map
|