@zwave-js/cc 13.10.1 → 14.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cc/AlarmSensorCC.d.ts +31 -20
- package/build/cc/AlarmSensorCC.d.ts.map +1 -1
- package/build/cc/AlarmSensorCC.js +106 -87
- package/build/cc/AlarmSensorCC.js.map +1 -1
- package/build/cc/AssociationCC.d.ts +38 -32
- package/build/cc/AssociationCC.d.ts.map +1 -1
- package/build/cc/AssociationCC.js +193 -176
- package/build/cc/AssociationCC.js.map +1 -1
- package/build/cc/AssociationGroupInfoCC.d.ts +42 -36
- package/build/cc/AssociationGroupInfoCC.d.ts.map +1 -1
- package/build/cc/AssociationGroupInfoCC.js +218 -200
- package/build/cc/AssociationGroupInfoCC.js.map +1 -1
- package/build/cc/BarrierOperatorCC.d.ts +41 -24
- package/build/cc/BarrierOperatorCC.d.ts.map +1 -1
- package/build/cc/BarrierOperatorCC.js +143 -109
- package/build/cc/BarrierOperatorCC.js.map +1 -1
- package/build/cc/BasicCC.d.ts +22 -23
- package/build/cc/BasicCC.d.ts.map +1 -1
- package/build/cc/BasicCC.js +83 -77
- package/build/cc/BasicCC.js.map +1 -1
- package/build/cc/BatteryCC.d.ts +22 -14
- package/build/cc/BatteryCC.d.ts.map +1 -1
- package/build/cc/BatteryCC.js +116 -87
- package/build/cc/BatteryCC.js.map +1 -1
- package/build/cc/BinarySensorCC.d.ts +22 -19
- package/build/cc/BinarySensorCC.d.ts.map +1 -1
- package/build/cc/BinarySensorCC.js +103 -93
- package/build/cc/BinarySensorCC.js.map +1 -1
- package/build/cc/BinarySwitchCC.d.ts +20 -20
- package/build/cc/BinarySwitchCC.d.ts.map +1 -1
- package/build/cc/BinarySwitchCC.js +71 -59
- package/build/cc/BinarySwitchCC.js.map +1 -1
- package/build/cc/CRC16CC.d.ts +9 -9
- package/build/cc/CRC16CC.d.ts.map +1 -1
- package/build/cc/CRC16CC.js +36 -36
- package/build/cc/CRC16CC.js.map +1 -1
- package/build/cc/CentralSceneCC.d.ts +34 -16
- package/build/cc/CentralSceneCC.d.ts.map +1 -1
- package/build/cc/CentralSceneCC.js +116 -79
- package/build/cc/CentralSceneCC.js.map +1 -1
- package/build/cc/ClimateControlScheduleCC.d.ts +38 -21
- package/build/cc/ClimateControlScheduleCC.d.ts.map +1 -1
- package/build/cc/ClimateControlScheduleCC.js +113 -81
- package/build/cc/ClimateControlScheduleCC.js.map +1 -1
- package/build/cc/ClockCC.d.ts +18 -11
- package/build/cc/ClockCC.d.ts.map +1 -1
- package/build/cc/ClockCC.js +57 -43
- package/build/cc/ClockCC.js.map +1 -1
- package/build/cc/ColorSwitchCC.d.ts +37 -33
- package/build/cc/ColorSwitchCC.d.ts.map +1 -1
- package/build/cc/ColorSwitchCC.js +216 -189
- package/build/cc/ColorSwitchCC.js.map +1 -1
- package/build/cc/ConfigurationCC.d.ts +89 -74
- package/build/cc/ConfigurationCC.d.ts.map +1 -1
- package/build/cc/ConfigurationCC.js +541 -485
- package/build/cc/ConfigurationCC.js.map +1 -1
- package/build/cc/DeviceResetLocallyCC.d.ts +3 -3
- package/build/cc/DeviceResetLocallyCC.d.ts.map +1 -1
- package/build/cc/DeviceResetLocallyCC.js +14 -14
- package/build/cc/DeviceResetLocallyCC.js.map +1 -1
- package/build/cc/DoorLockCC.d.ts +66 -27
- package/build/cc/DoorLockCC.d.ts.map +1 -1
- package/build/cc/DoorLockCC.js +288 -197
- package/build/cc/DoorLockCC.js.map +1 -1
- package/build/cc/DoorLockLoggingCC.d.ts +23 -13
- package/build/cc/DoorLockLoggingCC.d.ts.map +1 -1
- package/build/cc/DoorLockLoggingCC.js +81 -63
- package/build/cc/DoorLockLoggingCC.js.map +1 -1
- package/build/cc/EnergyProductionCC.d.ts +16 -14
- package/build/cc/EnergyProductionCC.d.ts.map +1 -1
- package/build/cc/EnergyProductionCC.js +58 -52
- package/build/cc/EnergyProductionCC.js.map +1 -1
- package/build/cc/EntryControlCC.d.ts +44 -18
- package/build/cc/EntryControlCC.d.ts.map +1 -1
- package/build/cc/EntryControlCC.js +163 -112
- package/build/cc/EntryControlCC.js.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts +69 -34
- package/build/cc/FirmwareUpdateMetaDataCC.d.ts.map +1 -1
- package/build/cc/FirmwareUpdateMetaDataCC.js +311 -245
- package/build/cc/FirmwareUpdateMetaDataCC.js.map +1 -1
- package/build/cc/HumidityControlModeCC.d.ts +24 -16
- package/build/cc/HumidityControlModeCC.d.ts.map +1 -1
- package/build/cc/HumidityControlModeCC.js +80 -65
- package/build/cc/HumidityControlModeCC.js.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.d.ts +11 -7
- package/build/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
- package/build/cc/HumidityControlOperatingStateCC.js +31 -22
- package/build/cc/HumidityControlOperatingStateCC.js.map +1 -1
- package/build/cc/HumidityControlSetpointCC.d.ts +68 -49
- package/build/cc/HumidityControlSetpointCC.d.ts.map +1 -1
- package/build/cc/HumidityControlSetpointCC.js +203 -181
- package/build/cc/HumidityControlSetpointCC.js.map +1 -1
- package/build/cc/InclusionControllerCC.d.ts +13 -11
- package/build/cc/InclusionControllerCC.d.ts.map +1 -1
- package/build/cc/InclusionControllerCC.js +49 -42
- package/build/cc/InclusionControllerCC.js.map +1 -1
- package/build/cc/IndicatorCC.d.ts +46 -39
- package/build/cc/IndicatorCC.d.ts.map +1 -1
- package/build/cc/IndicatorCC.js +298 -277
- package/build/cc/IndicatorCC.js.map +1 -1
- package/build/cc/IrrigationCC.d.ts +127 -57
- package/build/cc/IrrigationCC.d.ts.map +1 -1
- package/build/cc/IrrigationCC.js +496 -352
- package/build/cc/IrrigationCC.js.map +1 -1
- package/build/cc/LanguageCC.d.ts +17 -11
- package/build/cc/LanguageCC.d.ts.map +1 -1
- package/build/cc/LanguageCC.js +54 -44
- package/build/cc/LanguageCC.js.map +1 -1
- package/build/cc/LockCC.d.ts +16 -11
- package/build/cc/LockCC.d.ts.map +1 -1
- package/build/cc/LockCC.js +48 -38
- package/build/cc/LockCC.js.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.d.ts +12 -11
- package/build/cc/ManufacturerProprietaryCC.d.ts.map +1 -1
- package/build/cc/ManufacturerProprietaryCC.js +45 -50
- package/build/cc/ManufacturerProprietaryCC.js.map +1 -1
- package/build/cc/ManufacturerSpecificCC.d.ts +20 -13
- package/build/cc/ManufacturerSpecificCC.d.ts.map +1 -1
- package/build/cc/ManufacturerSpecificCC.js +79 -63
- package/build/cc/ManufacturerSpecificCC.js.map +1 -1
- package/build/cc/MeterCC.d.ts +30 -26
- package/build/cc/MeterCC.d.ts.map +1 -1
- package/build/cc/MeterCC.js +236 -204
- package/build/cc/MeterCC.js.map +1 -1
- package/build/cc/MultiChannelAssociationCC.d.ts +31 -26
- package/build/cc/MultiChannelAssociationCC.d.ts.map +1 -1
- package/build/cc/MultiChannelAssociationCC.js +177 -168
- package/build/cc/MultiChannelAssociationCC.js.map +1 -1
- package/build/cc/MultiChannelCC.d.ts +70 -49
- package/build/cc/MultiChannelCC.d.ts.map +1 -1
- package/build/cc/MultiChannelCC.js +377 -318
- package/build/cc/MultiChannelCC.js.map +1 -1
- package/build/cc/MultiCommandCC.d.ts +9 -9
- package/build/cc/MultiCommandCC.d.ts.map +1 -1
- package/build/cc/MultiCommandCC.js +35 -36
- package/build/cc/MultiCommandCC.js.map +1 -1
- package/build/cc/MultilevelSensorCC.d.ts +38 -33
- package/build/cc/MultilevelSensorCC.d.ts.map +1 -1
- package/build/cc/MultilevelSensorCC.js +172 -152
- package/build/cc/MultilevelSensorCC.js.map +1 -1
- package/build/cc/MultilevelSwitchCC.d.ts +29 -25
- package/build/cc/MultilevelSwitchCC.d.ts.map +1 -1
- package/build/cc/MultilevelSwitchCC.js +147 -127
- package/build/cc/MultilevelSwitchCC.js.map +1 -1
- package/build/cc/NoOperationCC.d.ts +0 -8
- package/build/cc/NoOperationCC.d.ts.map +1 -1
- package/build/cc/NoOperationCC.js +2 -11
- package/build/cc/NoOperationCC.js.map +1 -1
- package/build/cc/NodeNamingCC.d.ts +27 -17
- package/build/cc/NodeNamingCC.d.ts.map +1 -1
- package/build/cc/NodeNamingCC.js +86 -69
- package/build/cc/NodeNamingCC.js.map +1 -1
- package/build/cc/NotificationCC.d.ts +46 -43
- package/build/cc/NotificationCC.d.ts.map +1 -1
- package/build/cc/NotificationCC.js +317 -303
- package/build/cc/NotificationCC.js.map +1 -1
- package/build/cc/PowerlevelCC.d.ts +22 -18
- package/build/cc/PowerlevelCC.d.ts.map +1 -1
- package/build/cc/PowerlevelCC.js +125 -95
- package/build/cc/PowerlevelCC.js.map +1 -1
- package/build/cc/ProtectionCC.d.ts +49 -26
- package/build/cc/ProtectionCC.d.ts.map +1 -1
- package/build/cc/ProtectionCC.js +172 -126
- package/build/cc/ProtectionCC.js.map +1 -1
- package/build/cc/SceneActivationCC.d.ts +8 -7
- package/build/cc/SceneActivationCC.d.ts.map +1 -1
- package/build/cc/SceneActivationCC.js +28 -23
- package/build/cc/SceneActivationCC.js.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.d.ts +23 -15
- package/build/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
- package/build/cc/SceneActuatorConfigurationCC.js +79 -62
- package/build/cc/SceneActuatorConfigurationCC.js.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.d.ts +25 -17
- package/build/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
- package/build/cc/SceneControllerConfigurationCC.js +92 -78
- package/build/cc/SceneControllerConfigurationCC.js.map +1 -1
- package/build/cc/ScheduleEntryLockCC.d.ts +86 -72
- package/build/cc/ScheduleEntryLockCC.d.ts.map +1 -1
- package/build/cc/ScheduleEntryLockCC.js +607 -455
- package/build/cc/ScheduleEntryLockCC.js.map +1 -1
- package/build/cc/Security2CC.d.ts +78 -87
- package/build/cc/Security2CC.d.ts.map +1 -1
- package/build/cc/Security2CC.js +798 -765
- package/build/cc/Security2CC.js.map +1 -1
- package/build/cc/SecurityCC.d.ts +47 -42
- package/build/cc/SecurityCC.d.ts.map +1 -1
- package/build/cc/SecurityCC.js +240 -218
- package/build/cc/SecurityCC.js.map +1 -1
- package/build/cc/SoundSwitchCC.d.ts +36 -29
- package/build/cc/SoundSwitchCC.d.ts.map +1 -1
- package/build/cc/SoundSwitchCC.js +180 -157
- package/build/cc/SoundSwitchCC.js.map +1 -1
- package/build/cc/SupervisionCC.d.ts +17 -14
- package/build/cc/SupervisionCC.d.ts.map +1 -1
- package/build/cc/SupervisionCC.js +86 -66
- package/build/cc/SupervisionCC.js.map +1 -1
- package/build/cc/ThermostatFanModeCC.d.ts +25 -15
- package/build/cc/ThermostatFanModeCC.d.ts.map +1 -1
- package/build/cc/ThermostatFanModeCC.js +79 -60
- package/build/cc/ThermostatFanModeCC.js.map +1 -1
- package/build/cc/ThermostatFanStateCC.d.ts +11 -7
- package/build/cc/ThermostatFanStateCC.d.ts.map +1 -1
- package/build/cc/ThermostatFanStateCC.js +31 -22
- package/build/cc/ThermostatFanStateCC.js.map +1 -1
- package/build/cc/ThermostatModeCC.d.ts +24 -21
- package/build/cc/ThermostatModeCC.d.ts.map +1 -1
- package/build/cc/ThermostatModeCC.js +106 -90
- package/build/cc/ThermostatModeCC.js.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.d.ts +11 -7
- package/build/cc/ThermostatOperatingStateCC.d.ts.map +1 -1
- package/build/cc/ThermostatOperatingStateCC.js +31 -22
- package/build/cc/ThermostatOperatingStateCC.js.map +1 -1
- package/build/cc/ThermostatSetbackCC.d.ts +14 -13
- package/build/cc/ThermostatSetbackCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetbackCC.js +64 -57
- package/build/cc/ThermostatSetbackCC.js.map +1 -1
- package/build/cc/ThermostatSetpointCC.d.ts +38 -57
- package/build/cc/ThermostatSetpointCC.d.ts.map +1 -1
- package/build/cc/ThermostatSetpointCC.js +200 -264
- package/build/cc/ThermostatSetpointCC.js.map +1 -1
- package/build/cc/TimeCC.d.ts +24 -20
- package/build/cc/TimeCC.d.ts.map +1 -1
- package/build/cc/TimeCC.js +119 -108
- package/build/cc/TimeCC.js.map +1 -1
- package/build/cc/TimeParametersCC.d.ts +18 -14
- package/build/cc/TimeParametersCC.d.ts.map +1 -1
- package/build/cc/TimeParametersCC.js +77 -69
- package/build/cc/TimeParametersCC.js.map +1 -1
- package/build/cc/TransportServiceCC.d.ts +29 -32
- package/build/cc/TransportServiceCC.d.ts.map +1 -1
- package/build/cc/TransportServiceCC.js +159 -161
- package/build/cc/TransportServiceCC.js.map +1 -1
- package/build/cc/UserCodeCC.d.ts +83 -66
- package/build/cc/UserCodeCC.d.ts.map +1 -1
- package/build/cc/UserCodeCC.js +449 -402
- package/build/cc/UserCodeCC.js.map +1 -1
- package/build/cc/VersionCC.d.ts +36 -20
- package/build/cc/VersionCC.d.ts.map +1 -1
- package/build/cc/VersionCC.js +190 -149
- package/build/cc/VersionCC.js.map +1 -1
- package/build/cc/WakeUpCC.d.ts +27 -13
- package/build/cc/WakeUpCC.d.ts.map +1 -1
- package/build/cc/WakeUpCC.js +105 -77
- package/build/cc/WakeUpCC.js.map +1 -1
- package/build/cc/WindowCoveringCC.d.ts +39 -27
- package/build/cc/WindowCoveringCC.d.ts.map +1 -1
- package/build/cc/WindowCoveringCC.js +169 -137
- package/build/cc/WindowCoveringCC.js.map +1 -1
- package/build/cc/ZWavePlusCC.d.ts +8 -7
- package/build/cc/ZWavePlusCC.d.ts.map +1 -1
- package/build/cc/ZWavePlusCC.js +44 -37
- package/build/cc/ZWavePlusCC.js.map +1 -1
- package/build/cc/ZWaveProtocolCC.d.ts +111 -84
- package/build/cc/ZWaveProtocolCC.d.ts.map +1 -1
- package/build/cc/ZWaveProtocolCC.js +583 -508
- package/build/cc/ZWaveProtocolCC.js.map +1 -1
- package/build/cc/index.d.ts +37 -34
- package/build/cc/index.d.ts.map +1 -1
- package/build/cc/index.js +6 -7
- package/build/cc/index.js.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts +29 -24
- package/build/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
- package/build/cc/manufacturerProprietary/FibaroCC.js +109 -112
- package/build/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
- package/build/index.d.ts +0 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -1
- package/build/index.js.map +1 -1
- package/build/lib/API.d.ts +21 -18
- package/build/lib/API.d.ts.map +1 -1
- package/build/lib/API.js +25 -49
- package/build/lib/API.js.map +1 -1
- package/build/lib/CommandClass.d.ts +51 -89
- package/build/lib/CommandClass.d.ts.map +1 -1
- package/build/lib/CommandClass.js +177 -249
- package/build/lib/CommandClass.js.map +1 -1
- package/build/lib/EncapsulatingCommandClass.d.ts +1 -15
- package/build/lib/EncapsulatingCommandClass.d.ts.map +1 -1
- package/build/lib/EncapsulatingCommandClass.js.map +1 -1
- package/build/lib/ICommandClassContainer.d.ts +1 -8
- package/build/lib/ICommandClassContainer.d.ts.map +1 -1
- package/build/lib/ICommandClassContainer.js +0 -8
- package/build/lib/ICommandClassContainer.js.map +1 -1
- package/build/lib/Values.d.ts +3 -3
- package/build/lib/Values.d.ts.map +1 -1
- package/build/lib/_Types.d.ts.map +1 -1
- package/build/lib/_Types.js +1 -0
- package/build/lib/_Types.js.map +1 -1
- package/build/lib/utils.d.ts +14 -13
- package/build/lib/utils.d.ts.map +1 -1
- package/build/lib/utils.js +94 -92
- package/build/lib/utils.js.map +1 -1
- package/package.json +4 -5
|
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var SoundSwitchCCTonesNumberReport_1, SoundSwitchCCToneInfoReport_1, SoundSwitchCCToneInfoGet_1, SoundSwitchCCConfigurationSet_1, SoundSwitchCCConfigurationReport_1, SoundSwitchCCTonePlaySet_1, SoundSwitchCCTonePlayReport_1;
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
10
|
exports.SoundSwitchCCTonePlayGet = exports.SoundSwitchCCTonePlayReport = exports.SoundSwitchCCTonePlaySet = exports.SoundSwitchCCConfigurationGet = exports.SoundSwitchCCConfigurationReport = exports.SoundSwitchCCConfigurationSet = exports.SoundSwitchCCToneInfoGet = exports.SoundSwitchCCToneInfoReport = exports.SoundSwitchCCTonesNumberGet = exports.SoundSwitchCCTonesNumberReport = exports.SoundSwitchCC = exports.SoundSwitchCCAPI = exports.SoundSwitchCCValues = void 0;
|
|
10
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -90,22 +91,22 @@ let SoundSwitchCCAPI = class SoundSwitchCCAPI extends API_1.CCAPI {
|
|
|
90
91
|
}
|
|
91
92
|
async getToneCount() {
|
|
92
93
|
this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.TonesNumberGet);
|
|
93
|
-
const cc = new SoundSwitchCCTonesNumberGet(
|
|
94
|
+
const cc = new SoundSwitchCCTonesNumberGet({
|
|
94
95
|
nodeId: this.endpoint.nodeId,
|
|
95
|
-
|
|
96
|
+
endpointIndex: this.endpoint.index,
|
|
96
97
|
});
|
|
97
|
-
const response = await this.
|
|
98
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
98
99
|
return response?.toneCount;
|
|
99
100
|
}
|
|
100
101
|
async getToneInfo(toneId) {
|
|
101
102
|
__assertType("toneId", "number", __assertType__number.bind(void 0, toneId));
|
|
102
103
|
this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.ToneInfoGet);
|
|
103
|
-
const cc = new SoundSwitchCCToneInfoGet(
|
|
104
|
+
const cc = new SoundSwitchCCToneInfoGet({
|
|
104
105
|
nodeId: this.endpoint.nodeId,
|
|
105
|
-
|
|
106
|
+
endpointIndex: this.endpoint.index,
|
|
106
107
|
toneId,
|
|
107
108
|
});
|
|
108
|
-
const response = await this.
|
|
109
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
109
110
|
if (response)
|
|
110
111
|
return (0, safe_2.pick)(response, ["duration", "name"]);
|
|
111
112
|
}
|
|
@@ -113,22 +114,22 @@ let SoundSwitchCCAPI = class SoundSwitchCCAPI extends API_1.CCAPI {
|
|
|
113
114
|
__assertType("defaultToneId", "number", __assertType__number.bind(void 0, defaultToneId));
|
|
114
115
|
__assertType("defaultVolume", "number", __assertType__number.bind(void 0, defaultVolume));
|
|
115
116
|
this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.ConfigurationSet);
|
|
116
|
-
const cc = new SoundSwitchCCConfigurationSet(
|
|
117
|
+
const cc = new SoundSwitchCCConfigurationSet({
|
|
117
118
|
nodeId: this.endpoint.nodeId,
|
|
118
|
-
|
|
119
|
+
endpointIndex: this.endpoint.index,
|
|
119
120
|
defaultToneId,
|
|
120
121
|
defaultVolume,
|
|
121
122
|
});
|
|
122
|
-
return this.
|
|
123
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
123
124
|
}
|
|
124
125
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
125
126
|
async getConfiguration() {
|
|
126
127
|
this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.ConfigurationGet);
|
|
127
|
-
const cc = new SoundSwitchCCConfigurationGet(
|
|
128
|
+
const cc = new SoundSwitchCCConfigurationGet({
|
|
128
129
|
nodeId: this.endpoint.nodeId,
|
|
129
|
-
|
|
130
|
+
endpointIndex: this.endpoint.index,
|
|
130
131
|
});
|
|
131
|
-
const response = await this.
|
|
132
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
132
133
|
if (response) {
|
|
133
134
|
return (0, safe_2.pick)(response, ["defaultToneId", "defaultVolume"]);
|
|
134
135
|
}
|
|
@@ -140,32 +141,32 @@ let SoundSwitchCCAPI = class SoundSwitchCCAPI extends API_1.CCAPI {
|
|
|
140
141
|
if (toneId === 0) {
|
|
141
142
|
throw new safe_1.ZWaveError(`Tone ID must be > 0. Use stopPlaying to stop the tone.`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
142
143
|
}
|
|
143
|
-
const cc = new SoundSwitchCCTonePlaySet(
|
|
144
|
+
const cc = new SoundSwitchCCTonePlaySet({
|
|
144
145
|
nodeId: this.endpoint.nodeId,
|
|
145
|
-
|
|
146
|
+
endpointIndex: this.endpoint.index,
|
|
146
147
|
toneId,
|
|
147
148
|
volume,
|
|
148
149
|
});
|
|
149
|
-
return this.
|
|
150
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
150
151
|
}
|
|
151
152
|
async stopPlaying() {
|
|
152
153
|
this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.TonePlaySet);
|
|
153
|
-
const cc = new SoundSwitchCCTonePlaySet(
|
|
154
|
+
const cc = new SoundSwitchCCTonePlaySet({
|
|
154
155
|
nodeId: this.endpoint.nodeId,
|
|
155
|
-
|
|
156
|
+
endpointIndex: this.endpoint.index,
|
|
156
157
|
toneId: 0x00,
|
|
157
158
|
volume: 0x00,
|
|
158
159
|
});
|
|
159
|
-
return this.
|
|
160
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
160
161
|
}
|
|
161
162
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
162
163
|
async getPlaying() {
|
|
163
164
|
this.assertSupportsCommand(_Types_1.SoundSwitchCommand, _Types_1.SoundSwitchCommand.TonePlayGet);
|
|
164
|
-
const cc = new SoundSwitchCCTonePlayGet(
|
|
165
|
+
const cc = new SoundSwitchCCTonePlayGet({
|
|
165
166
|
nodeId: this.endpoint.nodeId,
|
|
166
|
-
|
|
167
|
+
endpointIndex: this.endpoint.index,
|
|
167
168
|
});
|
|
168
|
-
const response = await this.
|
|
169
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
169
170
|
if (response) {
|
|
170
171
|
return (0, safe_2.pick)(response, ["toneId", "volume"]);
|
|
171
172
|
}
|
|
@@ -240,38 +241,38 @@ exports.SoundSwitchCCAPI = SoundSwitchCCAPI = __decorate([
|
|
|
240
241
|
(0, CommandClassDecorators_1.API)(safe_1.CommandClasses["Sound Switch"])
|
|
241
242
|
], SoundSwitchCCAPI);
|
|
242
243
|
let SoundSwitchCC = class SoundSwitchCC extends CommandClass_1.CommandClass {
|
|
243
|
-
async interview(
|
|
244
|
-
const node = this.getNode(
|
|
245
|
-
const endpoint = this.getEndpoint(
|
|
246
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Sound Switch"],
|
|
244
|
+
async interview(ctx) {
|
|
245
|
+
const node = this.getNode(ctx);
|
|
246
|
+
const endpoint = this.getEndpoint(ctx);
|
|
247
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Sound Switch"], ctx, endpoint).withOptions({
|
|
247
248
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
248
249
|
});
|
|
249
|
-
|
|
250
|
+
ctx.logNode(node.id, {
|
|
250
251
|
endpoint: this.endpointIndex,
|
|
251
252
|
message: `Interviewing ${this.ccName}...`,
|
|
252
253
|
direction: "none",
|
|
253
254
|
});
|
|
254
|
-
|
|
255
|
+
ctx.logNode(node.id, {
|
|
255
256
|
message: "requesting tone count...",
|
|
256
257
|
direction: "outbound",
|
|
257
258
|
});
|
|
258
259
|
const toneCount = await api.getToneCount();
|
|
259
260
|
if (toneCount != undefined) {
|
|
260
261
|
const logMessage = `supports ${toneCount} tones`;
|
|
261
|
-
|
|
262
|
+
ctx.logNode(node.id, {
|
|
262
263
|
message: logMessage,
|
|
263
264
|
direction: "inbound",
|
|
264
265
|
});
|
|
265
266
|
}
|
|
266
267
|
else {
|
|
267
|
-
|
|
268
|
+
ctx.logNode(node.id, {
|
|
268
269
|
endpoint: this.endpointIndex,
|
|
269
270
|
message: "Querying tone count timed out, skipping interview...",
|
|
270
271
|
level: "warn",
|
|
271
272
|
});
|
|
272
273
|
return;
|
|
273
274
|
}
|
|
274
|
-
|
|
275
|
+
ctx.logNode(node.id, {
|
|
275
276
|
message: "requesting current sound configuration...",
|
|
276
277
|
direction: "outbound",
|
|
277
278
|
});
|
|
@@ -280,14 +281,14 @@ let SoundSwitchCC = class SoundSwitchCC extends CommandClass_1.CommandClass {
|
|
|
280
281
|
const logMessage = `received current sound configuration:
|
|
281
282
|
default tone ID: ${config.defaultToneId}
|
|
282
283
|
default volume: ${config.defaultVolume}`;
|
|
283
|
-
|
|
284
|
+
ctx.logNode(node.id, {
|
|
284
285
|
message: logMessage,
|
|
285
286
|
direction: "inbound",
|
|
286
287
|
});
|
|
287
288
|
}
|
|
288
289
|
const metadataStates = {};
|
|
289
290
|
for (let toneId = 1; toneId <= toneCount; toneId++) {
|
|
290
|
-
|
|
291
|
+
ctx.logNode(node.id, {
|
|
291
292
|
message: `requesting info for tone #${toneId}`,
|
|
292
293
|
direction: "outbound",
|
|
293
294
|
});
|
|
@@ -297,21 +298,21 @@ default volume: ${config.defaultVolume}`;
|
|
|
297
298
|
const logMessage = `received info for tone #${toneId}:
|
|
298
299
|
name: ${info.name}
|
|
299
300
|
duration: ${info.duration} seconds`;
|
|
300
|
-
|
|
301
|
+
ctx.logNode(node.id, {
|
|
301
302
|
message: logMessage,
|
|
302
303
|
direction: "inbound",
|
|
303
304
|
});
|
|
304
305
|
metadataStates[toneId] = `${info.name} (${info.duration} sec)`;
|
|
305
306
|
}
|
|
306
307
|
// Remember tone count and info on the default tone ID metadata
|
|
307
|
-
this.setMetadata(
|
|
308
|
+
this.setMetadata(ctx, exports.SoundSwitchCCValues.defaultToneId, {
|
|
308
309
|
...exports.SoundSwitchCCValues.defaultToneId.meta,
|
|
309
310
|
min: 1,
|
|
310
311
|
max: toneCount,
|
|
311
312
|
states: metadataStates,
|
|
312
313
|
});
|
|
313
314
|
// Remember tone count and info on the tone ID metadata
|
|
314
|
-
this.setMetadata(
|
|
315
|
+
this.setMetadata(ctx, exports.SoundSwitchCCValues.toneId, {
|
|
315
316
|
...exports.SoundSwitchCCValues.toneId.meta,
|
|
316
317
|
min: 0,
|
|
317
318
|
max: toneCount,
|
|
@@ -322,7 +323,7 @@ duration: ${info.duration} seconds`;
|
|
|
322
323
|
},
|
|
323
324
|
});
|
|
324
325
|
// Remember that the interview is complete
|
|
325
|
-
this.setInterviewComplete(
|
|
326
|
+
this.setInterviewComplete(ctx, true);
|
|
326
327
|
}
|
|
327
328
|
};
|
|
328
329
|
exports.SoundSwitchCC = SoundSwitchCC;
|
|
@@ -331,31 +332,33 @@ exports.SoundSwitchCC = SoundSwitchCC = __decorate([
|
|
|
331
332
|
(0, CommandClassDecorators_1.implementedVersion)(2),
|
|
332
333
|
(0, CommandClassDecorators_1.ccValues)(exports.SoundSwitchCCValues)
|
|
333
334
|
], SoundSwitchCC);
|
|
334
|
-
let SoundSwitchCCTonesNumberReport = class SoundSwitchCCTonesNumberReport extends SoundSwitchCC {
|
|
335
|
-
constructor(
|
|
336
|
-
super(
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
335
|
+
let SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = class SoundSwitchCCTonesNumberReport extends SoundSwitchCC {
|
|
336
|
+
constructor(options) {
|
|
337
|
+
super(options);
|
|
338
|
+
this.toneCount = options.toneCount;
|
|
339
|
+
}
|
|
340
|
+
static from(raw, ctx) {
|
|
341
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
342
|
+
const toneCount = raw.payload[0];
|
|
343
|
+
return new SoundSwitchCCTonesNumberReport_1({
|
|
344
|
+
nodeId: ctx.sourceNodeId,
|
|
345
|
+
toneCount,
|
|
346
|
+
});
|
|
344
347
|
}
|
|
345
348
|
toneCount;
|
|
346
|
-
serialize() {
|
|
349
|
+
serialize(ctx) {
|
|
347
350
|
this.payload = Buffer.from([this.toneCount]);
|
|
348
|
-
return super.serialize();
|
|
351
|
+
return super.serialize(ctx);
|
|
349
352
|
}
|
|
350
|
-
toLogEntry(
|
|
353
|
+
toLogEntry(ctx) {
|
|
351
354
|
return {
|
|
352
|
-
...super.toLogEntry(
|
|
355
|
+
...super.toLogEntry(ctx),
|
|
353
356
|
message: { "# of tones": this.toneCount },
|
|
354
357
|
};
|
|
355
358
|
}
|
|
356
359
|
};
|
|
357
360
|
exports.SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport;
|
|
358
|
-
exports.SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport = __decorate([
|
|
361
|
+
exports.SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport = SoundSwitchCCTonesNumberReport_1 = __decorate([
|
|
359
362
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonesNumberReport)
|
|
360
363
|
], SoundSwitchCCTonesNumberReport);
|
|
361
364
|
let SoundSwitchCCTonesNumberGet = class SoundSwitchCCTonesNumberGet extends SoundSwitchCC {
|
|
@@ -365,37 +368,41 @@ exports.SoundSwitchCCTonesNumberGet = SoundSwitchCCTonesNumberGet = __decorate([
|
|
|
365
368
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonesNumberGet),
|
|
366
369
|
(0, CommandClassDecorators_1.expectedCCResponse)(SoundSwitchCCTonesNumberReport)
|
|
367
370
|
], SoundSwitchCCTonesNumberGet);
|
|
368
|
-
let SoundSwitchCCToneInfoReport = class SoundSwitchCCToneInfoReport extends SoundSwitchCC {
|
|
369
|
-
constructor(
|
|
370
|
-
super(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
371
|
+
let SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = class SoundSwitchCCToneInfoReport extends SoundSwitchCC {
|
|
372
|
+
constructor(options) {
|
|
373
|
+
super(options);
|
|
374
|
+
this.toneId = options.toneId;
|
|
375
|
+
this.duration = options.duration;
|
|
376
|
+
this.name = options.name;
|
|
377
|
+
}
|
|
378
|
+
static from(raw, ctx) {
|
|
379
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 4);
|
|
380
|
+
const toneId = raw.payload[0];
|
|
381
|
+
const duration = raw.payload.readUInt16BE(1);
|
|
382
|
+
const nameLength = raw.payload[3];
|
|
383
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 4 + nameLength);
|
|
384
|
+
const name = raw.payload.subarray(4, 4 + nameLength).toString("utf8");
|
|
385
|
+
return new SoundSwitchCCToneInfoReport_1({
|
|
386
|
+
nodeId: ctx.sourceNodeId,
|
|
387
|
+
toneId,
|
|
388
|
+
duration,
|
|
389
|
+
name,
|
|
390
|
+
});
|
|
384
391
|
}
|
|
385
392
|
toneId;
|
|
386
393
|
duration;
|
|
387
394
|
name;
|
|
388
|
-
serialize() {
|
|
395
|
+
serialize(ctx) {
|
|
389
396
|
this.payload = Buffer.concat([
|
|
390
397
|
Buffer.from([this.toneId, 0, 0, this.name.length]),
|
|
391
398
|
Buffer.from(this.name, "utf8"),
|
|
392
399
|
]);
|
|
393
400
|
this.payload.writeUInt16BE(this.duration, 1);
|
|
394
|
-
return super.serialize();
|
|
401
|
+
return super.serialize(ctx);
|
|
395
402
|
}
|
|
396
|
-
toLogEntry(
|
|
403
|
+
toLogEntry(ctx) {
|
|
397
404
|
return {
|
|
398
|
-
...super.toLogEntry(
|
|
405
|
+
...super.toLogEntry(ctx),
|
|
399
406
|
message: {
|
|
400
407
|
"tone id": this.toneId,
|
|
401
408
|
duration: `${this.duration} seconds`,
|
|
@@ -405,62 +412,67 @@ let SoundSwitchCCToneInfoReport = class SoundSwitchCCToneInfoReport extends Soun
|
|
|
405
412
|
}
|
|
406
413
|
};
|
|
407
414
|
exports.SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport;
|
|
408
|
-
exports.SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport = __decorate([
|
|
415
|
+
exports.SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport = SoundSwitchCCToneInfoReport_1 = __decorate([
|
|
409
416
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ToneInfoReport)
|
|
410
417
|
], SoundSwitchCCToneInfoReport);
|
|
411
418
|
const testResponseForSoundSwitchToneInfoGet = (sent, received) => {
|
|
412
419
|
return received.toneId === sent.toneId;
|
|
413
420
|
};
|
|
414
|
-
let SoundSwitchCCToneInfoGet = class SoundSwitchCCToneInfoGet extends SoundSwitchCC {
|
|
415
|
-
constructor(
|
|
416
|
-
super(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
421
|
+
let SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = class SoundSwitchCCToneInfoGet extends SoundSwitchCC {
|
|
422
|
+
constructor(options) {
|
|
423
|
+
super(options);
|
|
424
|
+
this.toneId = options.toneId;
|
|
425
|
+
}
|
|
426
|
+
static from(raw, ctx) {
|
|
427
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
428
|
+
const toneId = raw.payload[0];
|
|
429
|
+
return new SoundSwitchCCToneInfoGet_1({
|
|
430
|
+
nodeId: ctx.sourceNodeId,
|
|
431
|
+
toneId,
|
|
432
|
+
});
|
|
424
433
|
}
|
|
425
434
|
toneId;
|
|
426
|
-
serialize() {
|
|
435
|
+
serialize(ctx) {
|
|
427
436
|
this.payload = Buffer.from([this.toneId]);
|
|
428
|
-
return super.serialize();
|
|
437
|
+
return super.serialize(ctx);
|
|
429
438
|
}
|
|
430
|
-
toLogEntry(
|
|
439
|
+
toLogEntry(ctx) {
|
|
431
440
|
return {
|
|
432
|
-
...super.toLogEntry(
|
|
441
|
+
...super.toLogEntry(ctx),
|
|
433
442
|
message: { "tone id": this.toneId },
|
|
434
443
|
};
|
|
435
444
|
}
|
|
436
445
|
};
|
|
437
446
|
exports.SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet;
|
|
438
|
-
exports.SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet = __decorate([
|
|
447
|
+
exports.SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet = SoundSwitchCCToneInfoGet_1 = __decorate([
|
|
439
448
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ToneInfoGet),
|
|
440
449
|
(0, CommandClassDecorators_1.expectedCCResponse)(SoundSwitchCCToneInfoReport, testResponseForSoundSwitchToneInfoGet)
|
|
441
450
|
], SoundSwitchCCToneInfoGet);
|
|
442
|
-
let SoundSwitchCCConfigurationSet = class SoundSwitchCCConfigurationSet extends SoundSwitchCC {
|
|
443
|
-
constructor(
|
|
444
|
-
super(
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
451
|
+
let SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = class SoundSwitchCCConfigurationSet extends SoundSwitchCC {
|
|
452
|
+
constructor(options) {
|
|
453
|
+
super(options);
|
|
454
|
+
this.defaultVolume = options.defaultVolume;
|
|
455
|
+
this.defaultToneId = options.defaultToneId;
|
|
456
|
+
}
|
|
457
|
+
static from(raw, ctx) {
|
|
458
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
459
|
+
const defaultVolume = raw.payload[0];
|
|
460
|
+
const defaultToneId = raw.payload[1];
|
|
461
|
+
return new SoundSwitchCCConfigurationSet_1({
|
|
462
|
+
nodeId: ctx.sourceNodeId,
|
|
463
|
+
defaultVolume,
|
|
464
|
+
defaultToneId,
|
|
465
|
+
});
|
|
454
466
|
}
|
|
455
467
|
defaultVolume;
|
|
456
468
|
defaultToneId;
|
|
457
|
-
serialize() {
|
|
469
|
+
serialize(ctx) {
|
|
458
470
|
this.payload = Buffer.from([this.defaultVolume, this.defaultToneId]);
|
|
459
|
-
return super.serialize();
|
|
471
|
+
return super.serialize(ctx);
|
|
460
472
|
}
|
|
461
|
-
toLogEntry(
|
|
473
|
+
toLogEntry(ctx) {
|
|
462
474
|
return {
|
|
463
|
-
...super.toLogEntry(
|
|
475
|
+
...super.toLogEntry(ctx),
|
|
464
476
|
message: {
|
|
465
477
|
"default volume": `${this.defaultVolume} %`,
|
|
466
478
|
"default tone id": this.defaultToneId,
|
|
@@ -469,32 +481,35 @@ let SoundSwitchCCConfigurationSet = class SoundSwitchCCConfigurationSet extends
|
|
|
469
481
|
}
|
|
470
482
|
};
|
|
471
483
|
exports.SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet;
|
|
472
|
-
exports.SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet = __decorate([
|
|
484
|
+
exports.SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet = SoundSwitchCCConfigurationSet_1 = __decorate([
|
|
473
485
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ConfigurationSet),
|
|
474
486
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
475
487
|
], SoundSwitchCCConfigurationSet);
|
|
476
|
-
let SoundSwitchCCConfigurationReport = class SoundSwitchCCConfigurationReport extends SoundSwitchCC {
|
|
477
|
-
constructor(
|
|
478
|
-
super(
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
+
let SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = class SoundSwitchCCConfigurationReport extends SoundSwitchCC {
|
|
489
|
+
constructor(options) {
|
|
490
|
+
super(options);
|
|
491
|
+
this.defaultVolume = options.defaultVolume;
|
|
492
|
+
this.defaultToneId = options.defaultToneId;
|
|
493
|
+
}
|
|
494
|
+
static from(raw, ctx) {
|
|
495
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 2);
|
|
496
|
+
const defaultVolume = (0, math_1.clamp)(raw.payload[0], 0, 100);
|
|
497
|
+
const defaultToneId = raw.payload[1];
|
|
498
|
+
return new SoundSwitchCCConfigurationReport_1({
|
|
499
|
+
nodeId: ctx.sourceNodeId,
|
|
500
|
+
defaultVolume,
|
|
501
|
+
defaultToneId,
|
|
502
|
+
});
|
|
488
503
|
}
|
|
489
504
|
defaultVolume;
|
|
490
505
|
defaultToneId;
|
|
491
|
-
serialize() {
|
|
506
|
+
serialize(ctx) {
|
|
492
507
|
this.payload = Buffer.from([this.defaultVolume, this.defaultToneId]);
|
|
493
|
-
return super.serialize();
|
|
508
|
+
return super.serialize(ctx);
|
|
494
509
|
}
|
|
495
|
-
toLogEntry(
|
|
510
|
+
toLogEntry(ctx) {
|
|
496
511
|
return {
|
|
497
|
-
...super.toLogEntry(
|
|
512
|
+
...super.toLogEntry(ctx),
|
|
498
513
|
message: {
|
|
499
514
|
"default volume": `${this.defaultVolume} %`,
|
|
500
515
|
"default tone id": this.defaultToneId,
|
|
@@ -509,7 +524,7 @@ __decorate([
|
|
|
509
524
|
__decorate([
|
|
510
525
|
(0, CommandClassDecorators_1.ccValue)(exports.SoundSwitchCCValues.defaultToneId)
|
|
511
526
|
], SoundSwitchCCConfigurationReport.prototype, "defaultToneId", void 0);
|
|
512
|
-
exports.SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport = __decorate([
|
|
527
|
+
exports.SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport = SoundSwitchCCConfigurationReport_1 = __decorate([
|
|
513
528
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ConfigurationReport)
|
|
514
529
|
], SoundSwitchCCConfigurationReport);
|
|
515
530
|
let SoundSwitchCCConfigurationGet = class SoundSwitchCCConfigurationGet extends SoundSwitchCC {
|
|
@@ -519,28 +534,32 @@ exports.SoundSwitchCCConfigurationGet = SoundSwitchCCConfigurationGet = __decora
|
|
|
519
534
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.ConfigurationGet),
|
|
520
535
|
(0, CommandClassDecorators_1.expectedCCResponse)(SoundSwitchCCConfigurationReport)
|
|
521
536
|
], SoundSwitchCCConfigurationGet);
|
|
522
|
-
let SoundSwitchCCTonePlaySet = class SoundSwitchCCTonePlaySet extends SoundSwitchCC {
|
|
523
|
-
constructor(
|
|
524
|
-
super(
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
this.volume = options.volume;
|
|
537
|
+
let SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = class SoundSwitchCCTonePlaySet extends SoundSwitchCC {
|
|
538
|
+
constructor(options) {
|
|
539
|
+
super(options);
|
|
540
|
+
this.toneId = options.toneId;
|
|
541
|
+
this.volume = options.volume;
|
|
542
|
+
}
|
|
543
|
+
static from(raw, ctx) {
|
|
544
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
545
|
+
const toneId = raw.payload[0];
|
|
546
|
+
let volume;
|
|
547
|
+
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
548
|
+
volume = raw.payload[1];
|
|
535
549
|
}
|
|
550
|
+
return new SoundSwitchCCTonePlaySet_1({
|
|
551
|
+
nodeId: ctx.sourceNodeId,
|
|
552
|
+
toneId,
|
|
553
|
+
volume,
|
|
554
|
+
});
|
|
536
555
|
}
|
|
537
556
|
toneId;
|
|
538
557
|
volume;
|
|
539
|
-
serialize() {
|
|
558
|
+
serialize(ctx) {
|
|
540
559
|
this.payload = Buffer.from([this.toneId, this.volume ?? 0]);
|
|
541
|
-
return super.serialize();
|
|
560
|
+
return super.serialize(ctx);
|
|
542
561
|
}
|
|
543
|
-
toLogEntry(
|
|
562
|
+
toLogEntry(ctx) {
|
|
544
563
|
const message = {
|
|
545
564
|
"tone id": this.toneId,
|
|
546
565
|
};
|
|
@@ -548,38 +567,42 @@ let SoundSwitchCCTonePlaySet = class SoundSwitchCCTonePlaySet extends SoundSwitc
|
|
|
548
567
|
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
549
568
|
}
|
|
550
569
|
return {
|
|
551
|
-
...super.toLogEntry(
|
|
570
|
+
...super.toLogEntry(ctx),
|
|
552
571
|
message,
|
|
553
572
|
};
|
|
554
573
|
}
|
|
555
574
|
};
|
|
556
575
|
exports.SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet;
|
|
557
|
-
exports.SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet = __decorate([
|
|
576
|
+
exports.SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet = SoundSwitchCCTonePlaySet_1 = __decorate([
|
|
558
577
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonePlaySet),
|
|
559
578
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
560
579
|
], SoundSwitchCCTonePlaySet);
|
|
561
|
-
let SoundSwitchCCTonePlayReport = class SoundSwitchCCTonePlayReport extends SoundSwitchCC {
|
|
562
|
-
constructor(
|
|
563
|
-
super(
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
this.volume = options.volume;
|
|
580
|
+
let SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = class SoundSwitchCCTonePlayReport extends SoundSwitchCC {
|
|
581
|
+
constructor(options) {
|
|
582
|
+
super(options);
|
|
583
|
+
this.toneId = options.toneId;
|
|
584
|
+
this.volume = options.volume;
|
|
585
|
+
}
|
|
586
|
+
static from(raw, ctx) {
|
|
587
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
588
|
+
const toneId = raw.payload[0];
|
|
589
|
+
let volume;
|
|
590
|
+
if (toneId !== 0 && raw.payload.length >= 2) {
|
|
591
|
+
volume = raw.payload[1];
|
|
574
592
|
}
|
|
593
|
+
return new SoundSwitchCCTonePlayReport_1({
|
|
594
|
+
nodeId: ctx.sourceNodeId,
|
|
595
|
+
toneId,
|
|
596
|
+
volume,
|
|
597
|
+
});
|
|
575
598
|
}
|
|
576
599
|
toneId;
|
|
577
600
|
volume;
|
|
578
|
-
serialize() {
|
|
601
|
+
serialize(ctx) {
|
|
579
602
|
this.payload = Buffer.from([this.toneId, this.volume ?? 0]);
|
|
580
|
-
return super.serialize();
|
|
603
|
+
return super.serialize(ctx);
|
|
581
604
|
}
|
|
582
|
-
toLogEntry(
|
|
605
|
+
toLogEntry(ctx) {
|
|
583
606
|
const message = {
|
|
584
607
|
"tone id": this.toneId,
|
|
585
608
|
};
|
|
@@ -587,7 +610,7 @@ let SoundSwitchCCTonePlayReport = class SoundSwitchCCTonePlayReport extends Soun
|
|
|
587
610
|
message.volume = this.volume === 0 ? "default" : `${this.volume} %`;
|
|
588
611
|
}
|
|
589
612
|
return {
|
|
590
|
-
...super.toLogEntry(
|
|
613
|
+
...super.toLogEntry(ctx),
|
|
591
614
|
message,
|
|
592
615
|
};
|
|
593
616
|
}
|
|
@@ -599,7 +622,7 @@ __decorate([
|
|
|
599
622
|
__decorate([
|
|
600
623
|
(0, CommandClassDecorators_1.ccValue)(exports.SoundSwitchCCValues.volume)
|
|
601
624
|
], SoundSwitchCCTonePlayReport.prototype, "volume", void 0);
|
|
602
|
-
exports.SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport = __decorate([
|
|
625
|
+
exports.SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport = SoundSwitchCCTonePlayReport_1 = __decorate([
|
|
603
626
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.SoundSwitchCommand.TonePlayReport)
|
|
604
627
|
], SoundSwitchCCTonePlayReport);
|
|
605
628
|
let SoundSwitchCCTonePlayGet = class SoundSwitchCCTonePlayGet extends SoundSwitchCC {
|