@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 ThermostatSetpointCCSet_1, ThermostatSetpointCCReport_1, ThermostatSetpointCCGet_1, ThermostatSetpointCCCapabilitiesReport_1, ThermostatSetpointCCCapabilitiesGet_1, ThermostatSetpointCCSupportedReport_1;
|
|
8
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
10
|
exports.ThermostatSetpointCCSupportedGet = exports.ThermostatSetpointCCSupportedReport = exports.ThermostatSetpointCCCapabilitiesGet = exports.ThermostatSetpointCCCapabilitiesReport = exports.ThermostatSetpointCCGet = exports.ThermostatSetpointCCReport = exports.ThermostatSetpointCCSet = exports.ThermostatSetpointCC = exports.ThermostatSetpointCCAPI = exports.ThermostatSetpointCCValues = void 0;
|
|
10
11
|
function __assertType(argName, typeName, boundHasError) {
|
|
@@ -54,9 +55,6 @@ exports.ThermostatSetpointCCValues = Object.freeze({
|
|
|
54
55
|
...Values_1.V.staticProperty("supportedSetpointTypes", undefined, {
|
|
55
56
|
internal: true,
|
|
56
57
|
}),
|
|
57
|
-
...Values_1.V.staticProperty("setpointTypesInterpretation", undefined, {
|
|
58
|
-
internal: true,
|
|
59
|
-
}),
|
|
60
58
|
}),
|
|
61
59
|
...Values_1.V.defineDynamicCCValues(safe_1.CommandClasses["Thermostat Setpoint"], {
|
|
62
60
|
...Values_1.V.dynamicPropertyAndKeyWithName("setpoint", "setpoint", (setpointType) => setpointType, ({ property, propertyKey }) => property === "setpoint" && typeof propertyKey === "number", (setpointType) => ({
|
|
@@ -121,12 +119,12 @@ let ThermostatSetpointCCAPI = class ThermostatSetpointCCAPI extends API_1.CCAPI
|
|
|
121
119
|
async get(setpointType) {
|
|
122
120
|
__assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
123
121
|
this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.Get);
|
|
124
|
-
const cc = new ThermostatSetpointCCGet(
|
|
122
|
+
const cc = new ThermostatSetpointCCGet({
|
|
125
123
|
nodeId: this.endpoint.nodeId,
|
|
126
|
-
|
|
124
|
+
endpointIndex: this.endpoint.index,
|
|
127
125
|
setpointType,
|
|
128
126
|
});
|
|
129
|
-
const response = await this.
|
|
127
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
130
128
|
if (!response)
|
|
131
129
|
return;
|
|
132
130
|
if (response.type !== _Types_1.ThermostatSetpointType["N/A"]) {
|
|
@@ -143,24 +141,24 @@ let ThermostatSetpointCCAPI = class ThermostatSetpointCCAPI extends API_1.CCAPI
|
|
|
143
141
|
__assertType("value", "number", __assertType__number.bind(void 0, value));
|
|
144
142
|
__assertType("scale", "number", __assertType__number.bind(void 0, scale));
|
|
145
143
|
this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.Set);
|
|
146
|
-
const cc = new ThermostatSetpointCCSet(
|
|
144
|
+
const cc = new ThermostatSetpointCCSet({
|
|
147
145
|
nodeId: this.endpoint.nodeId,
|
|
148
|
-
|
|
146
|
+
endpointIndex: this.endpoint.index,
|
|
149
147
|
setpointType,
|
|
150
148
|
value,
|
|
151
149
|
scale,
|
|
152
150
|
});
|
|
153
|
-
return this.
|
|
151
|
+
return this.host.sendCommand(cc, this.commandOptions);
|
|
154
152
|
}
|
|
155
153
|
async getCapabilities(setpointType) {
|
|
156
154
|
__assertType("setpointType", "ThermostatSetpointType", __assertType__number.bind(void 0, setpointType));
|
|
157
155
|
this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.CapabilitiesGet);
|
|
158
|
-
const cc = new ThermostatSetpointCCCapabilitiesGet(
|
|
156
|
+
const cc = new ThermostatSetpointCCCapabilitiesGet({
|
|
159
157
|
nodeId: this.endpoint.nodeId,
|
|
160
|
-
|
|
158
|
+
endpointIndex: this.endpoint.index,
|
|
161
159
|
setpointType,
|
|
162
160
|
});
|
|
163
|
-
const response = await this.
|
|
161
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
164
162
|
if (response) {
|
|
165
163
|
return (0, safe_2.pick)(response, [
|
|
166
164
|
"minValue",
|
|
@@ -177,11 +175,11 @@ let ThermostatSetpointCCAPI = class ThermostatSetpointCCAPI extends API_1.CCAPI
|
|
|
177
175
|
*/
|
|
178
176
|
async getSupportedSetpointTypes() {
|
|
179
177
|
this.assertSupportsCommand(_Types_1.ThermostatSetpointCommand, _Types_1.ThermostatSetpointCommand.SupportedGet);
|
|
180
|
-
const cc = new ThermostatSetpointCCSupportedGet(
|
|
178
|
+
const cc = new ThermostatSetpointCCSupportedGet({
|
|
181
179
|
nodeId: this.endpoint.nodeId,
|
|
182
|
-
|
|
180
|
+
endpointIndex: this.endpoint.index,
|
|
183
181
|
});
|
|
184
|
-
const response = await this.
|
|
182
|
+
const response = await this.host.sendCommand(cc, this.commandOptions);
|
|
185
183
|
return response?.supportedSetpointTypes;
|
|
186
184
|
}
|
|
187
185
|
};
|
|
@@ -190,77 +188,42 @@ exports.ThermostatSetpointCCAPI = ThermostatSetpointCCAPI = __decorate([
|
|
|
190
188
|
(0, CommandClassDecorators_1.API)(safe_1.CommandClasses["Thermostat Setpoint"])
|
|
191
189
|
], ThermostatSetpointCCAPI);
|
|
192
190
|
let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass_1.CommandClass {
|
|
193
|
-
translatePropertyKey(
|
|
191
|
+
translatePropertyKey(ctx, property, propertyKey) {
|
|
194
192
|
if (property === "setpoint") {
|
|
195
193
|
return (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, propertyKey);
|
|
196
194
|
}
|
|
197
195
|
else {
|
|
198
|
-
return super.translatePropertyKey(
|
|
196
|
+
return super.translatePropertyKey(ctx, property, propertyKey);
|
|
199
197
|
}
|
|
200
198
|
}
|
|
201
|
-
async interview(
|
|
202
|
-
const node = this.getNode(
|
|
203
|
-
const endpoint = this.getEndpoint(
|
|
204
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Thermostat Setpoint"],
|
|
199
|
+
async interview(ctx) {
|
|
200
|
+
const node = this.getNode(ctx);
|
|
201
|
+
const endpoint = this.getEndpoint(ctx);
|
|
202
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
|
|
205
203
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
206
204
|
});
|
|
207
|
-
|
|
205
|
+
ctx.logNode(node.id, {
|
|
208
206
|
endpoint: this.endpointIndex,
|
|
209
207
|
message: `Interviewing ${this.ccName}...`,
|
|
210
208
|
direction: "none",
|
|
211
209
|
});
|
|
212
|
-
if (
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
//
|
|
216
|
-
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
const resp = await api.getSupportedSetpointTypes();
|
|
224
|
-
if (!resp) {
|
|
225
|
-
applHost.controllerLog.logNode(node.id, {
|
|
226
|
-
endpoint: this.endpointIndex,
|
|
227
|
-
message: "Querying supported setpoint types timed out, skipping interview...",
|
|
228
|
-
level: "warn",
|
|
229
|
-
});
|
|
230
|
-
return;
|
|
231
|
-
}
|
|
232
|
-
setpointTypes = [...resp];
|
|
233
|
-
interpretation = undefined; // we don't know yet which interpretation the device uses
|
|
234
|
-
// If necessary, test which interpretation the device follows
|
|
235
|
-
// Assume interpretation B
|
|
236
|
-
// --> If setpoints 3,4,5 or 6 are supported, the assumption is wrong ==> A
|
|
237
|
-
function switchToInterpretationA() {
|
|
238
|
-
setpointTypes = setpointTypes.map((i) => thermostatSetpointTypeMap[i]);
|
|
239
|
-
interpretation = "A";
|
|
240
|
-
interpretationChanged = true;
|
|
241
|
-
}
|
|
242
|
-
if ([3, 4, 5, 6].some((type) => setpointTypes.includes(type))) {
|
|
243
|
-
applHost.controllerLog.logNode(node.id, {
|
|
244
|
-
endpoint: this.endpointIndex,
|
|
245
|
-
message: "uses Thermostat Setpoint bitmap interpretation A",
|
|
246
|
-
direction: "none",
|
|
247
|
-
});
|
|
248
|
-
switchToInterpretationA();
|
|
249
|
-
}
|
|
250
|
-
else {
|
|
251
|
-
applHost.controllerLog.logNode(node.id, {
|
|
252
|
-
endpoint: this.endpointIndex,
|
|
253
|
-
message: "Thermostat Setpoint bitmap interpretation is unknown, assuming B for now",
|
|
254
|
-
direction: "none",
|
|
255
|
-
});
|
|
256
|
-
}
|
|
210
|
+
if (api.version <= 2) {
|
|
211
|
+
// It has been found that early implementations of this Command Class applied two non-interoperable
|
|
212
|
+
// interpretations of the bit mask advertising the support for specific Setpoint Types in the Thermostat
|
|
213
|
+
// Setpoint Supported Report Command.
|
|
214
|
+
// A controlling node SHOULD determine the supported Setpoint Types of a version 1 and version 2
|
|
215
|
+
// supporting node by sending one Thermostat Setpoint Get Command at a time while incrementing
|
|
216
|
+
// the requested Setpoint Type.
|
|
217
|
+
// If the same Setpoint Type is advertised in the returned Thermostat Setpoint Report Command, the
|
|
218
|
+
// controlling node MUST conclude that the actual Setpoint Type is supported.
|
|
219
|
+
// If the Setpoint Type 0x00 (type N/A) is advertised in the returned Thermostat Setpoint Report
|
|
220
|
+
// Command, the controlling node MUST conclude that the actual Setpoint Type is not supported.
|
|
257
221
|
// Now scan all endpoints. Each type we received a value for gets marked as supported
|
|
258
222
|
const supportedSetpointTypes = [];
|
|
259
|
-
for (let
|
|
260
|
-
const type = setpointTypes[i];
|
|
223
|
+
for (let type = _Types_1.ThermostatSetpointType.Heating; type <= _Types_1.ThermostatSetpointType["Full Power"]; type++) {
|
|
261
224
|
const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type);
|
|
262
225
|
// Every time, query the current value
|
|
263
|
-
|
|
226
|
+
ctx.logNode(node.id, {
|
|
264
227
|
endpoint: this.endpointIndex,
|
|
265
228
|
message: `querying current value of setpoint ${setpointName}...`,
|
|
266
229
|
direction: "outbound",
|
|
@@ -274,48 +237,24 @@ let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass_1.Com
|
|
|
274
237
|
logMessage =
|
|
275
238
|
`received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
|
|
276
239
|
}
|
|
277
|
-
else if (!interpretation) {
|
|
278
|
-
// The setpoint type is not supported, switch to interpretation A
|
|
279
|
-
applHost.controllerLog.logNode(node.id, {
|
|
280
|
-
endpoint: this.endpointIndex,
|
|
281
|
-
message: `the setpoint type ${type} is unsupported, switching to interpretation A`,
|
|
282
|
-
direction: "none",
|
|
283
|
-
});
|
|
284
|
-
switchToInterpretationA();
|
|
285
|
-
// retry the current type and scan the remaining types as A
|
|
286
|
-
i--;
|
|
287
|
-
continue;
|
|
288
|
-
}
|
|
289
240
|
else {
|
|
290
241
|
// We're sure about the interpretation - this should not happen
|
|
291
|
-
logMessage = `
|
|
242
|
+
logMessage = `setpoint ${setpointName} is not supported`;
|
|
292
243
|
}
|
|
293
|
-
|
|
244
|
+
ctx.logNode(node.id, {
|
|
294
245
|
endpoint: this.endpointIndex,
|
|
295
246
|
message: logMessage,
|
|
296
247
|
direction: "inbound",
|
|
297
248
|
});
|
|
298
249
|
}
|
|
299
|
-
//
|
|
300
|
-
|
|
301
|
-
if (!interpretation && !interpretationChanged) {
|
|
302
|
-
// our assumption about interpretation B was correct
|
|
303
|
-
interpretation = "B";
|
|
304
|
-
interpretationChanged = true;
|
|
305
|
-
}
|
|
306
|
-
// Remember which setpoint types are actually supported, so we don't
|
|
307
|
-
// need to do this guesswork again
|
|
308
|
-
this.setValue(applHost, exports.ThermostatSetpointCCValues.supportedSetpointTypes, supportedSetpointTypes);
|
|
309
|
-
// Also save the bitmap interpretation if we know it now
|
|
310
|
-
if (interpretationChanged) {
|
|
311
|
-
this.setValue(applHost, exports.ThermostatSetpointCCValues.setpointTypesInterpretation, interpretation);
|
|
312
|
-
}
|
|
250
|
+
// Remember which setpoint types are actually supported
|
|
251
|
+
this.setValue(ctx, exports.ThermostatSetpointCCValues.supportedSetpointTypes, supportedSetpointTypes);
|
|
313
252
|
}
|
|
314
253
|
else {
|
|
315
254
|
// Versions >= 3 adhere to bitmap interpretation A, so we can rely on getSupportedSetpointTypes
|
|
316
255
|
// Query the supported setpoint types
|
|
317
256
|
let setpointTypes = [];
|
|
318
|
-
|
|
257
|
+
ctx.logNode(node.id, {
|
|
319
258
|
endpoint: this.endpointIndex,
|
|
320
259
|
message: "retrieving supported setpoint types...",
|
|
321
260
|
direction: "outbound",
|
|
@@ -328,14 +267,14 @@ let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass_1.Com
|
|
|
328
267
|
.map((type) => (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type))
|
|
329
268
|
.map((name) => `· ${name}`)
|
|
330
269
|
.join("\n");
|
|
331
|
-
|
|
270
|
+
ctx.logNode(node.id, {
|
|
332
271
|
endpoint: this.endpointIndex,
|
|
333
272
|
message: logMessage,
|
|
334
273
|
direction: "inbound",
|
|
335
274
|
});
|
|
336
275
|
}
|
|
337
276
|
else {
|
|
338
|
-
|
|
277
|
+
ctx.logNode(node.id, {
|
|
339
278
|
endpoint: this.endpointIndex,
|
|
340
279
|
message: "Querying supported setpoint types timed out, skipping interview...",
|
|
341
280
|
level: "warn",
|
|
@@ -345,7 +284,7 @@ let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass_1.Com
|
|
|
345
284
|
for (const type of setpointTypes) {
|
|
346
285
|
const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type);
|
|
347
286
|
// Find out the capabilities of this setpoint
|
|
348
|
-
|
|
287
|
+
ctx.logNode(node.id, {
|
|
349
288
|
endpoint: this.endpointIndex,
|
|
350
289
|
message: `retrieving capabilities for setpoint ${setpointName}...`,
|
|
351
290
|
direction: "outbound",
|
|
@@ -357,7 +296,7 @@ let ThermostatSetpointCC = class ThermostatSetpointCC extends CommandClass_1.Com
|
|
|
357
296
|
const logMessage = `received capabilities for setpoint ${setpointName}:
|
|
358
297
|
minimum value: ${setpointCaps.minValue} ${minValueUnit}
|
|
359
298
|
maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
360
|
-
|
|
299
|
+
ctx.logNode(node.id, {
|
|
361
300
|
endpoint: this.endpointIndex,
|
|
362
301
|
message: logMessage,
|
|
363
302
|
direction: "inbound",
|
|
@@ -365,23 +304,23 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
|
365
304
|
}
|
|
366
305
|
}
|
|
367
306
|
// Query the current value for all setpoint types
|
|
368
|
-
await this.refreshValues(
|
|
307
|
+
await this.refreshValues(ctx);
|
|
369
308
|
}
|
|
370
309
|
// Remember that the interview is complete
|
|
371
|
-
this.setInterviewComplete(
|
|
310
|
+
this.setInterviewComplete(ctx, true);
|
|
372
311
|
}
|
|
373
|
-
async refreshValues(
|
|
374
|
-
const node = this.getNode(
|
|
375
|
-
const endpoint = this.getEndpoint(
|
|
376
|
-
const api = API_1.CCAPI.create(safe_1.CommandClasses["Thermostat Setpoint"],
|
|
312
|
+
async refreshValues(ctx) {
|
|
313
|
+
const node = this.getNode(ctx);
|
|
314
|
+
const endpoint = this.getEndpoint(ctx);
|
|
315
|
+
const api = API_1.CCAPI.create(safe_1.CommandClasses["Thermostat Setpoint"], ctx, endpoint).withOptions({
|
|
377
316
|
priority: safe_1.MessagePriority.NodeQuery,
|
|
378
317
|
});
|
|
379
|
-
const setpointTypes = this.getValue(
|
|
318
|
+
const setpointTypes = this.getValue(ctx, exports.ThermostatSetpointCCValues.supportedSetpointTypes) ?? [];
|
|
380
319
|
// Query each setpoint's current value
|
|
381
320
|
for (const type of setpointTypes) {
|
|
382
321
|
const setpointName = (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, type);
|
|
383
322
|
// Every time, query the current value
|
|
384
|
-
|
|
323
|
+
ctx.logNode(node.id, {
|
|
385
324
|
endpoint: this.endpointIndex,
|
|
386
325
|
message: `querying current value of setpoint ${setpointName}...`,
|
|
387
326
|
direction: "outbound",
|
|
@@ -389,7 +328,7 @@ maximum value: ${setpointCaps.maxValue} ${maxValueUnit}`;
|
|
|
389
328
|
const setpoint = await api.get(type);
|
|
390
329
|
if (setpoint) {
|
|
391
330
|
const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${setpoint.scale.unit ?? ""}`;
|
|
392
|
-
|
|
331
|
+
ctx.logNode(node.id, {
|
|
393
332
|
endpoint: this.endpointIndex,
|
|
394
333
|
message: logMessage,
|
|
395
334
|
direction: "inbound",
|
|
@@ -404,40 +343,42 @@ exports.ThermostatSetpointCC = ThermostatSetpointCC = __decorate([
|
|
|
404
343
|
(0, CommandClassDecorators_1.implementedVersion)(3),
|
|
405
344
|
(0, CommandClassDecorators_1.ccValues)(exports.ThermostatSetpointCCValues)
|
|
406
345
|
], ThermostatSetpointCC);
|
|
407
|
-
let ThermostatSetpointCCSet = class ThermostatSetpointCCSet extends ThermostatSetpointCC {
|
|
408
|
-
constructor(
|
|
409
|
-
super(
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
346
|
+
let ThermostatSetpointCCSet = ThermostatSetpointCCSet_1 = class ThermostatSetpointCCSet extends ThermostatSetpointCC {
|
|
347
|
+
constructor(options) {
|
|
348
|
+
super(options);
|
|
349
|
+
this.setpointType = options.setpointType;
|
|
350
|
+
this.value = options.value;
|
|
351
|
+
this.scale = options.scale;
|
|
352
|
+
}
|
|
353
|
+
static from(raw, ctx) {
|
|
354
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
355
|
+
const setpointType = raw.payload[0] & 0b1111;
|
|
356
|
+
// parseFloatWithScale does its own validation
|
|
357
|
+
const { value, scale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
|
|
358
|
+
return new ThermostatSetpointCCSet_1({
|
|
359
|
+
nodeId: ctx.sourceNodeId,
|
|
360
|
+
setpointType,
|
|
361
|
+
value,
|
|
362
|
+
scale,
|
|
363
|
+
});
|
|
423
364
|
}
|
|
424
365
|
setpointType;
|
|
425
366
|
value;
|
|
426
367
|
scale;
|
|
427
|
-
serialize() {
|
|
368
|
+
serialize(ctx) {
|
|
428
369
|
// If a config file overwrites how the float should be encoded, use that information
|
|
429
|
-
const override =
|
|
370
|
+
const override = ctx.getDeviceConfig?.(this.nodeId)
|
|
430
371
|
?.compat?.overrideFloatEncoding;
|
|
431
372
|
this.payload = Buffer.concat([
|
|
432
373
|
Buffer.from([this.setpointType & 0b1111]),
|
|
433
374
|
(0, safe_1.encodeFloatWithScale)(this.value, this.scale, override),
|
|
434
375
|
]);
|
|
435
|
-
return super.serialize();
|
|
376
|
+
return super.serialize(ctx);
|
|
436
377
|
}
|
|
437
|
-
toLogEntry(
|
|
378
|
+
toLogEntry(ctx) {
|
|
438
379
|
const scale = getScale(this.scale);
|
|
439
380
|
return {
|
|
440
|
-
...super.toLogEntry(
|
|
381
|
+
...super.toLogEntry(ctx),
|
|
441
382
|
message: {
|
|
442
383
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.setpointType),
|
|
443
384
|
value: `${this.value} ${scale.unit}`,
|
|
@@ -446,65 +387,70 @@ let ThermostatSetpointCCSet = class ThermostatSetpointCCSet extends ThermostatSe
|
|
|
446
387
|
}
|
|
447
388
|
};
|
|
448
389
|
exports.ThermostatSetpointCCSet = ThermostatSetpointCCSet;
|
|
449
|
-
exports.ThermostatSetpointCCSet = ThermostatSetpointCCSet = __decorate([
|
|
390
|
+
exports.ThermostatSetpointCCSet = ThermostatSetpointCCSet = ThermostatSetpointCCSet_1 = __decorate([
|
|
450
391
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ThermostatSetpointCommand.Set),
|
|
451
392
|
(0, CommandClassDecorators_1.useSupervision)()
|
|
452
393
|
], ThermostatSetpointCCSet);
|
|
453
|
-
let ThermostatSetpointCCReport = class ThermostatSetpointCCReport extends ThermostatSetpointCC {
|
|
454
|
-
constructor(
|
|
455
|
-
super(
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
this.type = options.type;
|
|
472
|
-
this.value = options.value;
|
|
473
|
-
this.scale = options.scale;
|
|
394
|
+
let ThermostatSetpointCCReport = ThermostatSetpointCCReport_1 = class ThermostatSetpointCCReport extends ThermostatSetpointCC {
|
|
395
|
+
constructor(options) {
|
|
396
|
+
super(options);
|
|
397
|
+
this.type = options.type;
|
|
398
|
+
this.value = options.value;
|
|
399
|
+
this.scale = options.scale;
|
|
400
|
+
}
|
|
401
|
+
static from(raw, ctx) {
|
|
402
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
403
|
+
const type = raw.payload[0] & 0b1111;
|
|
404
|
+
if (type === 0) {
|
|
405
|
+
// Not supported
|
|
406
|
+
return new ThermostatSetpointCCReport_1({
|
|
407
|
+
nodeId: ctx.sourceNodeId,
|
|
408
|
+
type,
|
|
409
|
+
value: 0,
|
|
410
|
+
scale: 0,
|
|
411
|
+
});
|
|
474
412
|
}
|
|
413
|
+
// parseFloatWithScale does its own validation
|
|
414
|
+
const { value, scale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
|
|
415
|
+
return new ThermostatSetpointCCReport_1({
|
|
416
|
+
nodeId: ctx.sourceNodeId,
|
|
417
|
+
type,
|
|
418
|
+
value,
|
|
419
|
+
scale,
|
|
420
|
+
});
|
|
475
421
|
}
|
|
476
|
-
persistValues(
|
|
477
|
-
if (!super.persistValues(
|
|
422
|
+
persistValues(ctx) {
|
|
423
|
+
if (!super.persistValues(ctx))
|
|
478
424
|
return false;
|
|
479
425
|
const scale = getScale(this.scale);
|
|
480
426
|
const setpointValue = exports.ThermostatSetpointCCValues.setpoint(this.type);
|
|
481
|
-
const existingMetadata = this.getMetadata(
|
|
427
|
+
const existingMetadata = this.getMetadata(ctx, setpointValue);
|
|
482
428
|
// Update the metadata when it is missing or the unit has changed
|
|
483
429
|
if (existingMetadata?.unit !== scale.unit) {
|
|
484
|
-
this.setMetadata(
|
|
430
|
+
this.setMetadata(ctx, setpointValue, {
|
|
485
431
|
...(existingMetadata ?? setpointValue.meta),
|
|
486
432
|
unit: scale.unit,
|
|
487
433
|
});
|
|
488
434
|
}
|
|
489
|
-
this.setValue(
|
|
435
|
+
this.setValue(ctx, setpointValue, this.value);
|
|
490
436
|
// Remember the device-preferred setpoint scale so it can be used in SET commands
|
|
491
|
-
this.setValue(
|
|
437
|
+
this.setValue(ctx, exports.ThermostatSetpointCCValues.setpointScale(this.type), scale.key);
|
|
492
438
|
return true;
|
|
493
439
|
}
|
|
494
440
|
type;
|
|
495
441
|
scale;
|
|
496
442
|
value;
|
|
497
|
-
serialize() {
|
|
443
|
+
serialize(ctx) {
|
|
498
444
|
this.payload = Buffer.concat([
|
|
499
445
|
Buffer.from([this.type & 0b1111]),
|
|
500
446
|
(0, safe_1.encodeFloatWithScale)(this.value, this.scale),
|
|
501
447
|
]);
|
|
502
|
-
return super.serialize();
|
|
448
|
+
return super.serialize(ctx);
|
|
503
449
|
}
|
|
504
|
-
toLogEntry(
|
|
450
|
+
toLogEntry(ctx) {
|
|
505
451
|
const scale = getScale(this.scale);
|
|
506
452
|
return {
|
|
507
|
-
...super.toLogEntry(
|
|
453
|
+
...super.toLogEntry(ctx),
|
|
508
454
|
message: {
|
|
509
455
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.type),
|
|
510
456
|
value: `${this.value} ${scale.unit}`,
|
|
@@ -513,32 +459,34 @@ let ThermostatSetpointCCReport = class ThermostatSetpointCCReport extends Thermo
|
|
|
513
459
|
}
|
|
514
460
|
};
|
|
515
461
|
exports.ThermostatSetpointCCReport = ThermostatSetpointCCReport;
|
|
516
|
-
exports.ThermostatSetpointCCReport = ThermostatSetpointCCReport = __decorate([
|
|
462
|
+
exports.ThermostatSetpointCCReport = ThermostatSetpointCCReport = ThermostatSetpointCCReport_1 = __decorate([
|
|
517
463
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ThermostatSetpointCommand.Report)
|
|
518
464
|
], ThermostatSetpointCCReport);
|
|
519
465
|
function testResponseForThermostatSetpointGet(sent, received) {
|
|
520
466
|
// We expect a Thermostat Setpoint Report that matches the requested setpoint type
|
|
521
467
|
return received.type === sent.setpointType;
|
|
522
468
|
}
|
|
523
|
-
let ThermostatSetpointCCGet = class ThermostatSetpointCCGet extends ThermostatSetpointCC {
|
|
524
|
-
constructor(
|
|
525
|
-
super(
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
469
|
+
let ThermostatSetpointCCGet = ThermostatSetpointCCGet_1 = class ThermostatSetpointCCGet extends ThermostatSetpointCC {
|
|
470
|
+
constructor(options) {
|
|
471
|
+
super(options);
|
|
472
|
+
this.setpointType = options.setpointType;
|
|
473
|
+
}
|
|
474
|
+
static from(raw, ctx) {
|
|
475
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
476
|
+
const setpointType = raw.payload[0] & 0b1111;
|
|
477
|
+
return new ThermostatSetpointCCGet_1({
|
|
478
|
+
nodeId: ctx.sourceNodeId,
|
|
479
|
+
setpointType,
|
|
480
|
+
});
|
|
533
481
|
}
|
|
534
482
|
setpointType;
|
|
535
|
-
serialize() {
|
|
483
|
+
serialize(ctx) {
|
|
536
484
|
this.payload = Buffer.from([this.setpointType & 0b1111]);
|
|
537
|
-
return super.serialize();
|
|
485
|
+
return super.serialize(ctx);
|
|
538
486
|
}
|
|
539
|
-
toLogEntry(
|
|
487
|
+
toLogEntry(ctx) {
|
|
540
488
|
return {
|
|
541
|
-
...super.toLogEntry(
|
|
489
|
+
...super.toLogEntry(ctx),
|
|
542
490
|
message: {
|
|
543
491
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.setpointType),
|
|
544
492
|
},
|
|
@@ -546,40 +494,40 @@ let ThermostatSetpointCCGet = class ThermostatSetpointCCGet extends ThermostatSe
|
|
|
546
494
|
}
|
|
547
495
|
};
|
|
548
496
|
exports.ThermostatSetpointCCGet = ThermostatSetpointCCGet;
|
|
549
|
-
exports.ThermostatSetpointCCGet = ThermostatSetpointCCGet = __decorate([
|
|
497
|
+
exports.ThermostatSetpointCCGet = ThermostatSetpointCCGet = ThermostatSetpointCCGet_1 = __decorate([
|
|
550
498
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ThermostatSetpointCommand.Get),
|
|
551
499
|
(0, CommandClassDecorators_1.expectedCCResponse)(ThermostatSetpointCCReport, testResponseForThermostatSetpointGet)
|
|
552
500
|
], ThermostatSetpointCCGet);
|
|
553
|
-
let ThermostatSetpointCCCapabilitiesReport = class ThermostatSetpointCCCapabilitiesReport extends ThermostatSetpointCC {
|
|
554
|
-
constructor(
|
|
555
|
-
super(
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}
|
|
501
|
+
let ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport_1 = class ThermostatSetpointCCCapabilitiesReport extends ThermostatSetpointCC {
|
|
502
|
+
constructor(options) {
|
|
503
|
+
super(options);
|
|
504
|
+
this.type = options.type;
|
|
505
|
+
this.minValue = options.minValue;
|
|
506
|
+
this.minValueScale = options.minValueScale;
|
|
507
|
+
this.maxValue = options.maxValue;
|
|
508
|
+
this.maxValueScale = options.maxValueScale;
|
|
509
|
+
}
|
|
510
|
+
static from(raw, ctx) {
|
|
511
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
512
|
+
const type = raw.payload[0];
|
|
513
|
+
// parseFloatWithScale does its own validation
|
|
514
|
+
const { value: minValue, scale: minValueScale, bytesRead, } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1));
|
|
515
|
+
const { value: maxValue, scale: maxValueScale } = (0, safe_1.parseFloatWithScale)(raw.payload.subarray(1 + bytesRead));
|
|
516
|
+
return new ThermostatSetpointCCCapabilitiesReport_1({
|
|
517
|
+
nodeId: ctx.sourceNodeId,
|
|
518
|
+
type,
|
|
519
|
+
minValue,
|
|
520
|
+
minValueScale,
|
|
521
|
+
maxValue,
|
|
522
|
+
maxValueScale,
|
|
523
|
+
});
|
|
576
524
|
}
|
|
577
|
-
persistValues(
|
|
578
|
-
if (!super.persistValues(
|
|
525
|
+
persistValues(ctx) {
|
|
526
|
+
if (!super.persistValues(ctx))
|
|
579
527
|
return false;
|
|
580
528
|
// Predefine the metadata
|
|
581
529
|
const setpointValue = exports.ThermostatSetpointCCValues.setpoint(this.type);
|
|
582
|
-
this.setMetadata(
|
|
530
|
+
this.setMetadata(ctx, setpointValue, {
|
|
583
531
|
...setpointValue.meta,
|
|
584
532
|
min: this.minValue,
|
|
585
533
|
max: this.maxValue,
|
|
@@ -593,17 +541,17 @@ let ThermostatSetpointCCCapabilitiesReport = class ThermostatSetpointCCCapabilit
|
|
|
593
541
|
maxValue;
|
|
594
542
|
minValueScale;
|
|
595
543
|
maxValueScale;
|
|
596
|
-
serialize() {
|
|
544
|
+
serialize(ctx) {
|
|
597
545
|
const min = (0, safe_1.encodeFloatWithScale)(this.minValue, this.minValueScale);
|
|
598
546
|
const max = (0, safe_1.encodeFloatWithScale)(this.maxValue, this.maxValueScale);
|
|
599
547
|
this.payload = Buffer.concat([Buffer.from([this.type]), min, max]);
|
|
600
|
-
return super.serialize();
|
|
548
|
+
return super.serialize(ctx);
|
|
601
549
|
}
|
|
602
|
-
toLogEntry(
|
|
550
|
+
toLogEntry(ctx) {
|
|
603
551
|
const minValueScale = getScale(this.minValueScale);
|
|
604
552
|
const maxValueScale = getScale(this.maxValueScale);
|
|
605
553
|
return {
|
|
606
|
-
...super.toLogEntry(
|
|
554
|
+
...super.toLogEntry(ctx),
|
|
607
555
|
message: {
|
|
608
556
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.type),
|
|
609
557
|
"min value": `${this.minValue} ${minValueScale.unit}`,
|
|
@@ -613,28 +561,30 @@ let ThermostatSetpointCCCapabilitiesReport = class ThermostatSetpointCCCapabilit
|
|
|
613
561
|
}
|
|
614
562
|
};
|
|
615
563
|
exports.ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport;
|
|
616
|
-
exports.ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport = __decorate([
|
|
564
|
+
exports.ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport = ThermostatSetpointCCCapabilitiesReport_1 = __decorate([
|
|
617
565
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ThermostatSetpointCommand.CapabilitiesReport)
|
|
618
566
|
], ThermostatSetpointCCCapabilitiesReport);
|
|
619
|
-
let ThermostatSetpointCCCapabilitiesGet = class ThermostatSetpointCCCapabilitiesGet extends ThermostatSetpointCC {
|
|
620
|
-
constructor(
|
|
621
|
-
super(
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
567
|
+
let ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet_1 = class ThermostatSetpointCCCapabilitiesGet extends ThermostatSetpointCC {
|
|
568
|
+
constructor(options) {
|
|
569
|
+
super(options);
|
|
570
|
+
this.setpointType = options.setpointType;
|
|
571
|
+
}
|
|
572
|
+
static from(raw, ctx) {
|
|
573
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
574
|
+
const setpointType = raw.payload[0] & 0b1111;
|
|
575
|
+
return new ThermostatSetpointCCCapabilitiesGet_1({
|
|
576
|
+
nodeId: ctx.sourceNodeId,
|
|
577
|
+
setpointType,
|
|
578
|
+
});
|
|
629
579
|
}
|
|
630
580
|
setpointType;
|
|
631
|
-
serialize() {
|
|
581
|
+
serialize(ctx) {
|
|
632
582
|
this.payload = Buffer.from([this.setpointType & 0b1111]);
|
|
633
|
-
return super.serialize();
|
|
583
|
+
return super.serialize(ctx);
|
|
634
584
|
}
|
|
635
|
-
toLogEntry(
|
|
585
|
+
toLogEntry(ctx) {
|
|
636
586
|
return {
|
|
637
|
-
...super.toLogEntry(
|
|
587
|
+
...super.toLogEntry(ctx),
|
|
638
588
|
message: {
|
|
639
589
|
"setpoint type": (0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, this.setpointType),
|
|
640
590
|
},
|
|
@@ -642,56 +592,42 @@ let ThermostatSetpointCCCapabilitiesGet = class ThermostatSetpointCCCapabilities
|
|
|
642
592
|
}
|
|
643
593
|
};
|
|
644
594
|
exports.ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet;
|
|
645
|
-
exports.ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet = __decorate([
|
|
595
|
+
exports.ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet = ThermostatSetpointCCCapabilitiesGet_1 = __decorate([
|
|
646
596
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ThermostatSetpointCommand.CapabilitiesGet),
|
|
647
597
|
(0, CommandClassDecorators_1.expectedCCResponse)(ThermostatSetpointCCCapabilitiesReport)
|
|
648
598
|
], ThermostatSetpointCCCapabilitiesGet);
|
|
649
|
-
let ThermostatSetpointCCSupportedReport = class ThermostatSetpointCCSupportedReport extends ThermostatSetpointCC {
|
|
650
|
-
constructor(
|
|
651
|
-
super(
|
|
652
|
-
if (
|
|
653
|
-
|
|
654
|
-
const bitMask = this.payload;
|
|
655
|
-
const supported = (0, safe_1.parseBitMask)(bitMask, _Types_1.ThermostatSetpointType["N/A"]);
|
|
656
|
-
if (this.version >= 3) {
|
|
657
|
-
// Interpretation A
|
|
658
|
-
this.supportedSetpointTypes = supported.map((i) => thermostatSetpointTypeMap[i]);
|
|
659
|
-
}
|
|
660
|
-
else {
|
|
661
|
-
// It is unknown which interpretation the device complies to.
|
|
662
|
-
// This must be tested during the interview
|
|
663
|
-
this.supportedSetpointTypes = supported;
|
|
664
|
-
}
|
|
665
|
-
// TODO:
|
|
666
|
-
// Some devices skip the gaps in the ThermostatSetpointType (Interpretation A), some don't (Interpretation B)
|
|
667
|
-
// Devices with V3+ must comply with Interpretation A
|
|
668
|
-
// It is RECOMMENDED that a controlling node determines supported Setpoint Types
|
|
669
|
-
// by sending one Thermostat Setpoint Get Command at a time while incrementing
|
|
670
|
-
// the requested Setpoint Type. If the same Setpoint Type is advertised in the
|
|
671
|
-
// resulting Thermostat Setpoint Report Command, the controlling node MAY conclude
|
|
672
|
-
// that the actual Setpoint Type is supported. If the Setpoint Type 0x00 (type N/A)
|
|
673
|
-
// is advertised in the resulting Thermostat Setpoint Report Command, the controlling
|
|
674
|
-
// node MUST conclude that the actual Setpoint Type is not supported.
|
|
675
|
-
}
|
|
676
|
-
else {
|
|
677
|
-
if (options.supportedSetpointTypes.length === 0) {
|
|
678
|
-
throw new safe_1.ZWaveError(`At least one setpoint type must be supported`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
679
|
-
}
|
|
680
|
-
this.supportedSetpointTypes = options.supportedSetpointTypes;
|
|
599
|
+
let ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport_1 = class ThermostatSetpointCCSupportedReport extends ThermostatSetpointCC {
|
|
600
|
+
constructor(options) {
|
|
601
|
+
super(options);
|
|
602
|
+
if (options.supportedSetpointTypes.length === 0) {
|
|
603
|
+
throw new safe_1.ZWaveError(`At least one setpoint type must be supported`, safe_1.ZWaveErrorCodes.Argument_Invalid);
|
|
681
604
|
}
|
|
605
|
+
this.supportedSetpointTypes = options.supportedSetpointTypes;
|
|
606
|
+
}
|
|
607
|
+
static from(raw, ctx) {
|
|
608
|
+
(0, safe_1.validatePayload)(raw.payload.length >= 1);
|
|
609
|
+
const bitMask = raw.payload;
|
|
610
|
+
const supported = (0, safe_1.parseBitMask)(bitMask, _Types_1.ThermostatSetpointType["N/A"]);
|
|
611
|
+
// We use this command only when we are sure that bitmask interpretation A is used
|
|
612
|
+
// FIXME: Figure out if we can do this without the CC version
|
|
613
|
+
const supportedSetpointTypes = supported.map((i) => thermostatSetpointTypeMap[i]);
|
|
614
|
+
return new ThermostatSetpointCCSupportedReport_1({
|
|
615
|
+
nodeId: ctx.sourceNodeId,
|
|
616
|
+
supportedSetpointTypes,
|
|
617
|
+
});
|
|
682
618
|
}
|
|
683
619
|
supportedSetpointTypes;
|
|
684
|
-
serialize() {
|
|
620
|
+
serialize(ctx) {
|
|
685
621
|
this.payload = (0, safe_1.encodeBitMask)(
|
|
686
622
|
// Encode as interpretation A
|
|
687
623
|
this.supportedSetpointTypes
|
|
688
624
|
.map((t) => thermostatSetpointTypeMap.indexOf(t))
|
|
689
625
|
.filter((t) => t !== -1), undefined, _Types_1.ThermostatSetpointType["N/A"]);
|
|
690
|
-
return super.serialize();
|
|
626
|
+
return super.serialize(ctx);
|
|
691
627
|
}
|
|
692
|
-
toLogEntry(
|
|
628
|
+
toLogEntry(ctx) {
|
|
693
629
|
return {
|
|
694
|
-
...super.toLogEntry(
|
|
630
|
+
...super.toLogEntry(ctx),
|
|
695
631
|
message: {
|
|
696
632
|
"supported setpoint types": this.supportedSetpointTypes
|
|
697
633
|
.map((t) => `\n· ${(0, safe_2.getEnumMemberName)(_Types_1.ThermostatSetpointType, t)}`)
|
|
@@ -704,7 +640,7 @@ exports.ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedRepor
|
|
|
704
640
|
__decorate([
|
|
705
641
|
(0, CommandClassDecorators_1.ccValue)(exports.ThermostatSetpointCCValues.supportedSetpointTypes)
|
|
706
642
|
], ThermostatSetpointCCSupportedReport.prototype, "supportedSetpointTypes", void 0);
|
|
707
|
-
exports.ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport = __decorate([
|
|
643
|
+
exports.ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport = ThermostatSetpointCCSupportedReport_1 = __decorate([
|
|
708
644
|
(0, CommandClassDecorators_1.CCCommand)(_Types_1.ThermostatSetpointCommand.SupportedReport)
|
|
709
645
|
], ThermostatSetpointCCSupportedReport);
|
|
710
646
|
let ThermostatSetpointCCSupportedGet = class ThermostatSetpointCCSupportedGet extends ThermostatSetpointCC {
|