@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 HumidityControlSetpointCCReport_1, HumidityControlSetpointCCSupportedReport_1, HumidityControlSetpointCCScaleSupportedReport_1, HumidityControlSetpointCCCapabilitiesReport_1;
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
10
|
exports.HumidityControlSetpointCCCapabilitiesGet = exports.HumidityControlSetpointCCCapabilitiesReport = exports.HumidityControlSetpointCCScaleSupportedGet = exports.HumidityControlSetpointCCScaleSupportedReport = exports.HumidityControlSetpointCCSupportedGet = exports.HumidityControlSetpointCCSupportedReport = exports.HumidityControlSetpointCCGet = exports.HumidityControlSetpointCCReport = exports.HumidityControlSetpointCCSet = exports.HumidityControlSetpointCC = exports.HumidityControlSetpointCCAPI = exports.HumidityControlSetpointCCValues = void 0;
|
|
10
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -100,12 +101,12 @@ let HumidityControlSetpointCCAPI = class HumidityControlSetpointCCAPI extends AP
|
|
|
100
101
|
async get(setpointType) {
|
|
101
102
|
__assertType("setpointType", "HumidityControlSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
102
103
|
this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.Get);
|
|
103
|
-
const cc = new HumidityControlSetpointCCGet(
|
|
104
|
+
const cc = new HumidityControlSetpointCCGet({
|
|
104
105
|
nodeId: this.endpoint.nodeId,
|
|
105
|
-
|
|
106
|
+
endpointIndex: this.endpoint.index,
|
|
106
107
|
setpointType,
|
|
107
108
|
});
|
|
108
|
-
const response = await this.
|
|
109
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
109
110
|
if (!response)
|
|
110
111
|
return;
|
|
111
112
|
return response.type === _Types_1.HumidityControlSetpointType["N/A"]
|
|
@@ -122,24 +123,24 @@ let HumidityControlSetpointCCAPI = class HumidityControlSetpointCCAPI extends AP
|
|
|
122
123
|
__assertType("value", "number", __assertType__number.bind(void 0, value));
|
|
123
124
|
__assertType("scale", "number", __assertType__number.bind(void 0, scale));
|
|
124
125
|
this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.Set);
|
|
125
|
-
const cc = new HumidityControlSetpointCCSet(
|
|
126
|
+
const cc = new HumidityControlSetpointCCSet({
|
|
126
127
|
nodeId: this.endpoint.nodeId,
|
|
127
|
-
|
|
128
|
+
endpointIndex: this.endpoint.index,
|
|
128
129
|
setpointType,
|
|
129
130
|
value,
|
|
130
131
|
scale,
|
|
131
132
|
});
|
|
132
|
-
return this.
|
|
133
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
133
134
|
}
|
|
134
135
|
async getCapabilities(setpointType) {
|
|
135
136
|
__assertType("setpointType", "HumidityControlSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
136
137
|
this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.CapabilitiesGet);
|
|
137
|
-
const cc = new HumidityControlSetpointCCCapabilitiesGet(
|
|
138
|
+
const cc = new HumidityControlSetpointCCCapabilitiesGet({
|
|
138
139
|
nodeId: this.endpoint.nodeId,
|
|
139
|
-
|
|
140
|
+
endpointIndex: this.endpoint.index,
|
|
140
141
|
setpointType,
|
|
141
142
|
});
|
|
142
|
-
const response = await this.
|
|
143
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
143
144
|
if (response) {
|
|
144
145
|
return (0, safe_2.pick)(response, [
|
|
145
146
|
"minValue",
|
|
@@ -151,22 +152,22 @@ let HumidityControlSetpointCCAPI = class HumidityControlSetpointCCAPI extends AP
|
|
|
151
152
|
}
|
|
152
153
|
async getSupportedSetpointTypes() {
|
|
153
154
|
this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.SupportedGet);
|
|
154
|
-
const cc = new HumidityControlSetpointCCSupportedGet(
|
|
155
|
+
const cc = new HumidityControlSetpointCCSupportedGet({
|
|
155
156
|
nodeId: this.endpoint.nodeId,
|
|
156
|
-
|
|
157
|
+
endpointIndex: this.endpoint.index,
|
|
157
158
|
});
|
|
158
|
-
const response = await this.
|
|
159
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
159
160
|
return response?.supportedSetpointTypes;
|
|
160
161
|
}
|
|
161
162
|
async getSupportedScales(setpointType) {
|
|
162
163
|
__assertType("setpointType", "HumidityControlSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
163
164
|
this.assertSupportsCommand(_Types_1.HumidityControlSetpointCommand, _Types_1.HumidityControlSetpointCommand.SupportedGet);
|
|
164
|
-
const cc = new HumidityControlSetpointCCScaleSupportedGet(
|
|
165
|
+
const cc = new HumidityControlSetpointCCScaleSupportedGet({
|
|
165
166
|
nodeId: this.endpoint.nodeId,
|
|
166
|
-
|
|
167
|
+
endpointIndex: this.endpoint.index,
|
|
167
168
|
setpointType,
|
|
168
169
|
});
|
|
169
|
-
const response = await this.
|
|
170
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
170
171
|
if (response) {
|
|
171
172
|
return response.supportedScales.map((scale) => getScale(scale));
|
|
172
173
|
}
|
|
@@ -177,28 +178,28 @@ exports.HumidityControlSetpointCCAPI = HumidityControlSetpointCCAPI = __decorate
|
|
|
177
178
|
(0, CommandClassDecorators_1.API)(safe_1.CommandClasses["Humidity Control Setpoint"])
|
|
178
179
|
], HumidityControlSetpointCCAPI);
|
|
179
180
|
let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandClass_1.CommandClass {
|
|
180
|
-
translatePropertyKey(
|
|
181
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
181
182
|
if (property === "setpoint") {
|
|
182
183
|
return (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, propertyKey);
|
|
183
184
|
}
|
|
184
185
|
else {
|
|
185
|
-
return super.translatePropertyKey(
|
|
186
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
|
-
async interview(
|
|
189
|
-
const node = this.getNode(
|
|
190
|
-
const endpoint = this.getEndpoint(
|
|
191
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"],
|
|
189
|
+
async interview(ctx) {
|
|
190
|
+
const node = this.getNode(ctx);
|
|
191
|
+
const endpoint = this.getEndpoint(ctx);
|
|
192
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"], ctx, endpoint).withOptions({
|
|
192
193
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
193
194
|
});
|
|
194
|
-
|
|
195
|
+
ctx.logNode(node.id, {
|
|
195
196
|
endpoint: this.endpointIndex,
|
|
196
197
|
message: `Interviewing ${this.ccName}...`,
|
|
197
198
|
direction: "none",
|
|
198
199
|
});
|
|
199
200
|
// Query the supported setpoint types
|
|
200
201
|
let setpointTypes = [];
|
|
201
|
-
|
|
202
|
+
ctx.logNode(node.id, {
|
|
202
203
|
endpoint: this.endpointIndex,
|
|
203
204
|
message: "retrieving supported setpoint types...",
|
|
204
205
|
direction: "outbound",
|
|
@@ -211,14 +212,14 @@ let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandC
|
|
|
211
212
|
.map((type) => (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type))
|
|
212
213
|
.map((name) => `· ${name}`)
|
|
213
214
|
.join("\n");
|
|
214
|
-
|
|
215
|
+
ctx.logNode(node.id, {
|
|
215
216
|
endpoint: this.endpointIndex,
|
|
216
217
|
message: logMessage,
|
|
217
218
|
direction: "inbound",
|
|
218
219
|
});
|
|
219
220
|
}
|
|
220
221
|
else {
|
|
221
|
-
|
|
222
|
+
ctx.logNode(node.id, {
|
|
222
223
|
endpoint: this.endpointIndex,
|
|
223
224
|
message: "Querying supported setpoint types timed out, skipping interview...",
|
|
224
225
|
level: "warn",
|
|
@@ -228,7 +229,7 @@ let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandC
|
|
|
228
229
|
for (const type of setpointTypes) {
|
|
229
230
|
const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type);
|
|
230
231
|
// Find out the capabilities of this setpoint
|
|
231
|
-
|
|
232
|
+
ctx.logNode(node.id, {
|
|
232
233
|
endpoint: this.endpointIndex,
|
|
233
234
|
message: `retrieving capabilities for setpoint ${setpointName}...`,
|
|
234
235
|
direction: "outbound",
|
|
@@ -239,7 +240,7 @@ let HumidityControlSetpointCC = class HumidityControlSetpointCC extends CommandC
|
|
|
239
240
|
${setpointScaleSupported
|
|
240
241
|
.map((t) => `\n· ${t.key} ${t.unit} - ${t.label}`)
|
|
241
242
|
.join("")}`;
|
|
242
|
-
|
|
243
|
+
ctx.logNode(node.id, {
|
|
243
244
|
endpoint: this.endpointIndex,
|
|
244
245
|
message: logMessage,
|
|
245
246
|
direction: "inbound",
|
|
@@ -251,7 +252,7 @@ ${setpointScaleSupported
|
|
|
251
252
|
if (scale.unit)
|
|
252
253
|
states[scale.key] = scale.unit;
|
|
253
254
|
}
|
|
254
|
-
this.setMetadata(
|
|
255
|
+
this.setMetadata(ctx, scaleValue, {
|
|
255
256
|
...scaleValue.meta,
|
|
256
257
|
states,
|
|
257
258
|
});
|
|
@@ -263,7 +264,7 @@ ${setpointScaleSupported
|
|
|
263
264
|
const logMessage = `received capabilities for setpoint ${setpointName}:
|
|
264
265
|
minimum value: ${setpointCaps.minValue} ${minValueUnit}
|
|
265
266
|
maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
266
|
-
|
|
267
|
+
ctx.logNode(node.id, {
|
|
267
268
|
endpoint: this.endpointIndex,
|
|
268
269
|
message: logMessage,
|
|
269
270
|
direction: "inbound",
|
|
@@ -271,22 +272,22 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
|
271
272
|
}
|
|
272
273
|
}
|
|
273
274
|
// Query the current value for all setpoint types
|
|
274
|
-
await this.refreshValues(
|
|
275
|
+
await this.refreshValues(ctx);
|
|
275
276
|
// Remember that the interview is complete
|
|
276
|
-
this.setInterviewComplete(
|
|
277
|
+
this.setInterviewComplete(ctx, true);
|
|
277
278
|
}
|
|
278
|
-
async refreshValues(
|
|
279
|
-
const node = this.getNode(
|
|
280
|
-
const endpoint = this.getEndpoint(
|
|
281
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"],
|
|
279
|
+
async refreshValues(ctx) {
|
|
280
|
+
const node = this.getNode(ctx);
|
|
281
|
+
const endpoint = this.getEndpoint(ctx);
|
|
282
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Humidity Control Setpoint"], ctx, endpoint).withOptions({
|
|
282
283
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
283
284
|
});
|
|
284
|
-
const setpointTypes = this.getValue(
|
|
285
|
+
const setpointTypes = this.getValue(ctx, exports.HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];
|
|
285
286
|
// Query each setpoint's current value
|
|
286
287
|
for (const type of setpointTypes) {
|
|
287
288
|
const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, type);
|
|
288
289
|
// Every time, query the current value
|
|
289
|
-
|
|
290
|
+
ctx.logNode(node.id, {
|
|
290
291
|
endpoint: this.endpointIndex,
|
|
291
292
|
message: `querying current value of setpoint ${setpointName}...`,
|
|
292
293
|
direction: "outbound",
|
|
@@ -294,7 +295,7 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
|
294
295
|
const setpoint = await api.get(type);
|
|
295
296
|
if (setpoint) {
|
|
296
297
|
const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(setpoint.scale).unit ?? ""}`;
|
|
297
|
-
|
|
298
|
+
ctx.logNode(node.id, {
|
|
298
299
|
endpoint: this.endpointIndex,
|
|
299
300
|
message: logMessage,
|
|
300
301
|
direction: "inbound",
|
|
@@ -310,32 +311,33 @@ exports.HumidityControlSetpointCC = HumidityControlSetpointCC = __decorate([
|
|
|
310
311
|
(0, CommandClassDecorators_1.ccValues)(exports.HumidityControlSetpointCCValues)
|
|
311
312
|
], HumidityControlSetpointCC);
|
|
312
313
|
let HumidityControlSetpointCCSet = class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {
|
|
313
|
-
constructor(
|
|
314
|
-
super(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
314
|
+
constructor(options) {
|
|
315
|
+
super(options);
|
|
316
|
+
this.setpointType = options.setpointType;
|
|
317
|
+
this.value = options.value;
|
|
318
|
+
this.scale = options.scale;
|
|
319
|
+
}
|
|
320
|
+
static from(_raw, _ctx) {
|
|
321
|
+
// TODO: Deserialize payload
|
|
322
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
323
|
+
// return new HumidityControlSetpointCCSet({
|
|
324
|
+
// nodeId: ctx.sourceNodeId,
|
|
325
|
+
// });
|
|
324
326
|
}
|
|
325
327
|
setpointType;
|
|
326
328
|
value;
|
|
327
329
|
scale;
|
|
328
|
-
serialize() {
|
|
330
|
+
serialize(ctx) {
|
|
329
331
|
this.payload = Buffer.concat([
|
|
330
332
|
Buffer.from([this.setpointType & 0b1111]),
|
|
331
333
|
(0, safe_1.encodeFloatWithScale)(this.value, this.scale),
|
|
332
334
|
]);
|
|
333
|
-
return super.serialize();
|
|
335
|
+
return super.serialize(ctx);
|
|
334
336
|
}
|
|
335
|
-
toLogEntry(
|
|
337
|
+
toLogEntry(ctx) {
|
|
336
338
|
const scale = getScale(this.scale);
|
|
337
339
|
return {
|
|
338
|
-
...super.toLogEntry(
|
|
340
|
+
...super.toLogEntry(ctx),
|
|
339
341
|
message: {
|
|
340
342
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
|
|
341
343
|
value: `${this.value} ${scale.unit}`,
|
|
@@ -348,54 +350,61 @@ exports.HumidityControlSetpointCCSet = HumidityControlSetpointCCSet = __decorate
|
|
|
348
350
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.Set),
|
|
349
351
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
350
352
|
], HumidityControlSetpointCCSet);
|
|
351
|
-
let HumidityControlSetpointCCReport = class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {
|
|
352
|
-
constructor(
|
|
353
|
-
super(
|
|
354
|
-
|
|
355
|
-
this.
|
|
353
|
+
let HumidityControlSetpointCCReport = HumidityControlSetpointCCReport_1 = class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {
|
|
354
|
+
constructor(options) {
|
|
355
|
+
super(options);
|
|
356
|
+
// TODO: Check implementation:
|
|
357
|
+
this.type = options.type;
|
|
358
|
+
this.value = options.value;
|
|
359
|
+
this.scale = options.scale;
|
|
360
|
+
}
|
|
361
|
+
static from(raw, ctx) {
|
|
362
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
363
|
+
const type = raw.payload[0] & 0b1111;
|
|
356
364
|
// Setpoint type 0 is not defined in the spec, prevent devices from using it.
|
|
357
|
-
if (
|
|
365
|
+
if (type === 0) {
|
|
358
366
|
// Not supported
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
367
|
+
return new HumidityControlSetpointCCReport_1({
|
|
368
|
+
nodeId: ctx.sourceNodeId,
|
|
369
|
+
type,
|
|
370
|
+
value: 0,
|
|
371
|
+
scale: 0,
|
|
372
|
+
});
|
|
362
373
|
}
|
|
363
374
|
// parseFloatWithScale does its own validation
|
|
364
|
-
const { value, scale } = (0, safe_1.parseFloatWithScale)(
|
|
365
|
-
|
|
366
|
-
|
|
375
|
+
const { value, scale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
|
|
376
|
+
return new HumidityControlSetpointCCReport_1({
|
|
377
|
+
nodeId: ctx.sourceNodeId,
|
|
378
|
+
type,
|
|
379
|
+
value,
|
|
380
|
+
scale,
|
|
381
|
+
});
|
|
367
382
|
}
|
|
368
|
-
persistValues(
|
|
369
|
-
if (!super.persistValues(
|
|
383
|
+
persistValues(ctx) {
|
|
384
|
+
if (!super.persistValues(ctx))
|
|
370
385
|
return false;
|
|
371
386
|
const scale = getScale(this.scale);
|
|
372
387
|
const setpointValue = exports.HumidityControlSetpointCCValues.setpoint(this.type);
|
|
373
|
-
const existingMetadata = this.getMetadata(
|
|
388
|
+
const existingMetadata = this.getMetadata(ctx, setpointValue);
|
|
374
389
|
// Update the metadata when it is missing or the unit has changed
|
|
375
390
|
if (existingMetadata?.unit !== scale.unit) {
|
|
376
|
-
this.setMetadata(
|
|
391
|
+
this.setMetadata(ctx, setpointValue, {
|
|
377
392
|
...(existingMetadata ?? setpointValue.meta),
|
|
378
393
|
unit: scale.unit,
|
|
379
394
|
});
|
|
380
395
|
}
|
|
381
|
-
this.setValue(
|
|
396
|
+
this.setValue(ctx, setpointValue, this.value);
|
|
382
397
|
// Remember the device-preferred setpoint scale so it can be used in SET commands
|
|
383
|
-
this.setValue(
|
|
398
|
+
this.setValue(ctx, exports.HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);
|
|
384
399
|
return true;
|
|
385
400
|
}
|
|
386
|
-
|
|
387
|
-
get type() {
|
|
388
|
-
return this._type;
|
|
389
|
-
}
|
|
401
|
+
type;
|
|
390
402
|
scale;
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
return this._value;
|
|
394
|
-
}
|
|
395
|
-
toLogEntry(host) {
|
|
403
|
+
value;
|
|
404
|
+
toLogEntry(ctx) {
|
|
396
405
|
const scale = getScale(this.scale);
|
|
397
406
|
return {
|
|
398
|
-
...super.toLogEntry(
|
|
407
|
+
...super.toLogEntry(ctx),
|
|
399
408
|
message: {
|
|
400
409
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.type),
|
|
401
410
|
value: `${this.value} ${scale.unit}`,
|
|
@@ -404,7 +413,7 @@ let HumidityControlSetpointCCReport = class HumidityControlSetpointCCReport exte
|
|
|
404
413
|
}
|
|
405
414
|
};
|
|
406
415
|
exports.HumidityControlSetpointCCReport = HumidityControlSetpointCCReport;
|
|
407
|
-
exports.HumidityControlSetpointCCReport = HumidityControlSetpointCCReport = __decorate([
|
|
416
|
+
exports.HumidityControlSetpointCCReport = HumidityControlSetpointCCReport = HumidityControlSetpointCCReport_1 = __decorate([
|
|
408
417
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.Report)
|
|
409
418
|
], HumidityControlSetpointCCReport);
|
|
410
419
|
function testResponseForHumidityControlSetpointGet(sent, received) {
|
|
@@ -412,24 +421,25 @@ function testResponseForHumidityControlSetpointGet(sent, received) {
|
|
|
412
421
|
return received.type === sent.setpointType;
|
|
413
422
|
}
|
|
414
423
|
let HumidityControlSetpointCCGet = class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {
|
|
415
|
-
constructor(
|
|
416
|
-
super(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
+
constructor(options) {
|
|
425
|
+
super(options);
|
|
426
|
+
this.setpointType = options.setpointType;
|
|
427
|
+
}
|
|
428
|
+
static from(_raw, _ctx) {
|
|
429
|
+
// TODO: Deserialize payload
|
|
430
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
431
|
+
// return new HumidityControlSetpointCCGet({
|
|
432
|
+
// nodeId: ctx.sourceNodeId,
|
|
433
|
+
// });
|
|
424
434
|
}
|
|
425
435
|
setpointType;
|
|
426
|
-
serialize() {
|
|
436
|
+
serialize(ctx) {
|
|
427
437
|
this.payload = Buffer.from([this.setpointType & 0b1111]);
|
|
428
|
-
return super.serialize();
|
|
438
|
+
return super.serialize(ctx);
|
|
429
439
|
}
|
|
430
|
-
toLogEntry(
|
|
440
|
+
toLogEntry(ctx) {
|
|
431
441
|
return {
|
|
432
|
-
...super.toLogEntry(
|
|
442
|
+
...super.toLogEntry(ctx),
|
|
433
443
|
message: {
|
|
434
444
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
|
|
435
445
|
},
|
|
@@ -441,16 +451,24 @@ exports.HumidityControlSetpointCCGet = HumidityControlSetpointCCGet = __decorate
|
|
|
441
451
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.Get),
|
|
442
452
|
(0, CommandClassDecorators_1.expectedCCResponse)(HumidityControlSetpointCCReport, testResponseForHumidityControlSetpointGet)
|
|
443
453
|
], HumidityControlSetpointCCGet);
|
|
444
|
-
let HumidityControlSetpointCCSupportedReport = class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {
|
|
445
|
-
constructor(
|
|
446
|
-
super(
|
|
447
|
-
|
|
448
|
-
this.supportedSetpointTypes =
|
|
454
|
+
let HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport_1 = class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {
|
|
455
|
+
constructor(options) {
|
|
456
|
+
super(options);
|
|
457
|
+
// TODO: Check implementation:
|
|
458
|
+
this.supportedSetpointTypes = options.supportedSetpointTypes;
|
|
459
|
+
}
|
|
460
|
+
static from(raw, ctx) {
|
|
461
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
462
|
+
const supportedSetpointTypes = (0, safe_1.parseBitMask)(raw.payload, _Types_1.HumidityControlSetpointType["N/A"]);
|
|
463
|
+
return new HumidityControlSetpointCCSupportedReport_1({
|
|
464
|
+
nodeId: ctx.sourceNodeId,
|
|
465
|
+
supportedSetpointTypes,
|
|
466
|
+
});
|
|
449
467
|
}
|
|
450
468
|
supportedSetpointTypes;
|
|
451
|
-
toLogEntry(
|
|
469
|
+
toLogEntry(ctx) {
|
|
452
470
|
return {
|
|
453
|
-
...super.toLogEntry(
|
|
471
|
+
...super.toLogEntry(ctx),
|
|
454
472
|
message: {
|
|
455
473
|
"supported setpoint types": this.supportedSetpointTypes
|
|
456
474
|
.map((t) => `\n· ${(0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, t)}`)
|
|
@@ -463,7 +481,7 @@ exports.HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupp
|
|
|
463
481
|
__decorate([
|
|
464
482
|
(0, CommandClassDecorators_1.ccValue)(exports.HumidityControlSetpointCCValues.supportedSetpointTypes)
|
|
465
483
|
], HumidityControlSetpointCCSupportedReport.prototype, "supportedSetpointTypes", void 0);
|
|
466
|
-
exports.HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport = __decorate([
|
|
484
|
+
exports.HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport = HumidityControlSetpointCCSupportedReport_1 = __decorate([
|
|
467
485
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.SupportedReport)
|
|
468
486
|
], HumidityControlSetpointCCSupportedReport);
|
|
469
487
|
let HumidityControlSetpointCCSupportedGet = class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {
|
|
@@ -473,17 +491,25 @@ exports.HumidityControlSetpointCCSupportedGet = HumidityControlSetpointCCSupport
|
|
|
473
491
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.SupportedGet),
|
|
474
492
|
(0, CommandClassDecorators_1.expectedCCResponse)(HumidityControlSetpointCCSupportedReport)
|
|
475
493
|
], HumidityControlSetpointCCSupportedGet);
|
|
476
|
-
let HumidityControlSetpointCCScaleSupportedReport = class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {
|
|
477
|
-
constructor(
|
|
478
|
-
super(
|
|
479
|
-
|
|
480
|
-
this.supportedScales =
|
|
494
|
+
let HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport_1 = class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {
|
|
495
|
+
constructor(options) {
|
|
496
|
+
super(options);
|
|
497
|
+
// TODO: Check implementation:
|
|
498
|
+
this.supportedScales = options.supportedScales;
|
|
499
|
+
}
|
|
500
|
+
static from(raw, ctx) {
|
|
501
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
502
|
+
const supportedScales = (0, safe_1.parseBitMask)(Buffer.from([raw.payload[0] & 0b1111]), 0);
|
|
503
|
+
return new HumidityControlSetpointCCScaleSupportedReport_1({
|
|
504
|
+
nodeId: ctx.sourceNodeId,
|
|
505
|
+
supportedScales,
|
|
506
|
+
});
|
|
481
507
|
}
|
|
482
508
|
supportedScales;
|
|
483
|
-
toLogEntry(
|
|
509
|
+
toLogEntry(ctx) {
|
|
484
510
|
const supportedScales = this.supportedScales.map((scale) => getScale(scale));
|
|
485
511
|
return {
|
|
486
|
-
...super.toLogEntry(
|
|
512
|
+
...super.toLogEntry(ctx),
|
|
487
513
|
message: {
|
|
488
514
|
"scale supported": supportedScales
|
|
489
515
|
.map((t) => `\n· ${t.key} ${t.unit} - ${t.label}`)
|
|
@@ -493,28 +519,29 @@ let HumidityControlSetpointCCScaleSupportedReport = class HumidityControlSetpoin
|
|
|
493
519
|
}
|
|
494
520
|
};
|
|
495
521
|
exports.HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport;
|
|
496
|
-
exports.HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport = __decorate([
|
|
522
|
+
exports.HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport = HumidityControlSetpointCCScaleSupportedReport_1 = __decorate([
|
|
497
523
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.ScaleSupportedReport)
|
|
498
524
|
], HumidityControlSetpointCCScaleSupportedReport);
|
|
499
525
|
let HumidityControlSetpointCCScaleSupportedGet = class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {
|
|
500
|
-
constructor(
|
|
501
|
-
super(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
526
|
+
constructor(options) {
|
|
527
|
+
super(options);
|
|
528
|
+
this.setpointType = options.setpointType;
|
|
529
|
+
}
|
|
530
|
+
static from(_raw, _ctx) {
|
|
531
|
+
// TODO: Deserialize payload
|
|
532
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
533
|
+
// return new HumidityControlSetpointCCScaleSupportedGet({
|
|
534
|
+
// nodeId: ctx.sourceNodeId,
|
|
535
|
+
// });
|
|
509
536
|
}
|
|
510
537
|
setpointType;
|
|
511
|
-
serialize() {
|
|
538
|
+
serialize(ctx) {
|
|
512
539
|
this.payload = Buffer.from([this.setpointType & 0b1111]);
|
|
513
|
-
return super.serialize();
|
|
540
|
+
return super.serialize(ctx);
|
|
514
541
|
}
|
|
515
|
-
toLogEntry(
|
|
542
|
+
toLogEntry(ctx) {
|
|
516
543
|
return {
|
|
517
|
-
...super.toLogEntry(
|
|
544
|
+
...super.toLogEntry(ctx),
|
|
518
545
|
message: {
|
|
519
546
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
|
|
520
547
|
},
|
|
@@ -526,60 +553,54 @@ exports.HumidityControlSetpointCCScaleSupportedGet = HumidityControlSetpointCCSc
|
|
|
526
553
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.ScaleSupportedGet),
|
|
527
554
|
(0, CommandClassDecorators_1.expectedCCResponse)(HumidityControlSetpointCCScaleSupportedReport)
|
|
528
555
|
], HumidityControlSetpointCCScaleSupportedGet);
|
|
529
|
-
let HumidityControlSetpointCCCapabilitiesReport = class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {
|
|
530
|
-
constructor(
|
|
531
|
-
super(
|
|
532
|
-
|
|
533
|
-
this.
|
|
534
|
-
|
|
556
|
+
let HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport_1 = class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {
|
|
557
|
+
constructor(options) {
|
|
558
|
+
super(options);
|
|
559
|
+
this.type = options.type;
|
|
560
|
+
this.minValue = options.minValue;
|
|
561
|
+
this.maxValue = options.maxValue;
|
|
562
|
+
this.minValueScale = options.minValueScale;
|
|
563
|
+
this.maxValueScale = options.maxValueScale;
|
|
564
|
+
}
|
|
565
|
+
static from(raw, ctx) {
|
|
566
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
567
|
+
const type = raw.payload[0] & 0b1111;
|
|
535
568
|
// parseFloatWithScale does its own validation
|
|
536
|
-
(
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
569
|
+
const { value: minValue, scale: minValueScale, bytesRead, } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
|
|
570
|
+
const { value: maxValue, scale: maxValueScale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1 + bytesRead));
|
|
571
|
+
return new HumidityControlSetpointCCCapabilitiesReport_1({
|
|
572
|
+
nodeId: ctx.sourceNodeId,
|
|
573
|
+
type,
|
|
574
|
+
minValue,
|
|
575
|
+
minValueScale,
|
|
576
|
+
maxValue,
|
|
577
|
+
maxValueScale,
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
persistValues(ctx) {
|
|
581
|
+
if (!super.persistValues(ctx))
|
|
546
582
|
return false;
|
|
547
583
|
// Predefine the metadata
|
|
548
584
|
const setpointValue = exports.HumidityControlSetpointCCValues.setpoint(this.type);
|
|
549
|
-
this.setMetadata(
|
|
585
|
+
this.setMetadata(ctx, setpointValue, {
|
|
550
586
|
...setpointValue.meta,
|
|
551
|
-
min: this.
|
|
552
|
-
max: this.
|
|
553
|
-
unit: getSetpointUnit(this.
|
|
554
|
-
|| getSetpointUnit(this.
|
|
587
|
+
min: this.minValue,
|
|
588
|
+
max: this.maxValue,
|
|
589
|
+
unit: getSetpointUnit(this.minValueScale)
|
|
590
|
+
|| getSetpointUnit(this.maxValueScale),
|
|
555
591
|
});
|
|
556
592
|
return true;
|
|
557
593
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return this._minValue;
|
|
565
|
-
}
|
|
566
|
-
_maxValue;
|
|
567
|
-
get maxValue() {
|
|
568
|
-
return this._maxValue;
|
|
569
|
-
}
|
|
570
|
-
_minValueScale;
|
|
571
|
-
get minValueScale() {
|
|
572
|
-
return this._minValueScale;
|
|
573
|
-
}
|
|
574
|
-
_maxValueScale;
|
|
575
|
-
get maxValueScale() {
|
|
576
|
-
return this._maxValueScale;
|
|
577
|
-
}
|
|
578
|
-
toLogEntry(host) {
|
|
594
|
+
type;
|
|
595
|
+
minValue;
|
|
596
|
+
maxValue;
|
|
597
|
+
minValueScale;
|
|
598
|
+
maxValueScale;
|
|
599
|
+
toLogEntry(ctx) {
|
|
579
600
|
const minValueScale = getScale(this.minValueScale);
|
|
580
601
|
const maxValueScale = getScale(this.maxValueScale);
|
|
581
602
|
return {
|
|
582
|
-
...super.toLogEntry(
|
|
603
|
+
...super.toLogEntry(ctx),
|
|
583
604
|
message: {
|
|
584
605
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.type),
|
|
585
606
|
"min value": `${this.minValue} ${minValueScale.unit}`,
|
|
@@ -589,28 +610,29 @@ let HumidityControlSetpointCCCapabilitiesReport = class HumidityControlSetpointC
|
|
|
589
610
|
}
|
|
590
611
|
};
|
|
591
612
|
exports.HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport;
|
|
592
|
-
exports.HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport = __decorate([
|
|
613
|
+
exports.HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport = HumidityControlSetpointCCCapabilitiesReport_1 = __decorate([
|
|
593
614
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.HumidityControlSetpointCommand.CapabilitiesReport)
|
|
594
615
|
], HumidityControlSetpointCCCapabilitiesReport);
|
|
595
616
|
let HumidityControlSetpointCCCapabilitiesGet = class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {
|
|
596
|
-
constructor(
|
|
597
|
-
super(
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
617
|
+
constructor(options) {
|
|
618
|
+
super(options);
|
|
619
|
+
this.setpointType = options.setpointType;
|
|
620
|
+
}
|
|
621
|
+
static from(_raw, _ctx) {
|
|
622
|
+
// TODO: Deserialize payload
|
|
623
|
+
throw new safe_1.ZWaveError(`${this.name}: deserialization not implemented`, safe_1.ZWaveErrorCodes.Deserialization_NotImplemented);
|
|
624
|
+
// return new HumidityControlSetpointCCCapabilitiesGet({
|
|
625
|
+
// nodeId: ctx.sourceNodeId,
|
|
626
|
+
// });
|
|
605
627
|
}
|
|
606
628
|
setpointType;
|
|
607
|
-
serialize() {
|
|
629
|
+
serialize(ctx) {
|
|
608
630
|
this.payload = Buffer.from([this.setpointType & 0b1111]);
|
|
609
|
-
return super.serialize();
|
|
631
|
+
return super.serialize(ctx);
|
|
610
632
|
}
|
|
611
|
-
toLogEntry(
|
|
633
|
+
toLogEntry(ctx) {
|
|
612
634
|
return {
|
|
613
|
-
...super.toLogEntry(
|
|
635
|
+
...super.toLogEntry(ctx),
|
|
614
636
|
message: {
|
|
615
637
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.HumidityControlSetpointType, this.setpointType),
|
|
616
638
|
},
|