@zwave-js/cc 14.0.0-beta.4 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/cc/AlarmSensorCC.js +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
|
@@ -42,13 +42,45 @@ var import_CommandClass = require("../lib/CommandClass.js");
|
|
|
42
42
|
var import_CommandClassDecorators = require("../lib/CommandClassDecorators.js");
|
|
43
43
|
var import_Values = require("../lib/Values.js");
|
|
44
44
|
var import_Types = require("../lib/_Types.js");
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
var __esDecorate = function(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
46
|
+
function accept(f) {
|
|
47
|
+
if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected");
|
|
48
|
+
return f;
|
|
49
|
+
}
|
|
50
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
51
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
52
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
53
|
+
var _, done = false;
|
|
54
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
55
|
+
var context = {};
|
|
56
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
57
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
58
|
+
context.addInitializer = function(f) {
|
|
59
|
+
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
60
|
+
extraInitializers.push(accept(f || null));
|
|
61
|
+
};
|
|
62
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
63
|
+
if (kind === "accessor") {
|
|
64
|
+
if (result === void 0) continue;
|
|
65
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
66
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
67
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
68
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
69
|
+
} else if (_ = accept(result)) {
|
|
70
|
+
if (kind === "field") initializers.unshift(_);
|
|
71
|
+
else descriptor[key] = _;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
75
|
+
done = true;
|
|
76
|
+
};
|
|
77
|
+
var __runInitializers = function(thisArg, initializers, value) {
|
|
78
|
+
var useValue = arguments.length > 2;
|
|
79
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
80
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
81
|
+
}
|
|
82
|
+
return useValue ? value : void 0;
|
|
50
83
|
};
|
|
51
|
-
var SoundSwitchCCTonesNumberReport_1, SoundSwitchCCToneInfoReport_1, SoundSwitchCCToneInfoGet_1, SoundSwitchCCConfigurationSet_1, SoundSwitchCCConfigurationReport_1, SoundSwitchCCTonePlaySet_1, SoundSwitchCCTonePlayReport_1;
|
|
52
84
|
function __assertType(argName, typeName, boundHasError) {
|
|
53
85
|
const { ZWaveError: ZWaveError2, ZWaveErrorCodes: ZWaveErrorCodes2 } = require("@zwave-js/core");
|
|
54
86
|
if (boundHasError()) {
|
|
@@ -108,540 +140,700 @@ const SoundSwitchCCValues = Object.freeze({
|
|
|
108
140
|
})
|
|
109
141
|
})
|
|
110
142
|
});
|
|
111
|
-
let SoundSwitchCCAPI =
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
case import_Types.SoundSwitchCommand.TonePlaySet:
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
return super.supportsCommand(cmd);
|
|
124
|
-
}
|
|
125
|
-
async getToneCount() {
|
|
126
|
-
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonesNumberGet);
|
|
127
|
-
const cc = new SoundSwitchCCTonesNumberGet({
|
|
128
|
-
nodeId: this.endpoint.nodeId,
|
|
129
|
-
endpointIndex: this.endpoint.index
|
|
130
|
-
});
|
|
131
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
132
|
-
return response?.toneCount;
|
|
133
|
-
}
|
|
134
|
-
async getToneInfo(toneId) {
|
|
135
|
-
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
136
|
-
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ToneInfoGet);
|
|
137
|
-
const cc = new SoundSwitchCCToneInfoGet({
|
|
138
|
-
nodeId: this.endpoint.nodeId,
|
|
139
|
-
endpointIndex: this.endpoint.index,
|
|
140
|
-
toneId
|
|
141
|
-
});
|
|
142
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
143
|
-
if (response)
|
|
144
|
-
return (0, import_safe3.pick)(response, ["duration", "name"]);
|
|
145
|
-
}
|
|
146
|
-
async setConfiguration(defaultToneId, defaultVolume) {
|
|
147
|
-
__assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
|
|
148
|
-
__assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
|
|
149
|
-
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationSet);
|
|
150
|
-
const cc = new SoundSwitchCCConfigurationSet({
|
|
151
|
-
nodeId: this.endpoint.nodeId,
|
|
152
|
-
endpointIndex: this.endpoint.index,
|
|
153
|
-
defaultToneId,
|
|
154
|
-
defaultVolume
|
|
155
|
-
});
|
|
156
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
157
|
-
}
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
159
|
-
async getConfiguration() {
|
|
160
|
-
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationGet);
|
|
161
|
-
const cc = new SoundSwitchCCConfigurationGet({
|
|
162
|
-
nodeId: this.endpoint.nodeId,
|
|
163
|
-
endpointIndex: this.endpoint.index
|
|
164
|
-
});
|
|
165
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
166
|
-
if (response) {
|
|
167
|
-
return (0, import_safe3.pick)(response, ["defaultToneId", "defaultVolume"]);
|
|
143
|
+
let SoundSwitchCCAPI = (() => {
|
|
144
|
+
let _classDecorators = [(0, import_CommandClassDecorators.API)(import_safe.CommandClasses["Sound Switch"])];
|
|
145
|
+
let _classDescriptor;
|
|
146
|
+
let _classExtraInitializers = [];
|
|
147
|
+
let _classThis;
|
|
148
|
+
let _classSuper = import_API.CCAPI;
|
|
149
|
+
var SoundSwitchCCAPI2 = class extends _classSuper {
|
|
150
|
+
static {
|
|
151
|
+
_classThis = this;
|
|
168
152
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
throw new import_safe.ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
176
|
-
}
|
|
177
|
-
const cc = new SoundSwitchCCTonePlaySet({
|
|
178
|
-
nodeId: this.endpoint.nodeId,
|
|
179
|
-
endpointIndex: this.endpoint.index,
|
|
180
|
-
toneId,
|
|
181
|
-
volume
|
|
182
|
-
});
|
|
183
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
184
|
-
}
|
|
185
|
-
async stopPlaying() {
|
|
186
|
-
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
|
|
187
|
-
const cc = new SoundSwitchCCTonePlaySet({
|
|
188
|
-
nodeId: this.endpoint.nodeId,
|
|
189
|
-
endpointIndex: this.endpoint.index,
|
|
190
|
-
toneId: 0,
|
|
191
|
-
volume: 0
|
|
192
|
-
});
|
|
193
|
-
return this.host.sendCommand(cc, this.commandOptions);
|
|
194
|
-
}
|
|
195
|
-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
196
|
-
async getPlaying() {
|
|
197
|
-
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlayGet);
|
|
198
|
-
const cc = new SoundSwitchCCTonePlayGet({
|
|
199
|
-
nodeId: this.endpoint.nodeId,
|
|
200
|
-
endpointIndex: this.endpoint.index
|
|
201
|
-
});
|
|
202
|
-
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
203
|
-
if (response) {
|
|
204
|
-
return (0, import_safe3.pick)(response, ["toneId", "volume"]);
|
|
153
|
+
static {
|
|
154
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
155
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
156
|
+
SoundSwitchCCAPI2 = _classThis = _classDescriptor.value;
|
|
157
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
158
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
205
159
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
160
|
+
supportsCommand(cmd) {
|
|
161
|
+
switch (cmd) {
|
|
162
|
+
case import_Types.SoundSwitchCommand.TonesNumberGet:
|
|
163
|
+
case import_Types.SoundSwitchCommand.ToneInfoGet:
|
|
164
|
+
case import_Types.SoundSwitchCommand.ConfigurationGet:
|
|
165
|
+
case import_Types.SoundSwitchCommand.TonePlayGet:
|
|
166
|
+
return this.isSinglecast();
|
|
167
|
+
case import_Types.SoundSwitchCommand.ConfigurationSet:
|
|
168
|
+
case import_Types.SoundSwitchCommand.TonePlaySet:
|
|
169
|
+
return true;
|
|
170
|
+
}
|
|
171
|
+
return super.supportsCommand(cmd);
|
|
172
|
+
}
|
|
173
|
+
async getToneCount() {
|
|
174
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonesNumberGet);
|
|
175
|
+
const cc = new SoundSwitchCCTonesNumberGet({
|
|
176
|
+
nodeId: this.endpoint.nodeId,
|
|
177
|
+
endpointIndex: this.endpoint.index
|
|
178
|
+
});
|
|
179
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
180
|
+
return response?.toneCount;
|
|
181
|
+
}
|
|
182
|
+
async getToneInfo(toneId) {
|
|
183
|
+
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
184
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ToneInfoGet);
|
|
185
|
+
const cc = new SoundSwitchCCToneInfoGet({
|
|
186
|
+
nodeId: this.endpoint.nodeId,
|
|
187
|
+
endpointIndex: this.endpoint.index,
|
|
188
|
+
toneId
|
|
189
|
+
});
|
|
190
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
191
|
+
if (response)
|
|
192
|
+
return (0, import_safe3.pick)(response, ["duration", "name"]);
|
|
193
|
+
}
|
|
194
|
+
async setConfiguration(defaultToneId, defaultVolume) {
|
|
195
|
+
__assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
|
|
196
|
+
__assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
|
|
197
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationSet);
|
|
198
|
+
const cc = new SoundSwitchCCConfigurationSet({
|
|
199
|
+
nodeId: this.endpoint.nodeId,
|
|
200
|
+
endpointIndex: this.endpoint.index,
|
|
201
|
+
defaultToneId,
|
|
202
|
+
defaultVolume
|
|
203
|
+
});
|
|
204
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
205
|
+
}
|
|
206
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
207
|
+
async getConfiguration() {
|
|
208
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.ConfigurationGet);
|
|
209
|
+
const cc = new SoundSwitchCCConfigurationGet({
|
|
210
|
+
nodeId: this.endpoint.nodeId,
|
|
211
|
+
endpointIndex: this.endpoint.index
|
|
212
|
+
});
|
|
213
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
214
|
+
if (response) {
|
|
215
|
+
return (0, import_safe3.pick)(response, ["defaultToneId", "defaultVolume"]);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
async play(toneId, volume) {
|
|
219
|
+
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
220
|
+
__assertType("volume", "(optional) number", __assertType__optional_number.bind(void 0, volume));
|
|
221
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
|
|
222
|
+
if (toneId === 0) {
|
|
223
|
+
throw new import_safe.ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, import_safe.ZWaveErrorCodes.Argument_Invalid);
|
|
224
|
+
}
|
|
225
|
+
const cc = new SoundSwitchCCTonePlaySet({
|
|
226
|
+
nodeId: this.endpoint.nodeId,
|
|
227
|
+
endpointIndex: this.endpoint.index,
|
|
228
|
+
toneId,
|
|
229
|
+
volume
|
|
230
|
+
});
|
|
231
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
232
|
+
}
|
|
233
|
+
async stopPlaying() {
|
|
234
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlaySet);
|
|
235
|
+
const cc = new SoundSwitchCCTonePlaySet({
|
|
236
|
+
nodeId: this.endpoint.nodeId,
|
|
237
|
+
endpointIndex: this.endpoint.index,
|
|
238
|
+
toneId: 0,
|
|
239
|
+
volume: 0
|
|
240
|
+
});
|
|
241
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
242
|
+
}
|
|
243
|
+
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
244
|
+
async getPlaying() {
|
|
245
|
+
this.assertSupportsCommand(import_Types.SoundSwitchCommand, import_Types.SoundSwitchCommand.TonePlayGet);
|
|
246
|
+
const cc = new SoundSwitchCCTonePlayGet({
|
|
247
|
+
nodeId: this.endpoint.nodeId,
|
|
248
|
+
endpointIndex: this.endpoint.index
|
|
249
|
+
});
|
|
250
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
251
|
+
if (response) {
|
|
252
|
+
return (0, import_safe3.pick)(response, ["toneId", "volume"]);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
get [import_API.SET_VALUE]() {
|
|
256
|
+
return async function({ property }, value, options) {
|
|
257
|
+
if (property === "defaultToneId") {
|
|
258
|
+
if (typeof value !== "number") {
|
|
259
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
260
|
+
}
|
|
261
|
+
return this.setConfiguration(value, 255);
|
|
262
|
+
} else if (property === "defaultVolume") {
|
|
263
|
+
if (typeof value !== "number") {
|
|
264
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
265
|
+
}
|
|
266
|
+
return this.setConfiguration(
|
|
267
|
+
0,
|
|
268
|
+
/* keep current tone */
|
|
269
|
+
value
|
|
270
|
+
);
|
|
271
|
+
} else if (property === "volume") {
|
|
272
|
+
if (typeof value !== "number") {
|
|
273
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
274
|
+
}
|
|
275
|
+
this.tryGetValueDB()?.setValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index), value, { source: "driver", updateTimestamp: false });
|
|
276
|
+
} else if (property === "toneId") {
|
|
277
|
+
if (typeof value !== "number") {
|
|
278
|
+
(0, import_API.throwWrongValueType)(this.ccId, property, "number", typeof value);
|
|
279
|
+
}
|
|
280
|
+
let result;
|
|
281
|
+
if (value > 0) {
|
|
282
|
+
const volume = options?.volume !== void 0 ? options.volume : this.tryGetValueDB()?.getValue(SoundSwitchCCValues.volume.endpoint(this.endpoint.index));
|
|
283
|
+
result = await this.play(value, volume);
|
|
284
|
+
} else {
|
|
285
|
+
result = await this.stopPlaying();
|
|
286
|
+
}
|
|
287
|
+
if (this.isSinglecast() && !(0, import_safe.supervisedCommandSucceeded)(result)) {
|
|
288
|
+
this.schedulePoll({ property }, value, {
|
|
289
|
+
transition: "fast"
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
236
293
|
} else {
|
|
237
|
-
|
|
294
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
238
295
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
get [import_API.POLL_VALUE]() {
|
|
299
|
+
return async function({ property }) {
|
|
300
|
+
switch (property) {
|
|
301
|
+
case "defaultToneId":
|
|
302
|
+
case "defaultVolume":
|
|
303
|
+
return (await this.getConfiguration())?.[property];
|
|
304
|
+
case "toneId":
|
|
305
|
+
case "volume":
|
|
306
|
+
return (await this.getPlaying())?.[property];
|
|
307
|
+
default:
|
|
308
|
+
(0, import_API.throwUnsupportedProperty)(this.ccId, property);
|
|
243
309
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
const endpoint = this.getEndpoint(ctx);
|
|
272
|
-
const api = import_API.CCAPI.create(import_safe.CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
|
|
273
|
-
priority: import_safe.MessagePriority.NodeQuery
|
|
274
|
-
});
|
|
275
|
-
ctx.logNode(node.id, {
|
|
276
|
-
endpoint: this.endpointIndex,
|
|
277
|
-
message: `Interviewing ${this.ccName}...`,
|
|
278
|
-
direction: "none"
|
|
279
|
-
});
|
|
280
|
-
ctx.logNode(node.id, {
|
|
281
|
-
message: "requesting tone count...",
|
|
282
|
-
direction: "outbound"
|
|
283
|
-
});
|
|
284
|
-
const toneCount = await api.getToneCount();
|
|
285
|
-
if (toneCount != void 0) {
|
|
286
|
-
const logMessage = `supports ${toneCount} tones`;
|
|
287
|
-
ctx.logNode(node.id, {
|
|
288
|
-
message: logMessage,
|
|
289
|
-
direction: "inbound"
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
return SoundSwitchCCAPI2 = _classThis;
|
|
314
|
+
})();
|
|
315
|
+
let SoundSwitchCC = (() => {
|
|
316
|
+
let _classDecorators = [(0, import_CommandClassDecorators.commandClass)(import_safe.CommandClasses["Sound Switch"]), (0, import_CommandClassDecorators.implementedVersion)(2), (0, import_CommandClassDecorators.ccValues)(SoundSwitchCCValues)];
|
|
317
|
+
let _classDescriptor;
|
|
318
|
+
let _classExtraInitializers = [];
|
|
319
|
+
let _classThis;
|
|
320
|
+
let _classSuper = import_CommandClass.CommandClass;
|
|
321
|
+
var SoundSwitchCC2 = class extends _classSuper {
|
|
322
|
+
static {
|
|
323
|
+
_classThis = this;
|
|
324
|
+
}
|
|
325
|
+
static {
|
|
326
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
327
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
328
|
+
SoundSwitchCC2 = _classThis = _classDescriptor.value;
|
|
329
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
330
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
331
|
+
}
|
|
332
|
+
async interview(ctx) {
|
|
333
|
+
const node = this.getNode(ctx);
|
|
334
|
+
const endpoint = this.getEndpoint(ctx);
|
|
335
|
+
const api = import_API.CCAPI.create(import_safe.CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
|
|
336
|
+
priority: import_safe.MessagePriority.NodeQuery
|
|
290
337
|
});
|
|
291
|
-
} else {
|
|
292
338
|
ctx.logNode(node.id, {
|
|
293
339
|
endpoint: this.endpointIndex,
|
|
294
|
-
message:
|
|
295
|
-
|
|
340
|
+
message: `Interviewing ${this.ccName}...`,
|
|
341
|
+
direction: "none"
|
|
296
342
|
});
|
|
297
|
-
return;
|
|
298
|
-
}
|
|
299
|
-
ctx.logNode(node.id, {
|
|
300
|
-
message: "requesting current sound configuration...",
|
|
301
|
-
direction: "outbound"
|
|
302
|
-
});
|
|
303
|
-
const config = await api.getConfiguration();
|
|
304
|
-
if (config) {
|
|
305
|
-
const logMessage = `received current sound configuration:
|
|
306
|
-
default tone ID: ${config.defaultToneId}
|
|
307
|
-
default volume: ${config.defaultVolume}`;
|
|
308
343
|
ctx.logNode(node.id, {
|
|
309
|
-
message:
|
|
310
|
-
direction: "
|
|
344
|
+
message: "requesting tone count...",
|
|
345
|
+
direction: "outbound"
|
|
311
346
|
});
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
347
|
+
const toneCount = await api.getToneCount();
|
|
348
|
+
if (toneCount != void 0) {
|
|
349
|
+
const logMessage = `supports ${toneCount} tones`;
|
|
350
|
+
ctx.logNode(node.id, {
|
|
351
|
+
message: logMessage,
|
|
352
|
+
direction: "inbound"
|
|
353
|
+
});
|
|
354
|
+
} else {
|
|
355
|
+
ctx.logNode(node.id, {
|
|
356
|
+
endpoint: this.endpointIndex,
|
|
357
|
+
message: "Querying tone count timed out, skipping interview...",
|
|
358
|
+
level: "warn"
|
|
359
|
+
});
|
|
360
|
+
return;
|
|
361
|
+
}
|
|
315
362
|
ctx.logNode(node.id, {
|
|
316
|
-
message:
|
|
363
|
+
message: "requesting current sound configuration...",
|
|
317
364
|
direction: "outbound"
|
|
318
365
|
});
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
|
|
322
|
-
|
|
366
|
+
const config = await api.getConfiguration();
|
|
367
|
+
if (config) {
|
|
368
|
+
const logMessage = `received current sound configuration:
|
|
369
|
+
default tone ID: ${config.defaultToneId}
|
|
370
|
+
default volume: ${config.defaultVolume}`;
|
|
371
|
+
ctx.logNode(node.id, {
|
|
372
|
+
message: logMessage,
|
|
373
|
+
direction: "inbound"
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
const metadataStates = {};
|
|
377
|
+
for (let toneId = 1; toneId <= toneCount; toneId++) {
|
|
378
|
+
ctx.logNode(node.id, {
|
|
379
|
+
message: `requesting info for tone #${toneId}`,
|
|
380
|
+
direction: "outbound"
|
|
381
|
+
});
|
|
382
|
+
const info = await api.getToneInfo(toneId);
|
|
383
|
+
if (!info)
|
|
384
|
+
continue;
|
|
385
|
+
const logMessage = `received info for tone #${toneId}:
|
|
323
386
|
name: ${info.name}
|
|
324
387
|
duration: ${info.duration} seconds`;
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
388
|
+
ctx.logNode(node.id, {
|
|
389
|
+
message: logMessage,
|
|
390
|
+
direction: "inbound"
|
|
391
|
+
});
|
|
392
|
+
metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
|
|
393
|
+
}
|
|
394
|
+
this.setMetadata(ctx, SoundSwitchCCValues.defaultToneId, {
|
|
395
|
+
...SoundSwitchCCValues.defaultToneId.meta,
|
|
396
|
+
min: 1,
|
|
397
|
+
max: toneCount,
|
|
398
|
+
states: metadataStates
|
|
399
|
+
});
|
|
400
|
+
this.setMetadata(ctx, SoundSwitchCCValues.toneId, {
|
|
401
|
+
...SoundSwitchCCValues.toneId.meta,
|
|
402
|
+
min: 0,
|
|
403
|
+
max: toneCount,
|
|
404
|
+
states: {
|
|
405
|
+
0: "off",
|
|
406
|
+
...metadataStates,
|
|
407
|
+
[255]: "default"
|
|
408
|
+
}
|
|
328
409
|
});
|
|
329
|
-
|
|
410
|
+
this.setInterviewComplete(ctx, true);
|
|
330
411
|
}
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
toneCount
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
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
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
412
|
+
};
|
|
413
|
+
return SoundSwitchCC2 = _classThis;
|
|
414
|
+
})();
|
|
415
|
+
let SoundSwitchCCTonesNumberReport = (() => {
|
|
416
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonesNumberReport)];
|
|
417
|
+
let _classDescriptor;
|
|
418
|
+
let _classExtraInitializers = [];
|
|
419
|
+
let _classThis;
|
|
420
|
+
let _classSuper = SoundSwitchCC;
|
|
421
|
+
var SoundSwitchCCTonesNumberReport2 = class extends _classSuper {
|
|
422
|
+
static {
|
|
423
|
+
_classThis = this;
|
|
424
|
+
}
|
|
425
|
+
static {
|
|
426
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
427
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
428
|
+
SoundSwitchCCTonesNumberReport2 = _classThis = _classDescriptor.value;
|
|
429
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
430
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
431
|
+
}
|
|
432
|
+
constructor(options) {
|
|
433
|
+
super(options);
|
|
434
|
+
this.toneCount = options.toneCount;
|
|
435
|
+
}
|
|
436
|
+
static from(raw, ctx) {
|
|
437
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
438
|
+
const toneCount = raw.payload[0];
|
|
439
|
+
return new this({
|
|
440
|
+
nodeId: ctx.sourceNodeId,
|
|
441
|
+
toneCount
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
toneCount;
|
|
445
|
+
serialize(ctx) {
|
|
446
|
+
this.payload = import_safe2.Bytes.from([this.toneCount]);
|
|
447
|
+
return super.serialize(ctx);
|
|
448
|
+
}
|
|
449
|
+
toLogEntry(ctx) {
|
|
450
|
+
return {
|
|
451
|
+
...super.toLogEntry(ctx),
|
|
452
|
+
message: { "# of tones": this.toneCount }
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
};
|
|
456
|
+
return SoundSwitchCCTonesNumberReport2 = _classThis;
|
|
457
|
+
})();
|
|
458
|
+
let SoundSwitchCCTonesNumberGet = (() => {
|
|
459
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonesNumberGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCTonesNumberReport)];
|
|
460
|
+
let _classDescriptor;
|
|
461
|
+
let _classExtraInitializers = [];
|
|
462
|
+
let _classThis;
|
|
463
|
+
let _classSuper = SoundSwitchCC;
|
|
464
|
+
var SoundSwitchCCTonesNumberGet2 = class extends _classSuper {
|
|
465
|
+
static {
|
|
466
|
+
_classThis = this;
|
|
467
|
+
}
|
|
468
|
+
static {
|
|
469
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
470
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
471
|
+
SoundSwitchCCTonesNumberGet2 = _classThis = _classDescriptor.value;
|
|
472
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
473
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
474
|
+
}
|
|
475
|
+
};
|
|
476
|
+
return SoundSwitchCCTonesNumberGet2 = _classThis;
|
|
477
|
+
})();
|
|
478
|
+
let SoundSwitchCCToneInfoReport = (() => {
|
|
479
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ToneInfoReport)];
|
|
480
|
+
let _classDescriptor;
|
|
481
|
+
let _classExtraInitializers = [];
|
|
482
|
+
let _classThis;
|
|
483
|
+
let _classSuper = SoundSwitchCC;
|
|
484
|
+
var SoundSwitchCCToneInfoReport2 = class extends _classSuper {
|
|
485
|
+
static {
|
|
486
|
+
_classThis = this;
|
|
487
|
+
}
|
|
488
|
+
static {
|
|
489
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
490
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
491
|
+
SoundSwitchCCToneInfoReport2 = _classThis = _classDescriptor.value;
|
|
492
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
493
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
494
|
+
}
|
|
495
|
+
constructor(options) {
|
|
496
|
+
super(options);
|
|
497
|
+
this.toneId = options.toneId;
|
|
498
|
+
this.duration = options.duration;
|
|
499
|
+
this.name = options.name;
|
|
500
|
+
}
|
|
501
|
+
static from(raw, ctx) {
|
|
502
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4);
|
|
503
|
+
const toneId = raw.payload[0];
|
|
504
|
+
const duration = raw.payload.readUInt16BE(1);
|
|
505
|
+
const nameLength = raw.payload[3];
|
|
506
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 4 + nameLength);
|
|
507
|
+
const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
|
|
508
|
+
return new this({
|
|
509
|
+
nodeId: ctx.sourceNodeId,
|
|
510
|
+
toneId,
|
|
511
|
+
duration,
|
|
512
|
+
name
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
toneId;
|
|
516
|
+
duration;
|
|
517
|
+
name;
|
|
518
|
+
serialize(ctx) {
|
|
519
|
+
this.payload = import_safe2.Bytes.concat([
|
|
520
|
+
import_safe2.Bytes.from([this.toneId, 0, 0, this.name.length]),
|
|
521
|
+
import_safe2.Bytes.from(this.name, "utf8")
|
|
522
|
+
]);
|
|
523
|
+
this.payload.writeUInt16BE(this.duration, 1);
|
|
524
|
+
return super.serialize(ctx);
|
|
525
|
+
}
|
|
526
|
+
toLogEntry(ctx) {
|
|
527
|
+
return {
|
|
528
|
+
...super.toLogEntry(ctx),
|
|
529
|
+
message: {
|
|
530
|
+
"tone id": this.toneId,
|
|
531
|
+
duration: `${this.duration} seconds`,
|
|
532
|
+
name: this.name
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
return SoundSwitchCCToneInfoReport2 = _classThis;
|
|
538
|
+
})();
|
|
435
539
|
const testResponseForSoundSwitchToneInfoGet = (sent, received) => {
|
|
436
540
|
return received.toneId === sent.toneId;
|
|
437
541
|
};
|
|
438
|
-
let SoundSwitchCCToneInfoGet =
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
542
|
+
let SoundSwitchCCToneInfoGet = (() => {
|
|
543
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ToneInfoGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)];
|
|
544
|
+
let _classDescriptor;
|
|
545
|
+
let _classExtraInitializers = [];
|
|
546
|
+
let _classThis;
|
|
547
|
+
let _classSuper = SoundSwitchCC;
|
|
548
|
+
var SoundSwitchCCToneInfoGet2 = class extends _classSuper {
|
|
549
|
+
static {
|
|
550
|
+
_classThis = this;
|
|
551
|
+
}
|
|
552
|
+
static {
|
|
553
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
554
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
555
|
+
SoundSwitchCCToneInfoGet2 = _classThis = _classDescriptor.value;
|
|
556
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
557
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
558
|
+
}
|
|
559
|
+
constructor(options) {
|
|
560
|
+
super(options);
|
|
561
|
+
this.toneId = options.toneId;
|
|
562
|
+
}
|
|
563
|
+
static from(raw, ctx) {
|
|
564
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
565
|
+
const toneId = raw.payload[0];
|
|
566
|
+
return new this({
|
|
567
|
+
nodeId: ctx.sourceNodeId,
|
|
568
|
+
toneId
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
toneId;
|
|
572
|
+
serialize(ctx) {
|
|
573
|
+
this.payload = import_safe2.Bytes.from([this.toneId]);
|
|
574
|
+
return super.serialize(ctx);
|
|
575
|
+
}
|
|
576
|
+
toLogEntry(ctx) {
|
|
577
|
+
return {
|
|
578
|
+
...super.toLogEntry(ctx),
|
|
579
|
+
message: { "tone id": this.toneId }
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
return SoundSwitchCCToneInfoGet2 = _classThis;
|
|
584
|
+
})();
|
|
585
|
+
let SoundSwitchCCConfigurationSet = (() => {
|
|
586
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationSet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
587
|
+
let _classDescriptor;
|
|
588
|
+
let _classExtraInitializers = [];
|
|
589
|
+
let _classThis;
|
|
590
|
+
let _classSuper = SoundSwitchCC;
|
|
591
|
+
var SoundSwitchCCConfigurationSet2 = class extends _classSuper {
|
|
592
|
+
static {
|
|
593
|
+
_classThis = this;
|
|
594
|
+
}
|
|
595
|
+
static {
|
|
596
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
597
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
598
|
+
SoundSwitchCCConfigurationSet2 = _classThis = _classDescriptor.value;
|
|
599
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
600
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
601
|
+
}
|
|
602
|
+
constructor(options) {
|
|
603
|
+
super(options);
|
|
604
|
+
this.defaultVolume = options.defaultVolume;
|
|
605
|
+
this.defaultToneId = options.defaultToneId;
|
|
606
|
+
}
|
|
607
|
+
static from(raw, ctx) {
|
|
608
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
609
|
+
const defaultVolume = raw.payload[0];
|
|
610
|
+
const defaultToneId = raw.payload[1];
|
|
611
|
+
return new this({
|
|
612
|
+
nodeId: ctx.sourceNodeId,
|
|
613
|
+
defaultVolume,
|
|
614
|
+
defaultToneId
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
defaultVolume;
|
|
618
|
+
defaultToneId;
|
|
619
|
+
serialize(ctx) {
|
|
620
|
+
this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
|
|
621
|
+
return super.serialize(ctx);
|
|
622
|
+
}
|
|
623
|
+
toLogEntry(ctx) {
|
|
624
|
+
return {
|
|
625
|
+
...super.toLogEntry(ctx),
|
|
626
|
+
message: {
|
|
627
|
+
"default volume": `${this.defaultVolume} %`,
|
|
628
|
+
"default tone id": this.defaultToneId
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
return SoundSwitchCCConfigurationSet2 = _classThis;
|
|
634
|
+
})();
|
|
635
|
+
let SoundSwitchCCConfigurationReport = (() => {
|
|
636
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationReport), (0, import_CommandClassDecorators.ccValueProperty)("defaultVolume", SoundSwitchCCValues.defaultVolume), (0, import_CommandClassDecorators.ccValueProperty)("defaultToneId", SoundSwitchCCValues.defaultToneId)];
|
|
637
|
+
let _classDescriptor;
|
|
638
|
+
let _classExtraInitializers = [];
|
|
639
|
+
let _classThis;
|
|
640
|
+
let _classSuper = SoundSwitchCC;
|
|
641
|
+
var SoundSwitchCCConfigurationReport2 = class extends _classSuper {
|
|
642
|
+
static {
|
|
643
|
+
_classThis = this;
|
|
644
|
+
}
|
|
645
|
+
static {
|
|
646
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
647
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
648
|
+
SoundSwitchCCConfigurationReport2 = _classThis = _classDescriptor.value;
|
|
649
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
650
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
651
|
+
}
|
|
652
|
+
constructor(options) {
|
|
653
|
+
super(options);
|
|
654
|
+
this.defaultVolume = options.defaultVolume;
|
|
655
|
+
this.defaultToneId = options.defaultToneId;
|
|
656
|
+
}
|
|
657
|
+
static from(raw, ctx) {
|
|
658
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 2);
|
|
659
|
+
const defaultVolume = (0, import_math.clamp)(raw.payload[0], 0, 100);
|
|
660
|
+
const defaultToneId = raw.payload[1];
|
|
661
|
+
return new this({
|
|
662
|
+
nodeId: ctx.sourceNodeId,
|
|
663
|
+
defaultVolume,
|
|
664
|
+
defaultToneId
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
defaultVolume;
|
|
668
|
+
defaultToneId;
|
|
669
|
+
serialize(ctx) {
|
|
670
|
+
this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
|
|
671
|
+
return super.serialize(ctx);
|
|
672
|
+
}
|
|
673
|
+
toLogEntry(ctx) {
|
|
674
|
+
return {
|
|
675
|
+
...super.toLogEntry(ctx),
|
|
676
|
+
message: {
|
|
677
|
+
"default volume": `${this.defaultVolume} %`,
|
|
678
|
+
"default tone id": this.defaultToneId
|
|
679
|
+
}
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
return SoundSwitchCCConfigurationReport2 = _classThis;
|
|
684
|
+
})();
|
|
685
|
+
let SoundSwitchCCConfigurationGet = (() => {
|
|
686
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCConfigurationReport)];
|
|
687
|
+
let _classDescriptor;
|
|
688
|
+
let _classExtraInitializers = [];
|
|
689
|
+
let _classThis;
|
|
690
|
+
let _classSuper = SoundSwitchCC;
|
|
691
|
+
var SoundSwitchCCConfigurationGet2 = class extends _classSuper {
|
|
692
|
+
static {
|
|
693
|
+
_classThis = this;
|
|
694
|
+
}
|
|
695
|
+
static {
|
|
696
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
697
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
698
|
+
SoundSwitchCCConfigurationGet2 = _classThis = _classDescriptor.value;
|
|
699
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
700
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
return SoundSwitchCCConfigurationGet2 = _classThis;
|
|
704
|
+
})();
|
|
705
|
+
let SoundSwitchCCTonePlaySet = (() => {
|
|
706
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlaySet), (0, import_CommandClassDecorators.useSupervision)()];
|
|
707
|
+
let _classDescriptor;
|
|
708
|
+
let _classExtraInitializers = [];
|
|
709
|
+
let _classThis;
|
|
710
|
+
let _classSuper = SoundSwitchCC;
|
|
711
|
+
var SoundSwitchCCTonePlaySet2 = class extends _classSuper {
|
|
712
|
+
static {
|
|
713
|
+
_classThis = this;
|
|
714
|
+
}
|
|
715
|
+
static {
|
|
716
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
717
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
718
|
+
SoundSwitchCCTonePlaySet2 = _classThis = _classDescriptor.value;
|
|
719
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
720
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
721
|
+
}
|
|
722
|
+
constructor(options) {
|
|
723
|
+
super(options);
|
|
724
|
+
this.toneId = options.toneId;
|
|
725
|
+
this.volume = options.volume;
|
|
726
|
+
}
|
|
727
|
+
static from(raw, ctx) {
|
|
728
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
729
|
+
const toneId = raw.payload[0];
|
|
730
|
+
let volume;
|
|
731
|
+
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
732
|
+
volume = raw.payload[1];
|
|
495
733
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
nodeId: ctx.sourceNodeId,
|
|
515
|
-
defaultVolume,
|
|
516
|
-
defaultToneId
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
defaultVolume;
|
|
520
|
-
defaultToneId;
|
|
521
|
-
serialize(ctx) {
|
|
522
|
-
this.payload = import_safe2.Bytes.from([this.defaultVolume, this.defaultToneId]);
|
|
523
|
-
return super.serialize(ctx);
|
|
524
|
-
}
|
|
525
|
-
toLogEntry(ctx) {
|
|
526
|
-
return {
|
|
527
|
-
...super.toLogEntry(ctx),
|
|
528
|
-
message: {
|
|
529
|
-
"default volume": `${this.defaultVolume} %`,
|
|
530
|
-
"default tone id": this.defaultToneId
|
|
734
|
+
return new this({
|
|
735
|
+
nodeId: ctx.sourceNodeId,
|
|
736
|
+
toneId,
|
|
737
|
+
volume
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
toneId;
|
|
741
|
+
volume;
|
|
742
|
+
serialize(ctx) {
|
|
743
|
+
this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
|
|
744
|
+
return super.serialize(ctx);
|
|
745
|
+
}
|
|
746
|
+
toLogEntry(ctx) {
|
|
747
|
+
const message = {
|
|
748
|
+
"tone id": this.toneId
|
|
749
|
+
};
|
|
750
|
+
if (this.volume != void 0) {
|
|
751
|
+
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
531
752
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
(0, import_CommandClassDecorators.ccValue)(SoundSwitchCCValues.defaultVolume)
|
|
537
|
-
], SoundSwitchCCConfigurationReport.prototype, "defaultVolume", void 0);
|
|
538
|
-
__decorate([
|
|
539
|
-
(0, import_CommandClassDecorators.ccValue)(SoundSwitchCCValues.defaultToneId)
|
|
540
|
-
], SoundSwitchCCConfigurationReport.prototype, "defaultToneId", void 0);
|
|
541
|
-
SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = __decorate([
|
|
542
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationReport)
|
|
543
|
-
], SoundSwitchCCConfigurationReport);
|
|
544
|
-
let SoundSwitchCCConfigurationGet = class SoundSwitchCCConfigurationGet2 extends SoundSwitchCC {
|
|
545
|
-
};
|
|
546
|
-
SoundSwitchCCConfigurationGet = __decorate([
|
|
547
|
-
(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.ConfigurationGet),
|
|
548
|
-
(0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCConfigurationReport)
|
|
549
|
-
], SoundSwitchCCConfigurationGet);
|
|
550
|
-
let SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = class SoundSwitchCCTonePlaySet2 extends SoundSwitchCC {
|
|
551
|
-
constructor(options) {
|
|
552
|
-
super(options);
|
|
553
|
-
this.toneId = options.toneId;
|
|
554
|
-
this.volume = options.volume;
|
|
555
|
-
}
|
|
556
|
-
static from(raw, ctx) {
|
|
557
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
558
|
-
const toneId = raw.payload[0];
|
|
559
|
-
let volume;
|
|
560
|
-
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
561
|
-
volume = raw.payload[1];
|
|
562
|
-
}
|
|
563
|
-
return new SoundSwitchCCTonePlaySet_1({
|
|
564
|
-
nodeId: ctx.sourceNodeId,
|
|
565
|
-
toneId,
|
|
566
|
-
volume
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
toneId;
|
|
570
|
-
volume;
|
|
571
|
-
serialize(ctx) {
|
|
572
|
-
this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
|
|
573
|
-
return super.serialize(ctx);
|
|
574
|
-
}
|
|
575
|
-
toLogEntry(ctx) {
|
|
576
|
-
const message = {
|
|
577
|
-
"tone id": this.toneId
|
|
578
|
-
};
|
|
579
|
-
if (this.volume != void 0) {
|
|
580
|
-
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
753
|
+
return {
|
|
754
|
+
...super.toLogEntry(ctx),
|
|
755
|
+
message
|
|
756
|
+
};
|
|
581
757
|
}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
super(options);
|
|
595
|
-
this.toneId = options.toneId;
|
|
596
|
-
this.volume = options.volume;
|
|
597
|
-
}
|
|
598
|
-
static from(raw, ctx) {
|
|
599
|
-
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
600
|
-
const toneId = raw.payload[0];
|
|
601
|
-
let volume;
|
|
602
|
-
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
603
|
-
volume = raw.payload[1];
|
|
604
|
-
}
|
|
605
|
-
return new SoundSwitchCCTonePlayReport_1({
|
|
606
|
-
nodeId: ctx.sourceNodeId,
|
|
607
|
-
toneId,
|
|
608
|
-
volume
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
toneId;
|
|
612
|
-
volume;
|
|
613
|
-
serialize(ctx) {
|
|
614
|
-
this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
|
|
615
|
-
return super.serialize(ctx);
|
|
616
|
-
}
|
|
617
|
-
toLogEntry(ctx) {
|
|
618
|
-
const message = {
|
|
619
|
-
"tone id": this.toneId
|
|
620
|
-
};
|
|
621
|
-
if (this.volume != void 0) {
|
|
622
|
-
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
758
|
+
};
|
|
759
|
+
return SoundSwitchCCTonePlaySet2 = _classThis;
|
|
760
|
+
})();
|
|
761
|
+
let SoundSwitchCCTonePlayReport = (() => {
|
|
762
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlayReport), (0, import_CommandClassDecorators.ccValueProperty)("toneId", SoundSwitchCCValues.toneId), (0, import_CommandClassDecorators.ccValueProperty)("volume", SoundSwitchCCValues.volume)];
|
|
763
|
+
let _classDescriptor;
|
|
764
|
+
let _classExtraInitializers = [];
|
|
765
|
+
let _classThis;
|
|
766
|
+
let _classSuper = SoundSwitchCC;
|
|
767
|
+
var SoundSwitchCCTonePlayReport2 = class extends _classSuper {
|
|
768
|
+
static {
|
|
769
|
+
_classThis = this;
|
|
623
770
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
]
|
|
639
|
-
let
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
771
|
+
static {
|
|
772
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
773
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
774
|
+
SoundSwitchCCTonePlayReport2 = _classThis = _classDescriptor.value;
|
|
775
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
776
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
777
|
+
}
|
|
778
|
+
constructor(options) {
|
|
779
|
+
super(options);
|
|
780
|
+
this.toneId = options.toneId;
|
|
781
|
+
this.volume = options.volume;
|
|
782
|
+
}
|
|
783
|
+
static from(raw, ctx) {
|
|
784
|
+
(0, import_safe.validatePayload)(raw.payload.length >= 1);
|
|
785
|
+
const toneId = raw.payload[0];
|
|
786
|
+
let volume;
|
|
787
|
+
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
788
|
+
volume = raw.payload[1];
|
|
789
|
+
}
|
|
790
|
+
return new this({
|
|
791
|
+
nodeId: ctx.sourceNodeId,
|
|
792
|
+
toneId,
|
|
793
|
+
volume
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
toneId;
|
|
797
|
+
volume;
|
|
798
|
+
serialize(ctx) {
|
|
799
|
+
this.payload = import_safe2.Bytes.from([this.toneId, this.volume ?? 0]);
|
|
800
|
+
return super.serialize(ctx);
|
|
801
|
+
}
|
|
802
|
+
toLogEntry(ctx) {
|
|
803
|
+
const message = {
|
|
804
|
+
"tone id": this.toneId
|
|
805
|
+
};
|
|
806
|
+
if (this.volume != void 0) {
|
|
807
|
+
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
808
|
+
}
|
|
809
|
+
return {
|
|
810
|
+
...super.toLogEntry(ctx),
|
|
811
|
+
message
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
return SoundSwitchCCTonePlayReport2 = _classThis;
|
|
816
|
+
})();
|
|
817
|
+
let SoundSwitchCCTonePlayGet = (() => {
|
|
818
|
+
let _classDecorators = [(0, import_CommandClassDecorators.CCCommand)(import_Types.SoundSwitchCommand.TonePlayGet), (0, import_CommandClassDecorators.expectedCCResponse)(SoundSwitchCCTonePlayReport)];
|
|
819
|
+
let _classDescriptor;
|
|
820
|
+
let _classExtraInitializers = [];
|
|
821
|
+
let _classThis;
|
|
822
|
+
let _classSuper = SoundSwitchCC;
|
|
823
|
+
var SoundSwitchCCTonePlayGet2 = class extends _classSuper {
|
|
824
|
+
static {
|
|
825
|
+
_classThis = this;
|
|
826
|
+
}
|
|
827
|
+
static {
|
|
828
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
829
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
830
|
+
SoundSwitchCCTonePlayGet2 = _classThis = _classDescriptor.value;
|
|
831
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
832
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
833
|
+
}
|
|
834
|
+
};
|
|
835
|
+
return SoundSwitchCCTonePlayGet2 = _classThis;
|
|
836
|
+
})();
|
|
645
837
|
// Annotate the CommonJS export names for ESM import in node:
|
|
646
838
|
0 && (module.exports = {
|
|
647
839
|
SoundSwitchCC,
|