@zwave-js/cc 15.29.0 → 15.31.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.
Files changed (166) hide show
  1. package/build/cjs/cc/AlarmSensorCC.d.ts +3 -1
  2. package/build/cjs/cc/AlarmSensorCC.js +22 -2
  3. package/build/cjs/cc/AlarmSensorCC.js.map +2 -2
  4. package/build/cjs/cc/BarrierOperatorCC.d.ts +6 -3
  5. package/build/cjs/cc/BarrierOperatorCC.js +40 -6
  6. package/build/cjs/cc/BarrierOperatorCC.js.map +2 -2
  7. package/build/cjs/cc/CentralSceneCC.d.ts +4 -1
  8. package/build/cjs/cc/CentralSceneCC.js +34 -2
  9. package/build/cjs/cc/CentralSceneCC.js.map +2 -2
  10. package/build/cjs/cc/ClimateControlScheduleCC.d.ts +6 -3
  11. package/build/cjs/cc/ClimateControlScheduleCC.js +54 -6
  12. package/build/cjs/cc/ClimateControlScheduleCC.js.map +2 -2
  13. package/build/cjs/cc/ClockCC.d.ts +2 -1
  14. package/build/cjs/cc/ClockCC.js +19 -2
  15. package/build/cjs/cc/ClockCC.js.map +2 -2
  16. package/build/cjs/cc/ConfigurationCC.d.ts +3 -2
  17. package/build/cjs/cc/ConfigurationCC.js +61 -4
  18. package/build/cjs/cc/ConfigurationCC.js.map +2 -2
  19. package/build/cjs/cc/DoorLockLoggingCC.d.ts +3 -1
  20. package/build/cjs/cc/DoorLockLoggingCC.js +35 -2
  21. package/build/cjs/cc/DoorLockLoggingCC.js.map +2 -2
  22. package/build/cjs/cc/EntryControlCC.d.ts +5 -1
  23. package/build/cjs/cc/EntryControlCC.js +57 -2
  24. package/build/cjs/cc/EntryControlCC.js.map +2 -2
  25. package/build/cjs/cc/HumidityControlModeCC.d.ts +3 -1
  26. package/build/cjs/cc/HumidityControlModeCC.js +14 -2
  27. package/build/cjs/cc/HumidityControlModeCC.js.map +2 -2
  28. package/build/cjs/cc/HumidityControlOperatingStateCC.d.ts +3 -1
  29. package/build/cjs/cc/HumidityControlOperatingStateCC.js +4 -0
  30. package/build/cjs/cc/HumidityControlOperatingStateCC.js.map +2 -2
  31. package/build/cjs/cc/HumidityControlSetpointCC.d.ts +8 -4
  32. package/build/cjs/cc/HumidityControlSetpointCC.js +51 -8
  33. package/build/cjs/cc/HumidityControlSetpointCC.js.map +2 -2
  34. package/build/cjs/cc/IrrigationCC.d.ts +15 -9
  35. package/build/cjs/cc/IrrigationCC.js +260 -24
  36. package/build/cjs/cc/IrrigationCC.js.map +2 -2
  37. package/build/cjs/cc/LanguageCC.d.ts +2 -1
  38. package/build/cjs/cc/LanguageCC.js +18 -2
  39. package/build/cjs/cc/LanguageCC.js.map +2 -2
  40. package/build/cjs/cc/MultiChannelCC.d.ts +2 -1
  41. package/build/cjs/cc/MultiChannelCC.js +14 -2
  42. package/build/cjs/cc/MultiChannelCC.js.map +2 -2
  43. package/build/cjs/cc/SceneActuatorConfigurationCC.d.ts +3 -2
  44. package/build/cjs/cc/SceneActuatorConfigurationCC.js +38 -5
  45. package/build/cjs/cc/SceneActuatorConfigurationCC.js.map +2 -2
  46. package/build/cjs/cc/SceneControllerConfigurationCC.d.ts +3 -2
  47. package/build/cjs/cc/SceneControllerConfigurationCC.js +25 -4
  48. package/build/cjs/cc/SceneControllerConfigurationCC.js.map +2 -2
  49. package/build/cjs/cc/ThermostatFanModeCC.d.ts +3 -1
  50. package/build/cjs/cc/ThermostatFanModeCC.js +17 -2
  51. package/build/cjs/cc/ThermostatFanModeCC.js.map +2 -2
  52. package/build/cjs/cc/ThermostatFanStateCC.d.ts +3 -1
  53. package/build/cjs/cc/ThermostatFanStateCC.js +4 -0
  54. package/build/cjs/cc/ThermostatFanStateCC.js.map +2 -2
  55. package/build/cjs/cc/ThermostatModeCC.js +2 -2
  56. package/build/cjs/cc/ThermostatModeCC.js.map +2 -2
  57. package/build/cjs/cc/TimeCC.d.ts +1 -1
  58. package/build/cjs/cc/TimeCC.js +11 -2
  59. package/build/cjs/cc/TimeCC.js.map +2 -2
  60. package/build/cjs/cc/UserCodeCC.d.ts +2 -1
  61. package/build/cjs/cc/UserCodeCC.js +31 -2
  62. package/build/cjs/cc/UserCodeCC.js.map +2 -2
  63. package/build/cjs/cc/VersionCC.d.ts +1 -0
  64. package/build/cjs/cc/VersionCC.js +32 -0
  65. package/build/cjs/cc/VersionCC.js.map +2 -2
  66. package/build/cjs/cc/WakeUpCC.d.ts +2 -0
  67. package/build/cjs/cc/WakeUpCC.js +14 -0
  68. package/build/cjs/cc/WakeUpCC.js.map +2 -2
  69. package/build/cjs/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
  70. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js +30 -2
  71. package/build/cjs/cc/manufacturerProprietary/FibaroCC.js.map +2 -2
  72. package/build/esm/cc/AlarmSensorCC.d.ts +3 -1
  73. package/build/esm/cc/AlarmSensorCC.d.ts.map +1 -1
  74. package/build/esm/cc/AlarmSensorCC.js +25 -7
  75. package/build/esm/cc/AlarmSensorCC.js.map +1 -1
  76. package/build/esm/cc/BarrierOperatorCC.d.ts +6 -3
  77. package/build/esm/cc/BarrierOperatorCC.d.ts.map +1 -1
  78. package/build/esm/cc/BarrierOperatorCC.js +45 -18
  79. package/build/esm/cc/BarrierOperatorCC.js.map +1 -1
  80. package/build/esm/cc/CentralSceneCC.d.ts +4 -1
  81. package/build/esm/cc/CentralSceneCC.d.ts.map +1 -1
  82. package/build/esm/cc/CentralSceneCC.js +35 -6
  83. package/build/esm/cc/CentralSceneCC.js.map +1 -1
  84. package/build/esm/cc/ClimateControlScheduleCC.d.ts +6 -3
  85. package/build/esm/cc/ClimateControlScheduleCC.d.ts.map +1 -1
  86. package/build/esm/cc/ClimateControlScheduleCC.js +57 -16
  87. package/build/esm/cc/ClimateControlScheduleCC.js.map +1 -1
  88. package/build/esm/cc/ClockCC.d.ts +2 -1
  89. package/build/esm/cc/ClockCC.d.ts.map +1 -1
  90. package/build/esm/cc/ClockCC.js +20 -7
  91. package/build/esm/cc/ClockCC.js.map +1 -1
  92. package/build/esm/cc/ConfigurationCC.d.ts +3 -2
  93. package/build/esm/cc/ConfigurationCC.d.ts.map +1 -1
  94. package/build/esm/cc/ConfigurationCC.js +63 -12
  95. package/build/esm/cc/ConfigurationCC.js.map +1 -1
  96. package/build/esm/cc/DoorLockLoggingCC.d.ts +3 -1
  97. package/build/esm/cc/DoorLockLoggingCC.d.ts.map +1 -1
  98. package/build/esm/cc/DoorLockLoggingCC.js +39 -5
  99. package/build/esm/cc/DoorLockLoggingCC.js.map +1 -1
  100. package/build/esm/cc/EntryControlCC.d.ts +5 -1
  101. package/build/esm/cc/EntryControlCC.d.ts.map +1 -1
  102. package/build/esm/cc/EntryControlCC.js +64 -7
  103. package/build/esm/cc/EntryControlCC.js.map +1 -1
  104. package/build/esm/cc/HumidityControlModeCC.d.ts +3 -1
  105. package/build/esm/cc/HumidityControlModeCC.d.ts.map +1 -1
  106. package/build/esm/cc/HumidityControlModeCC.js +15 -7
  107. package/build/esm/cc/HumidityControlModeCC.js.map +1 -1
  108. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts +3 -1
  109. package/build/esm/cc/HumidityControlOperatingStateCC.d.ts.map +1 -1
  110. package/build/esm/cc/HumidityControlOperatingStateCC.js +5 -1
  111. package/build/esm/cc/HumidityControlOperatingStateCC.js.map +1 -1
  112. package/build/esm/cc/HumidityControlSetpointCC.d.ts +8 -4
  113. package/build/esm/cc/HumidityControlSetpointCC.d.ts.map +1 -1
  114. package/build/esm/cc/HumidityControlSetpointCC.js +52 -25
  115. package/build/esm/cc/HumidityControlSetpointCC.js.map +1 -1
  116. package/build/esm/cc/IrrigationCC.d.ts +15 -9
  117. package/build/esm/cc/IrrigationCC.d.ts.map +1 -1
  118. package/build/esm/cc/IrrigationCC.js +268 -61
  119. package/build/esm/cc/IrrigationCC.js.map +1 -1
  120. package/build/esm/cc/LanguageCC.d.ts +2 -1
  121. package/build/esm/cc/LanguageCC.d.ts.map +1 -1
  122. package/build/esm/cc/LanguageCC.js +18 -6
  123. package/build/esm/cc/LanguageCC.js.map +1 -1
  124. package/build/esm/cc/MultiChannelCC.d.ts +2 -1
  125. package/build/esm/cc/MultiChannelCC.d.ts.map +1 -1
  126. package/build/esm/cc/MultiChannelCC.js +15 -7
  127. package/build/esm/cc/MultiChannelCC.js.map +1 -1
  128. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts +3 -2
  129. package/build/esm/cc/SceneActuatorConfigurationCC.d.ts.map +1 -1
  130. package/build/esm/cc/SceneActuatorConfigurationCC.js +39 -13
  131. package/build/esm/cc/SceneActuatorConfigurationCC.js.map +1 -1
  132. package/build/esm/cc/SceneControllerConfigurationCC.d.ts +3 -2
  133. package/build/esm/cc/SceneControllerConfigurationCC.d.ts.map +1 -1
  134. package/build/esm/cc/SceneControllerConfigurationCC.js +25 -12
  135. package/build/esm/cc/SceneControllerConfigurationCC.js.map +1 -1
  136. package/build/esm/cc/ThermostatFanModeCC.d.ts +3 -1
  137. package/build/esm/cc/ThermostatFanModeCC.d.ts.map +1 -1
  138. package/build/esm/cc/ThermostatFanModeCC.js +18 -7
  139. package/build/esm/cc/ThermostatFanModeCC.js.map +1 -1
  140. package/build/esm/cc/ThermostatFanStateCC.d.ts +3 -1
  141. package/build/esm/cc/ThermostatFanStateCC.d.ts.map +1 -1
  142. package/build/esm/cc/ThermostatFanStateCC.js +5 -1
  143. package/build/esm/cc/ThermostatFanStateCC.js.map +1 -1
  144. package/build/esm/cc/ThermostatModeCC.js +2 -2
  145. package/build/esm/cc/ThermostatModeCC.js.map +1 -1
  146. package/build/esm/cc/TimeCC.d.ts +1 -1
  147. package/build/esm/cc/TimeCC.d.ts.map +1 -1
  148. package/build/esm/cc/TimeCC.js +12 -7
  149. package/build/esm/cc/TimeCC.js.map +1 -1
  150. package/build/esm/cc/UserCodeCC.d.ts +2 -1
  151. package/build/esm/cc/UserCodeCC.d.ts.map +1 -1
  152. package/build/esm/cc/UserCodeCC.js +31 -6
  153. package/build/esm/cc/UserCodeCC.js.map +1 -1
  154. package/build/esm/cc/VersionCC.d.ts +1 -0
  155. package/build/esm/cc/VersionCC.d.ts.map +1 -1
  156. package/build/esm/cc/VersionCC.js +34 -0
  157. package/build/esm/cc/VersionCC.js.map +1 -1
  158. package/build/esm/cc/WakeUpCC.d.ts +2 -0
  159. package/build/esm/cc/WakeUpCC.d.ts.map +1 -1
  160. package/build/esm/cc/WakeUpCC.js +14 -0
  161. package/build/esm/cc/WakeUpCC.js.map +1 -1
  162. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts +2 -1
  163. package/build/esm/cc/manufacturerProprietary/FibaroCC.d.ts.map +1 -1
  164. package/build/esm/cc/manufacturerProprietary/FibaroCC.js +34 -4
  165. package/build/esm/cc/manufacturerProprietary/FibaroCC.js.map +1 -1
  166. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/HumidityControlModeCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./HumidityControlModeCC._validateArgs.js\";\nconst { validateArgs_HumidityControlModeCCAPI_set } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type SupervisionResult, ValueMetadata, type WithAddress, ZWaveError, ZWaveErrorCodes, enumValuesToMetadataStates, logList, logText, parseBitMask, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { HumidityControlMode, HumidityControlModeCommand, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlModeCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlModeCCValues };\n@API(CommandClasses[\"Humidity Control Mode\"])\nexport class HumidityControlModeCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlModeCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlModeCommand.Get:\n case HumidityControlModeCommand.SupportedGet:\n return this.isSinglecast();\n case HumidityControlModeCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: HumidityControlModeCCAPI, { property }, value) {\n if (property === \"mode\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n const result = await this.set(value);\n // Verify the change after a delay, unless the command was supervised and successful\n if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n this.schedulePoll({ property }, value);\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlModeCCAPI, { property }) {\n switch (property) {\n case \"mode\":\n return this.get();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async get(): Promise<MaybeNotKnown<HumidityControlMode>> {\n this.assertSupportsCommand(HumidityControlModeCommand, HumidityControlModeCommand.Get);\n const cc = new HumidityControlModeCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlModeCCReport>(cc, this.commandOptions);\n if (response) {\n return response?.mode;\n }\n }\n @validateArgs_HumidityControlModeCCAPI_set()\n public async set(mode: HumidityControlMode): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(HumidityControlModeCommand, HumidityControlModeCommand.Set);\n const cc = new HumidityControlModeCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n mode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getSupportedModes(): Promise<MaybeNotKnown<readonly HumidityControlMode[]>> {\n this.assertSupportsCommand(HumidityControlModeCommand, HumidityControlModeCommand.SupportedGet);\n const cc = new HumidityControlModeCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlModeCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedModes;\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Mode\"])\n@implementedVersion(1)\n@ccValues(HumidityControlModeCCValues)\nexport class HumidityControlModeCC extends CommandClass {\n declare ccCommand: HumidityControlModeCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Mode\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // First query the possible modes to set the metadata\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying supported humidity control modes...\",\n direction: \"outbound\",\n });\n const supportedModes = await api.getSupportedModes();\n if (supportedModes) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"received supported humidity control modes:\", {\n nested: logList(supportedModes.map((mode) => getEnumMemberName(HumidityControlMode, mode))),\n }),\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported humidity control modes timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Mode\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n // Query the current status\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying current humidity control mode...\",\n direction: \"outbound\",\n });\n const currentMode = await api.get();\n if (currentMode) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"received current humidity control mode: \"\n + getEnumMemberName(HumidityControlMode, currentMode),\n direction: \"inbound\",\n });\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlModeCCSetOptions {\n mode: HumidityControlMode;\n}\n@CCCommand(HumidityControlModeCommand.Set)\n@useSupervision()\nexport class HumidityControlModeCCSet extends HumidityControlModeCC {\n public constructor(options: WithAddress<HumidityControlModeCCSetOptions>) {\n super(options);\n this.mode = options.mode;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlModeCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlModeCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public mode: HumidityControlMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.mode & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n mode: getEnumMemberName(HumidityControlMode, this.mode),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlModeCCReportOptions {\n mode: HumidityControlMode;\n}\n@CCCommand(HumidityControlModeCommand.Report)\n@ccValueProperty(\"mode\", HumidityControlModeCCValues.mode)\nexport class HumidityControlModeCCReport extends HumidityControlModeCC {\n public constructor(options: WithAddress<HumidityControlModeCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.mode = options.mode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlModeCCReport {\n validatePayload(raw.payload.length >= 1);\n const mode: HumidityControlMode = raw.payload[0] & 0b1111;\n return new this({\n nodeId: ctx.sourceNodeId,\n mode,\n });\n }\n public readonly mode: HumidityControlMode;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n mode: getEnumMemberName(HumidityControlMode, this.mode),\n },\n };\n }\n}\n@CCCommand(HumidityControlModeCommand.Get)\n@expectedCCResponse(HumidityControlModeCCReport)\nexport class HumidityControlModeCCGet extends HumidityControlModeCC {\n}\n// @publicAPI\nexport interface HumidityControlModeCCSupportedReportOptions {\n supportedModes: HumidityControlMode[];\n}\n@CCCommand(HumidityControlModeCommand.SupportedReport)\n@ccValueProperty(\"supportedModes\", HumidityControlModeCCValues.supportedModes)\nexport class HumidityControlModeCCSupportedReport extends HumidityControlModeCC {\n public constructor(options: WithAddress<HumidityControlModeCCSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedModes = options.supportedModes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlModeCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedModes: HumidityControlMode[] = parseBitMask(raw.payload, HumidityControlMode.Off);\n if (!supportedModes.includes(HumidityControlMode.Off)) {\n supportedModes.unshift(HumidityControlMode.Off);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedModes,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Use this information to create the metadata for the mode property\n const modeValue = HumidityControlModeCCValues.mode;\n this.setMetadata(ctx, modeValue, {\n ...modeValue.meta,\n states: enumValuesToMetadataStates(HumidityControlMode, this.supportedModes),\n });\n return true;\n }\n public supportedModes: HumidityControlMode[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported modes\": logList(this.supportedModes.map((mode) => getEnumMemberName(HumidityControlMode, mode))),\n },\n };\n }\n}\n@CCCommand(HumidityControlModeCommand.SupportedGet)\n@expectedCCResponse(HumidityControlModeCCSupportedReport)\nexport class HumidityControlModeCCSupportedGet extends HumidityControlModeCC {\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAA+S;AAC/S,oBAAyC;AACzC,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAiI;AAEjI,mBAAiE;AAEjE,gCAA4C;AAT5C,MAAM,EAAE,0CAAyC,IAAK;IAYzC,4BAAwB,MAAA;8BADpC,mCAAI,2BAAe,uBAAuB,CAAC,CAAC;;;;oBACC;;;gDAAA,YAAK;WAAA;;;;;;;;yBAkD9C,0CAAyC,CAAE;AAC5C,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAnDpB,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACF,gBAAgB,KAA+B;AAClD,cAAQ,KAAK;QACT,KAAK,wCAA2B;QAChC,KAAK,wCAA2B;AAC5B,iBAAO,KAAK,aAAY;QAC5B,KAAK,wCAA2B;AAC5B,iBAAO;MACf;AACA,aAAO,MAAM,gBAAgB,GAAG;IACpC;IACA,KAAwB,oBAAS,IAAC;AAC9B,aAAO,eAAgD,EAAE,SAAQ,GAAI,OAAK;AACtE,YAAI,aAAa,QAAQ;AACrB,cAAI,OAAO,UAAU,UAAU;AAC3B,gDAAoB,KAAK,MAAM,UAAU,UAAU,OAAO,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AAe,QAAQ,iCAAoB,GAAG;MAClD;AACA,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;OACH;IACL;IACO,cAAc,KAAyB;AAC1C,UAAI,CAAC,MAAM,cAAc,GAAG;AACxB,eAAO;AAEX,YAAM,YAAY,sDAA4B;AAC9C,WAAK,YAAY,KAAK,WAAW;QAC7B,GAAG,UAAU;QACb,YAAQ,wCAA2B,kCAAqB,KAAK,cAAc;OAC9E;AACD,aAAO;IACX;IACO;IACA,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,uBAAmB,qBAAQ,KAAK,eAAe,IAAI,CAAC,aAAS,iCAAkB,kCAAqB,IAAI,CAAC,CAAC;;;IAGtH;;;;IAIS,qCAAiC,MAAA;8BAF7C,yCAAU,wCAA2B,YAAY,OACjD,kDAAmB,oCAAoC,CAAC;;;;oBACF;yDAAA,YAAqB;WAAA;;;;;;;;AAA5E,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./HumidityControlModeCC._validateArgs.js\";\nconst { validateArgs_HumidityControlModeCCAPI_set } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type SupervisionResult, ValueMetadata, type WithAddress, encodeBitMask, enumValuesToMetadataStates, logList, logText, parseBitMask, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { HumidityControlMode, HumidityControlModeCommand, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlModeCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlModeCCValues };\n@API(CommandClasses[\"Humidity Control Mode\"])\nexport class HumidityControlModeCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlModeCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlModeCommand.Get:\n case HumidityControlModeCommand.SupportedGet:\n return this.isSinglecast();\n case HumidityControlModeCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: HumidityControlModeCCAPI, { property }, value) {\n if (property === \"mode\") {\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n }\n else {\n throwUnsupportedProperty(this.ccId, property);\n }\n const result = await this.set(value);\n // Verify the change after a delay, unless the command was supervised and successful\n if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n this.schedulePoll({ property }, value);\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlModeCCAPI, { property }) {\n switch (property) {\n case \"mode\":\n return this.get();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async get(): Promise<MaybeNotKnown<HumidityControlMode>> {\n this.assertSupportsCommand(HumidityControlModeCommand, HumidityControlModeCommand.Get);\n const cc = new HumidityControlModeCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlModeCCReport>(cc, this.commandOptions);\n if (response) {\n return response?.mode;\n }\n }\n @validateArgs_HumidityControlModeCCAPI_set()\n public async set(mode: HumidityControlMode): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(HumidityControlModeCommand, HumidityControlModeCommand.Set);\n const cc = new HumidityControlModeCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n mode,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n public async getSupportedModes(): Promise<MaybeNotKnown<readonly HumidityControlMode[]>> {\n this.assertSupportsCommand(HumidityControlModeCommand, HumidityControlModeCommand.SupportedGet);\n const cc = new HumidityControlModeCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlModeCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedModes;\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Mode\"])\n@implementedVersion(1)\n@ccValues(HumidityControlModeCCValues)\nexport class HumidityControlModeCC extends CommandClass {\n declare ccCommand: HumidityControlModeCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Mode\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // First query the possible modes to set the metadata\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying supported humidity control modes...\",\n direction: \"outbound\",\n });\n const supportedModes = await api.getSupportedModes();\n if (supportedModes) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"received supported humidity control modes:\", {\n nested: logList(supportedModes.map((mode) => getEnumMemberName(HumidityControlMode, mode))),\n }),\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported humidity control modes timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Mode\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n // Query the current status\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying current humidity control mode...\",\n direction: \"outbound\",\n });\n const currentMode = await api.get();\n if (currentMode) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"received current humidity control mode: \"\n + getEnumMemberName(HumidityControlMode, currentMode),\n direction: \"inbound\",\n });\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlModeCCSetOptions {\n mode: HumidityControlMode;\n}\n@CCCommand(HumidityControlModeCommand.Set)\n@useSupervision()\nexport class HumidityControlModeCCSet extends HumidityControlModeCC {\n public constructor(options: WithAddress<HumidityControlModeCCSetOptions>) {\n super(options);\n this.mode = options.mode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlModeCCSet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n mode: raw.payload[0] & 0b1111,\n });\n }\n public mode: HumidityControlMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.mode & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n mode: getEnumMemberName(HumidityControlMode, this.mode),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlModeCCReportOptions {\n mode: HumidityControlMode;\n}\n@CCCommand(HumidityControlModeCommand.Report)\n@ccValueProperty(\"mode\", HumidityControlModeCCValues.mode)\nexport class HumidityControlModeCCReport extends HumidityControlModeCC {\n public constructor(options: WithAddress<HumidityControlModeCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.mode = options.mode;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlModeCCReport {\n validatePayload(raw.payload.length >= 1);\n const mode: HumidityControlMode = raw.payload[0] & 0b1111;\n return new this({\n nodeId: ctx.sourceNodeId,\n mode,\n });\n }\n public readonly mode: HumidityControlMode;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.mode & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n mode: getEnumMemberName(HumidityControlMode, this.mode),\n },\n };\n }\n}\n@CCCommand(HumidityControlModeCommand.Get)\n@expectedCCResponse(HumidityControlModeCCReport)\nexport class HumidityControlModeCCGet extends HumidityControlModeCC {\n}\n// @publicAPI\nexport interface HumidityControlModeCCSupportedReportOptions {\n supportedModes: HumidityControlMode[];\n}\n@CCCommand(HumidityControlModeCommand.SupportedReport)\n@ccValueProperty(\"supportedModes\", HumidityControlModeCCValues.supportedModes)\nexport class HumidityControlModeCCSupportedReport extends HumidityControlModeCC {\n public constructor(options: WithAddress<HumidityControlModeCCSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedModes = options.supportedModes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlModeCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedModes: HumidityControlMode[] = parseBitMask(raw.payload, HumidityControlMode.Off);\n if (!supportedModes.includes(HumidityControlMode.Off)) {\n supportedModes.unshift(HumidityControlMode.Off);\n }\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedModes,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Use this information to create the metadata for the mode property\n const modeValue = HumidityControlModeCCValues.mode;\n this.setMetadata(ctx, modeValue, {\n ...modeValue.meta,\n states: enumValuesToMetadataStates(HumidityControlMode, this.supportedModes),\n });\n return true;\n }\n public supportedModes: HumidityControlMode[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = encodeBitMask(this.supportedModes, undefined, HumidityControlMode.Off);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported modes\": logList(this.supportedModes.map((mode) => getEnumMemberName(HumidityControlMode, mode))),\n },\n };\n }\n}\n@CCCommand(HumidityControlModeCommand.SupportedGet)\n@expectedCCResponse(HumidityControlModeCCSupportedReport)\nexport class HumidityControlModeCCSupportedGet extends HumidityControlModeCC {\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAAiS;AACjS,oBAAyC;AACzC,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAiI;AAEjI,mBAAiE;AAEjE,gCAA4C;AAT5C,MAAM,EAAE,0CAAyC,IAAK;IAYzC,4BAAwB,MAAA;8BADpC,mCAAI,2BAAe,uBAAuB,CAAC,CAAC;;;;oBACC;;;gDAAA,YAAK;WAAA;;;;;;;;yBAkD9C,0CAAyC,CAAE;AAC5C,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,UAAA,UAAA,GAAA,MAAA,0BAAA;AAnDpB,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACF,gBAAgB,KAA+B;AAClD,cAAQ,KAAK;QACT,KAAK,wCAA2B;QAChC,KAAK,wCAA2B;AAC5B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AAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
6
6
  "names": []
7
7
  }
@@ -1,8 +1,9 @@
1
1
  import { type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, type WithAddress } from "@zwave-js/core";
2
+ import { Bytes } from "@zwave-js/shared";
2
3
  import { CCAPI, POLL_VALUE, type PollValueImplementation } from "../lib/API.js";
3
4
  import { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions } from "../lib/CommandClass.js";
4
5
  import { HumidityControlOperatingState, HumidityControlOperatingStateCommand } from "../lib/_Types.js";
5
- import type { CCParsingContext } from "../lib/traits.js";
6
+ import type { CCEncodingContext, CCParsingContext } from "../lib/traits.js";
6
7
  import { HumidityControlOperatingStateCCValues } from "./_CCValues.generated.js";
7
8
  export { HumidityControlOperatingStateCCValues };
8
9
  export declare class HumidityControlOperatingStateCCAPI extends CCAPI {
@@ -22,6 +23,7 @@ export declare class HumidityControlOperatingStateCCReport extends HumidityContr
22
23
  constructor(options: WithAddress<HumidityControlOperatingStateCCReportOptions>);
23
24
  static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlOperatingStateCCReport;
24
25
  readonly state: HumidityControlOperatingState;
26
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
25
27
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
26
28
  }
27
29
  export declare class HumidityControlOperatingStateCCGet extends HumidityControlOperatingStateCC {
@@ -172,6 +172,10 @@ let HumidityControlOperatingStateCCReport = (() => {
172
172
  });
173
173
  }
174
174
  state;
175
+ serialize(ctx) {
176
+ this.payload = import_shared.Bytes.from([this.state & 15]);
177
+ return super.serialize(ctx);
178
+ }
175
179
  toLogEntry(ctx) {
176
180
  return {
177
181
  ...super.toLogEntry(ctx),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/HumidityControlOperatingStateCC.ts"],
4
- "sourcesContent": ["import { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, ValueMetadata, type WithAddress, enumValuesToMetadataStates, validatePayload, } from \"@zwave-js/core\";\nimport { getEnumMemberName } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, throwUnsupportedProperty, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { HumidityControlOperatingState, HumidityControlOperatingStateCommand, } from \"../lib/_Types.js\";\nimport type { CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlOperatingStateCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlOperatingStateCCValues };\n@API(CommandClasses[\"Humidity Control Operating State\"])\nexport class HumidityControlOperatingStateCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlOperatingStateCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlOperatingStateCommand.Get:\n return this.isSinglecast();\n }\n return super.supportsCommand(cmd);\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlOperatingStateCCAPI, { property }) {\n switch (property) {\n case \"state\":\n return this.get();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async get(): Promise<HumidityControlOperatingState | undefined> {\n this.assertSupportsCommand(HumidityControlOperatingStateCommand, HumidityControlOperatingStateCommand.Get);\n const cc = new HumidityControlOperatingStateCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlOperatingStateCCReport>(cc, this.commandOptions);\n if (response) {\n return response?.state;\n }\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Operating State\"])\n@implementedVersion(1)\n@ccValues(HumidityControlOperatingStateCCValues)\nexport class HumidityControlOperatingStateCC extends CommandClass {\n declare ccCommand: HumidityControlOperatingStateCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Operating State\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n // Query the current status\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying current humidity control operating state...\",\n direction: \"outbound\",\n });\n const currentStatus = await api.get();\n if (currentStatus) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"received current humidity control operating state: \"\n + getEnumMemberName(HumidityControlOperatingState, currentStatus),\n direction: \"inbound\",\n });\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlOperatingStateCCReportOptions {\n state: HumidityControlOperatingState;\n}\n@CCCommand(HumidityControlOperatingStateCommand.Report)\n@ccValueProperty(\"state\", HumidityControlOperatingStateCCValues.state)\nexport class HumidityControlOperatingStateCCReport extends HumidityControlOperatingStateCC {\n public constructor(options: WithAddress<HumidityControlOperatingStateCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.state = options.state;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlOperatingStateCCReport {\n validatePayload(raw.payload.length >= 1);\n const state: HumidityControlOperatingState = raw.payload[0] & 0b1111;\n return new this({\n nodeId: ctx.sourceNodeId,\n state,\n });\n }\n public readonly state: HumidityControlOperatingState;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n state: getEnumMemberName(HumidityControlOperatingState, this.state),\n },\n };\n }\n}\n@CCCommand(HumidityControlOperatingStateCommand.Get)\n@expectedCCResponse(HumidityControlOperatingStateCCReport)\nexport class HumidityControlOperatingStateCCGet extends HumidityControlOperatingStateCC {\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAA8L;AAC9L,oBAAkC;AAClC,iBAA2F;AAC3F,0BAAuH;AACvH,oCAAiH;AAEjH,mBAAqF;AAErF,gCAAsD;IAGzC,sCAAkC,MAAA;8BAD9C,mCAAI,2BAAe,kCAAkC,CAAC,CAAC;;;;oBACA;0DAAA,YAAK;WAAA;;;;;;;;AAA7D,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACF,gBAAgB,KAAyC;AAC5D,cAAQ,KAAK;QACT,KAAK,kDAAqC;AACtC,iBAAO,KAAK,aAAY;MAChC;AACA,aAAO,MAAM,gBAAgB,GAAG;IACpC;IACA,KAAe,qBAAU,IAAC;AACtB,aAAO,eAA0D,EAAE,SAAQ,GAAE;AACzE,gBAAQ,UAAU;UACd,KAAK;AACD,mBAAO,KAAK,IAAG;UACnB;AACI,qDAAyB,KAAK,MAAM,QAAQ;QACpD;MACJ;IACJ;IACO,MAAM,MAAG;AACZ,WAAK,sBAAsB,mDAAsC,kDAAqC,GAAG;AACzG,YAAM,KAAK,IAAI,mCAAmC;QAC9C,QAAQ,KAAK,SAAS;QACtB,eAAe,KAAK,SAAS;OAChC;AACD,YAAM,WAAW,MAAM,KAAK,KAAK,YAAmD,IAAI,KAAK,cAAc;AAC3G,UAAI,UAAU;AACV,eAAO,UAAU;MACrB;IACJ;;;;IAKS,mCAA+B,MAAA;8BAH3C,4CAAa,2BAAe,kCAA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,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;IACT,YAAmB,SAAkE;AACjF,YAAM,OAAO;AAEb,WAAK,QAAQ,QAAQ;IACzB;IACO,OAAO,KAAK,KAAY,KAAqB;AAChD,uCAAgB,IAAI,QAAQ,UAAU,CAAC;AACvC,YAAM,QAAuC,IAAI,QAAQ,CAAC,IAAI;AAC9D,aAAO,IAAI,KAAK;QACZ,QAAQ,IAAI;QACZ;OACH;IACL;IACgB;IACT,WAAW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,WAAO,iCAAkB,4CAA+B,KAAK,KAAK;;;IAG9E;;;;IAIS,sCAAkC,MAAA;8BAF9C,yCAAU,kDAAqC,GAAG,OAClD,kDAAmB,qCAAqC,CAAC;;;;oBACF;0DAAA,YAA+B;WAAA;;;;;;;;AAAvF,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
4
+ "sourcesContent": ["import { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, ValueMetadata, type WithAddress, enumValuesToMetadataStates, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, throwUnsupportedProperty, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { HumidityControlOperatingState, HumidityControlOperatingStateCommand, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlOperatingStateCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlOperatingStateCCValues };\n@API(CommandClasses[\"Humidity Control Operating State\"])\nexport class HumidityControlOperatingStateCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlOperatingStateCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlOperatingStateCommand.Get:\n return this.isSinglecast();\n }\n return super.supportsCommand(cmd);\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlOperatingStateCCAPI, { property }) {\n switch (property) {\n case \"state\":\n return this.get();\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n public async get(): Promise<HumidityControlOperatingState | undefined> {\n this.assertSupportsCommand(HumidityControlOperatingStateCommand, HumidityControlOperatingStateCommand.Get);\n const cc = new HumidityControlOperatingStateCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlOperatingStateCCReport>(cc, this.commandOptions);\n if (response) {\n return response?.state;\n }\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Operating State\"])\n@implementedVersion(1)\n@ccValues(HumidityControlOperatingStateCCValues)\nexport class HumidityControlOperatingStateCC extends CommandClass {\n declare ccCommand: HumidityControlOperatingStateCommand;\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Operating State\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n // Query the current status\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"querying current humidity control operating state...\",\n direction: \"outbound\",\n });\n const currentStatus = await api.get();\n if (currentStatus) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"received current humidity control operating state: \"\n + getEnumMemberName(HumidityControlOperatingState, currentStatus),\n direction: \"inbound\",\n });\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlOperatingStateCCReportOptions {\n state: HumidityControlOperatingState;\n}\n@CCCommand(HumidityControlOperatingStateCommand.Report)\n@ccValueProperty(\"state\", HumidityControlOperatingStateCCValues.state)\nexport class HumidityControlOperatingStateCCReport extends HumidityControlOperatingStateCC {\n public constructor(options: WithAddress<HumidityControlOperatingStateCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.state = options.state;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlOperatingStateCCReport {\n validatePayload(raw.payload.length >= 1);\n const state: HumidityControlOperatingState = raw.payload[0] & 0b1111;\n return new this({\n nodeId: ctx.sourceNodeId,\n state,\n });\n }\n public readonly state: HumidityControlOperatingState;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.state & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n state: getEnumMemberName(HumidityControlOperatingState, this.state),\n },\n };\n }\n}\n@CCCommand(HumidityControlOperatingStateCommand.Get)\n@expectedCCResponse(HumidityControlOperatingStateCCReport)\nexport class HumidityControlOperatingStateCCGet extends HumidityControlOperatingStateCC {\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kBAA8L;AAC9L,oBAAyC;AACzC,iBAA2F;AAC3F,0BAAuH;AACvH,oCAAiH;AAEjH,mBAAqF;AAErF,gCAAsD;IAGzC,sCAAkC,MAAA;8BAD9C,mCAAI,2BAAe,kCAAkC,CAAC,CAAC;;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AW,KAAgB;AAC9B,aAAO;QACH,GAAG,MAAM,WAAW,GAAG;QACvB,SAAS;UACL,WAAO,iCAAkB,4CAA+B,KAAK,KAAK;;;IAG9E;;;;IAIS,sCAAkC,MAAA;8BAF9C,yCAAU,kDAAqC,GAAG,OAClD,kDAAmB,qCAAqC,CAAC;;;;oBACF;0DAAA,YAA+B;WAAA;;;;;;;;AAAvF,qCAAA,MAAA,mBAAA,EAAA,OAAA,WAAA,GAAA,kBAAA,EAAA,MAAA,SAAA,MAAA,WAAA,MAAA,UAAA,UAAA,GAAA,MAAA,uBAAA;;;AAAa,0CAAA,YAAA,uBAAA;;;;;",
6
6
  "names": []
7
7
  }
@@ -29,7 +29,7 @@ export interface HumidityControlSetpointCCSetOptions {
29
29
  }
30
30
  export declare class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {
31
31
  constructor(options: WithAddress<HumidityControlSetpointCCSetOptions>);
32
- static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCSet;
32
+ static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSet;
33
33
  setpointType: HumidityControlSetpointType;
34
34
  value: number;
35
35
  scale: number;
@@ -48,6 +48,7 @@ export declare class HumidityControlSetpointCCReport extends HumidityControlSetp
48
48
  type: HumidityControlSetpointType;
49
49
  scale: number;
50
50
  value: number;
51
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
51
52
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
52
53
  }
53
54
  export interface HumidityControlSetpointCCGetOptions {
@@ -55,7 +56,7 @@ export interface HumidityControlSetpointCCGetOptions {
55
56
  }
56
57
  export declare class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {
57
58
  constructor(options: WithAddress<HumidityControlSetpointCCGetOptions>);
58
- static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCGet;
59
+ static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCGet;
59
60
  setpointType: HumidityControlSetpointType;
60
61
  serialize(ctx: CCEncodingContext): Promise<Bytes>;
61
62
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
@@ -67,6 +68,7 @@ export declare class HumidityControlSetpointCCSupportedReport extends HumidityCo
67
68
  constructor(options: WithAddress<HumidityControlSetpointCCSupportedReportOptions>);
68
69
  static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSupportedReport;
69
70
  readonly supportedSetpointTypes: readonly HumidityControlSetpointType[];
71
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
70
72
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
71
73
  }
72
74
  export declare class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {
@@ -78,6 +80,7 @@ export declare class HumidityControlSetpointCCScaleSupportedReport extends Humid
78
80
  constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedReportOptions>);
79
81
  static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedReport;
80
82
  readonly supportedScales: readonly number[];
83
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
81
84
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
82
85
  }
83
86
  export interface HumidityControlSetpointCCScaleSupportedGetOptions {
@@ -85,7 +88,7 @@ export interface HumidityControlSetpointCCScaleSupportedGetOptions {
85
88
  }
86
89
  export declare class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {
87
90
  constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedGetOptions>);
88
- static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedGet;
91
+ static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedGet;
89
92
  setpointType: HumidityControlSetpointType;
90
93
  serialize(ctx: CCEncodingContext): Promise<Bytes>;
91
94
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
@@ -106,6 +109,7 @@ export declare class HumidityControlSetpointCCCapabilitiesReport extends Humidit
106
109
  maxValue: number;
107
110
  minValueScale: number;
108
111
  maxValueScale: number;
112
+ serialize(ctx: CCEncodingContext): Promise<Bytes>;
109
113
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
110
114
  }
111
115
  export interface HumidityControlSetpointCCCapabilitiesGetOptions {
@@ -113,7 +117,7 @@ export interface HumidityControlSetpointCCCapabilitiesGetOptions {
113
117
  }
114
118
  export declare class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {
115
119
  constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesGetOptions>);
116
- static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesGet;
120
+ static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesGet;
117
121
  setpointType: HumidityControlSetpointType;
118
122
  serialize(ctx: CCEncodingContext): Promise<Bytes>;
119
123
  toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry;
@@ -379,8 +379,16 @@ let HumidityControlSetpointCCSet = (() => {
379
379
  this.value = options.value;
380
380
  this.scale = options.scale;
381
381
  }
382
- static from(_raw, _ctx) {
383
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
382
+ static from(raw, ctx) {
383
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
384
+ const setpointType = raw.payload[0] & 15;
385
+ const { value, scale } = (0, import_core.parseFloatWithScale)(raw.payload.subarray(1));
386
+ return new this({
387
+ nodeId: ctx.sourceNodeId,
388
+ setpointType,
389
+ value,
390
+ scale
391
+ });
384
392
  }
385
393
  setpointType;
386
394
  value;
@@ -469,6 +477,13 @@ let HumidityControlSetpointCCReport = (() => {
469
477
  type;
470
478
  scale;
471
479
  value;
480
+ serialize(ctx) {
481
+ this.payload = import_shared.Bytes.concat([
482
+ [this.type & 15],
483
+ (0, import_core.encodeFloatWithScale)(this.value, this.scale)
484
+ ]);
485
+ return super.serialize(ctx);
486
+ }
472
487
  toLogEntry(ctx) {
473
488
  const scale = getScale(this.scale);
474
489
  return {
@@ -510,8 +525,12 @@ let HumidityControlSetpointCCGet = (() => {
510
525
  super(options);
511
526
  this.setpointType = options.setpointType;
512
527
  }
513
- static from(_raw, _ctx) {
514
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
528
+ static from(raw, ctx) {
529
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
530
+ return new this({
531
+ nodeId: ctx.sourceNodeId,
532
+ setpointType: raw.payload[0] & 15
533
+ });
515
534
  }
516
535
  setpointType;
517
536
  serialize(ctx) {
@@ -562,6 +581,10 @@ let HumidityControlSetpointCCSupportedReport = (() => {
562
581
  });
563
582
  }
564
583
  supportedSetpointTypes;
584
+ serialize(ctx) {
585
+ this.payload = (0, import_core.encodeBitMask)(this.supportedSetpointTypes, void 0, import_Types.HumidityControlSetpointType["N/A"]);
586
+ return super.serialize(ctx);
587
+ }
565
588
  toLogEntry(ctx) {
566
589
  return {
567
590
  ...super.toLogEntry(ctx),
@@ -629,6 +652,10 @@ let HumidityControlSetpointCCScaleSupportedReport = (() => {
629
652
  });
630
653
  }
631
654
  supportedScales;
655
+ serialize(ctx) {
656
+ this.payload = (0, import_core.encodeBitMask)(this.supportedScales, 3, 0);
657
+ return super.serialize(ctx);
658
+ }
632
659
  toLogEntry(ctx) {
633
660
  const supportedScales = this.supportedScales.map((scale) => getScale(scale));
634
661
  return {
@@ -665,8 +692,12 @@ let HumidityControlSetpointCCScaleSupportedGet = (() => {
665
692
  super(options);
666
693
  this.setpointType = options.setpointType;
667
694
  }
668
- static from(_raw, _ctx) {
669
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
695
+ static from(raw, ctx) {
696
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
697
+ return new this({
698
+ nodeId: ctx.sourceNodeId,
699
+ setpointType: raw.payload[0] & 15
700
+ });
670
701
  }
671
702
  setpointType;
672
703
  serialize(ctx) {
@@ -743,6 +774,14 @@ let HumidityControlSetpointCCCapabilitiesReport = (() => {
743
774
  maxValue;
744
775
  minValueScale;
745
776
  maxValueScale;
777
+ serialize(ctx) {
778
+ this.payload = import_shared.Bytes.concat([
779
+ [this.type & 15],
780
+ (0, import_core.encodeFloatWithScale)(this.minValue, this.minValueScale),
781
+ (0, import_core.encodeFloatWithScale)(this.maxValue, this.maxValueScale)
782
+ ]);
783
+ return super.serialize(ctx);
784
+ }
746
785
  toLogEntry(ctx) {
747
786
  const minValueScale = getScale(this.minValueScale);
748
787
  const maxValueScale = getScale(this.maxValueScale);
@@ -782,8 +821,12 @@ let HumidityControlSetpointCCCapabilitiesGet = (() => {
782
821
  super(options);
783
822
  this.setpointType = options.setpointType;
784
823
  }
785
- static from(_raw, _ctx) {
786
- throw new import_core.ZWaveError(`${this.name}: deserialization not implemented`, import_core.ZWaveErrorCodes.Deserialization_NotImplemented);
824
+ static from(raw, ctx) {
825
+ (0, import_core.validatePayload)(raw.payload.length >= 1);
826
+ return new this({
827
+ nodeId: ctx.sourceNodeId,
828
+ setpointType: raw.payload[0] & 15
829
+ });
787
830
  }
788
831
  setpointType;
789
832
  serialize(ctx) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src_gen/cc/HumidityControlSetpointCC.ts"],
4
- "sourcesContent": ["import * as __validateArgs from \"./HumidityControlSetpointCC._validateArgs.js\";\nconst { validateArgs_HumidityControlSetpointCCAPI_get, validateArgs_HumidityControlSetpointCCAPI_set, validateArgs_HumidityControlSetpointCCAPI_getCapabilities, validateArgs_HumidityControlSetpointCCAPI_getSupportedScales } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type Scale, type SupervisionResult, ValueMetadata, type ValueMetadataNumeric, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeFloatWithScale, getNamedScale, getUnknownScale, logDict, logList, logText, parseBitMask, parseFloatWithScale, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type HumidityControlSetpointCapabilities, HumidityControlSetpointCommand, HumidityControlSetpointType, type HumidityControlSetpointValue, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlSetpointCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlSetpointCCValues };\nfunction getScale(scale: number): Scale {\n return getNamedScale(\"humidity\", scale as any) ?? getUnknownScale(scale);\n}\nfunction getSetpointUnit(scale: number): string {\n return getScale(scale).unit ?? \"\";\n}\n@API(CommandClasses[\"Humidity Control Setpoint\"])\nexport class HumidityControlSetpointCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlSetpointCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlSetpointCommand.Get:\n case HumidityControlSetpointCommand.SupportedGet:\n case HumidityControlSetpointCommand.CapabilitiesGet:\n return this.isSinglecast();\n case HumidityControlSetpointCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }, value) {\n if (property !== \"setpoint\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n const scaleValueId = HumidityControlSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index);\n const preferredScale = this.tryGetValueDB()?.getValue<number>(scaleValueId);\n const result = await this.set(propertyKey, value, preferredScale ?? 0);\n // Verify the change after a delay, unless the command was supervised and successful\n if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n this.schedulePoll({ property, propertyKey }, value);\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"setpoint\":\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n return (await this.get(propertyKey))?.value;\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_get()\n public async get(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointValue>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Get);\n const cc = new HumidityControlSetpointCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n return response.type === HumidityControlSetpointType[\"N/A\"]\n ? // not supported\n undefined\n : // supported\n {\n value: response.value,\n scale: response.scale,\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_set()\n public async set(setpointType: HumidityControlSetpointType, value: number, scale: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Set);\n const cc = new HumidityControlSetpointCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n value,\n scale,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_HumidityControlSetpointCCAPI_getCapabilities()\n public async getCapabilities(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointCapabilities>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.CapabilitiesGet);\n const cc = new HumidityControlSetpointCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"minValue\",\n \"maxValue\",\n \"minValueScale\",\n \"maxValueScale\",\n ]);\n }\n }\n public async getSupportedSetpointTypes(): Promise<MaybeNotKnown<readonly HumidityControlSetpointType[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedSetpointTypes;\n }\n @validateArgs_HumidityControlSetpointCCAPI_getSupportedScales()\n public async getSupportedScales(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<readonly Scale[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCScaleSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCScaleSupportedReport>(cc, this.commandOptions);\n if (response) {\n return response.supportedScales.map((scale) => getScale(scale));\n }\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Setpoint\"])\n@implementedVersion(2)\n@ccValues(HumidityControlSetpointCCValues)\nexport class HumidityControlSetpointCC extends CommandClass {\n declare ccCommand: HumidityControlSetpointCommand;\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (property === \"setpoint\") {\n return getEnumMemberName(HumidityControlSetpointType, propertyKey as any);\n }\n else {\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query the supported setpoint types\n let setpointTypes: HumidityControlSetpointType[] = [];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"retrieving supported setpoint types...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupportedSetpointTypes();\n if (resp) {\n setpointTypes = [...resp];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"received supported setpoint types:\", {\n nested: logList(setpointTypes.map((type) => getEnumMemberName(HumidityControlSetpointType, type))),\n }),\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported setpoint types timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Find out the capabilities of this setpoint\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `retrieving capabilities for setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpointScaleSupported = await api.getSupportedScales(type);\n if (setpointScaleSupported) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received supported scales for setpoint ${setpointName}:`, {\n nested: logList(setpointScaleSupported.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n }),\n direction: \"inbound\",\n });\n const scaleValue = HumidityControlSetpointCCValues.setpointScale(type);\n const states: Record<number, string> = {};\n for (const scale of setpointScaleSupported) {\n if (scale.unit)\n states[scale.key] = scale.unit;\n }\n this.setMetadata(ctx, scaleValue, {\n ...scaleValue.meta,\n states,\n });\n }\n const setpointCaps = await api.getCapabilities(type);\n if (setpointCaps) {\n const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);\n const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received capabilities for setpoint ${setpointName}:`, {\n nested: logDict({\n \"minimum value\": `${setpointCaps.minValue} ${minValueUnit}`,\n \"maximum value\": `${setpointCaps.maxValue} ${maxValueUnit}`,\n }),\n }),\n direction: \"inbound\",\n });\n }\n }\n // Query the current value for all setpoint types\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const setpointTypes: HumidityControlSetpointType[] = this.getValue(ctx, HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];\n // Query each setpoint's current value\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Every time, query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying current value of setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpoint = await api.get(type);\n if (setpoint) {\n const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(setpoint.scale).unit ?? \"\"}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSetOptions {\n setpointType: HumidityControlSetpointType;\n value: number;\n scale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Set)\n@useSupervision()\nexport class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCSet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCSet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public value: number;\n public scale: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.setpointType & 0b1111],\n encodeFloatWithScale(this.value, this.scale),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCReportOptions {\n type: HumidityControlSetpointType;\n scale: number;\n value: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Report)\nexport class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.type = options.type;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // Setpoint type 0 is not defined in the spec, prevent devices from using it.\n if (type === 0) {\n // Not supported\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value: 0,\n scale: 0,\n });\n }\n // parseFloatWithScale does its own validation\n const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value,\n scale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const scale = getScale(this.scale);\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n const existingMetadata = this.getMetadata<ValueMetadataNumeric>(ctx, setpointValue);\n // Update the metadata when it is missing or the unit has changed\n if (existingMetadata?.unit !== scale.unit) {\n this.setMetadata(ctx, setpointValue, {\n ...(existingMetadata ?? setpointValue.meta),\n unit: scale.unit,\n });\n }\n this.setValue(ctx, setpointValue, this.value);\n // Remember the device-preferred setpoint scale so it can be used in SET commands\n this.setValue(ctx, HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);\n return true;\n }\n public type: HumidityControlSetpointType;\n public scale: number;\n public value: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\nfunction testResponseForHumidityControlSetpointGet(sent: HumidityControlSetpointCCGet, received: HumidityControlSetpointCCReport) {\n // We expect a Humidity Control Setpoint Report that matches the requested setpoint type\n return received.type === sent.setpointType;\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.Get)\n@expectedCCResponse(HumidityControlSetpointCCReport, testResponseForHumidityControlSetpointGet)\nexport class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSupportedReportOptions {\n supportedSetpointTypes: HumidityControlSetpointType[];\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedReport)\n@ccValueProperty(\"supportedSetpointTypes\", HumidityControlSetpointCCValues.supportedSetpointTypes)\nexport class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedSetpointTypes = options.supportedSetpointTypes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedSetpointTypes: HumidityControlSetpointType[] = parseBitMask(raw.payload, HumidityControlSetpointType[\"N/A\"]);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedSetpointTypes,\n });\n }\n public readonly supportedSetpointTypes: readonly HumidityControlSetpointType[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported setpoint types\": logList(this.supportedSetpointTypes.map((t) => getEnumMemberName(HumidityControlSetpointType, t))),\n },\n };\n }\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCSupportedReport)\nexport class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedReportOptions {\n supportedScales: number[];\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedScales = options.supportedScales;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedScales = parseBitMask(Bytes.from([raw.payload[0] & 0b1111]), 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedScales,\n });\n }\n public readonly supportedScales: readonly number[];\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const supportedScales = this.supportedScales.map((scale) => getScale(scale));\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"scale supported\": logList(supportedScales.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCScaleSupportedGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesReportOptions {\n type: HumidityControlSetpointType;\n minValue: number;\n maxValue: number;\n minValueScale: number;\n maxValueScale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesReportOptions>) {\n super(options);\n this.type = options.type;\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.minValueScale = options.minValueScale;\n this.maxValueScale = options.maxValueScale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // parseFloatWithScale does its own validation\n const { value: minValue, scale: minValueScale, bytesRead, } = parseFloatWithScale(raw.payload.subarray(1));\n const { value: maxValue, scale: maxValueScale } = parseFloatWithScale(raw.payload.subarray(1 + bytesRead));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n minValue,\n minValueScale,\n maxValue,\n maxValueScale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Predefine the metadata\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n this.setMetadata(ctx, setpointValue, {\n ...setpointValue.meta,\n min: this.minValue,\n max: this.maxValue,\n unit: getSetpointUnit(this.minValueScale)\n || getSetpointUnit(this.maxValueScale),\n });\n return true;\n }\n public type: HumidityControlSetpointType;\n public minValue: number;\n public maxValue: number;\n public minValueScale: number;\n public maxValueScale: number;\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const minValueScale = getScale(this.minValueScale);\n const maxValueScale = getScale(this.maxValueScale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n \"min value\": `${this.minValue} ${minValueScale.unit}`,\n \"max value\": `${this.maxValue} ${maxValueScale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesGet)\n@expectedCCResponse(HumidityControlSetpointCCCapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(_raw: CCRaw, _ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesGet {\n // TODO: Deserialize payload\n throw new ZWaveError(`${this.name}: deserialization not implemented`, ZWaveErrorCodes.Deserialization_NotImplemented);\n // return new HumidityControlSetpointCCCapabilitiesGet({\n // \tnodeId: ctx.sourceNodeId,\n // });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAA8Y;AAC9Y,oBAA+C;AAC/C,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAiI;AAEjI,mBAA0J;AAE1J,gCAAgD;AAThD,MAAM,EAAE,+CAA+C,+CAA+C,2DAA2D,6DAA4D,IAAK;AAWlO,SAAS,SAAS,OAAa;AAC3B,aAAO,2BAAc,YAA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iCAAkB,0CAA6B,KAAK,YAAY;;;IAG7F;;;;",
4
+ "sourcesContent": ["import * as __validateArgs from \"./HumidityControlSetpointCC._validateArgs.js\";\nconst { validateArgs_HumidityControlSetpointCCAPI_get, validateArgs_HumidityControlSetpointCCAPI_set, validateArgs_HumidityControlSetpointCCAPI_getCapabilities, validateArgs_HumidityControlSetpointCCAPI_getSupportedScales } = __validateArgs;\nimport { CommandClasses, type GetValueDB, type MaybeNotKnown, type MessageOrCCLogEntry, MessagePriority, type Scale, type SupervisionResult, ValueMetadata, type ValueMetadataNumeric, type WithAddress, ZWaveError, ZWaveErrorCodes, encodeBitMask, encodeFloatWithScale, getNamedScale, getUnknownScale, logDict, logList, logText, parseBitMask, parseFloatWithScale, supervisedCommandSucceeded, validatePayload, } from \"@zwave-js/core\";\nimport { Bytes, getEnumMemberName, pick } from \"@zwave-js/shared\";\nimport { CCAPI, POLL_VALUE, type PollValueImplementation, SET_VALUE, type SetValueImplementation, throwUnsupportedProperty, throwWrongValueType, } from \"../lib/API.js\";\nimport { type CCRaw, CommandClass, type InterviewContext, type PersistValuesContext, type RefreshValuesContext, type RefreshValuesOptions, } from \"../lib/CommandClass.js\";\nimport { API, CCCommand, ccValueProperty, ccValues, commandClass, expectedCCResponse, implementedVersion, useSupervision, } from \"../lib/CommandClassDecorators.js\";\nimport { V } from \"../lib/Values.js\";\nimport { type HumidityControlSetpointCapabilities, HumidityControlSetpointCommand, HumidityControlSetpointType, type HumidityControlSetpointValue, } from \"../lib/_Types.js\";\nimport type { CCEncodingContext, CCParsingContext } from \"../lib/traits.js\";\nimport { HumidityControlSetpointCCValues } from \"./_CCValues.generated.js\";\nexport { HumidityControlSetpointCCValues };\nfunction getScale(scale: number): Scale {\n return getNamedScale(\"humidity\", scale as any) ?? getUnknownScale(scale);\n}\nfunction getSetpointUnit(scale: number): string {\n return getScale(scale).unit ?? \"\";\n}\n@API(CommandClasses[\"Humidity Control Setpoint\"])\nexport class HumidityControlSetpointCCAPI extends CCAPI {\n public supportsCommand(cmd: HumidityControlSetpointCommand): MaybeNotKnown<boolean> {\n switch (cmd) {\n case HumidityControlSetpointCommand.Get:\n case HumidityControlSetpointCommand.SupportedGet:\n case HumidityControlSetpointCommand.CapabilitiesGet:\n return this.isSinglecast();\n case HumidityControlSetpointCommand.Set:\n return true; // This is mandatory\n }\n return super.supportsCommand(cmd);\n }\n protected override get [SET_VALUE](): SetValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }, value) {\n if (property !== \"setpoint\") {\n throwUnsupportedProperty(this.ccId, property);\n }\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n if (typeof value !== \"number\") {\n throwWrongValueType(this.ccId, property, \"number\", typeof value);\n }\n const scaleValueId = HumidityControlSetpointCCValues.setpointScale(propertyKey).endpoint(this.endpoint.index);\n const preferredScale = this.tryGetValueDB()?.getValue<number>(scaleValueId);\n const result = await this.set(propertyKey, value, preferredScale ?? 0);\n // Verify the change after a delay, unless the command was supervised and successful\n if (this.isSinglecast() && !supervisedCommandSucceeded(result)) {\n this.schedulePoll({ property, propertyKey }, value);\n }\n return result;\n };\n }\n protected get [POLL_VALUE](): PollValueImplementation {\n return async function (this: HumidityControlSetpointCCAPI, { property, propertyKey }) {\n switch (property) {\n case \"setpoint\":\n if (typeof propertyKey !== \"number\") {\n throw new ZWaveError(`${CommandClasses[this.ccId]}: \"${property}\" must be further specified by a numeric property key`, ZWaveErrorCodes.Argument_Invalid);\n }\n return (await this.get(propertyKey))?.value;\n default:\n throwUnsupportedProperty(this.ccId, property);\n }\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_get()\n public async get(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointValue>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Get);\n const cc = new HumidityControlSetpointCCGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCReport>(cc, this.commandOptions);\n if (!response)\n return;\n return response.type === HumidityControlSetpointType[\"N/A\"]\n ? // not supported\n undefined\n : // supported\n {\n value: response.value,\n scale: response.scale,\n };\n }\n @validateArgs_HumidityControlSetpointCCAPI_set()\n public async set(setpointType: HumidityControlSetpointType, value: number, scale: number): Promise<SupervisionResult | undefined> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.Set);\n const cc = new HumidityControlSetpointCCSet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n value,\n scale,\n });\n return this.host.sendCommand(cc, this.commandOptions);\n }\n @validateArgs_HumidityControlSetpointCCAPI_getCapabilities()\n public async getCapabilities(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<HumidityControlSetpointCapabilities>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.CapabilitiesGet);\n const cc = new HumidityControlSetpointCCCapabilitiesGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCCapabilitiesReport>(cc, this.commandOptions);\n if (response) {\n return pick(response, [\n \"minValue\",\n \"maxValue\",\n \"minValueScale\",\n \"maxValueScale\",\n ]);\n }\n }\n public async getSupportedSetpointTypes(): Promise<MaybeNotKnown<readonly HumidityControlSetpointType[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCSupportedReport>(cc, this.commandOptions);\n return response?.supportedSetpointTypes;\n }\n @validateArgs_HumidityControlSetpointCCAPI_getSupportedScales()\n public async getSupportedScales(setpointType: HumidityControlSetpointType): Promise<MaybeNotKnown<readonly Scale[]>> {\n this.assertSupportsCommand(HumidityControlSetpointCommand, HumidityControlSetpointCommand.SupportedGet);\n const cc = new HumidityControlSetpointCCScaleSupportedGet({\n nodeId: this.endpoint.nodeId,\n endpointIndex: this.endpoint.index,\n setpointType,\n });\n const response = await this.host.sendCommand<HumidityControlSetpointCCScaleSupportedReport>(cc, this.commandOptions);\n if (response) {\n return response.supportedScales.map((scale) => getScale(scale));\n }\n }\n}\n@commandClass(CommandClasses[\"Humidity Control Setpoint\"])\n@implementedVersion(2)\n@ccValues(HumidityControlSetpointCCValues)\nexport class HumidityControlSetpointCC extends CommandClass {\n declare ccCommand: HumidityControlSetpointCommand;\n public translatePropertyKey(ctx: GetValueDB, property: string | number, propertyKey: string | number): string | undefined {\n if (property === \"setpoint\") {\n return getEnumMemberName(HumidityControlSetpointType, propertyKey as any);\n }\n else {\n return super.translatePropertyKey(ctx, property, propertyKey);\n }\n }\n public async interview(ctx: InterviewContext): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: MessagePriority.NodeQuery,\n tag: \"interview\",\n });\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `Interviewing ${this.ccName}...`,\n direction: \"none\",\n });\n // Query the supported setpoint types\n let setpointTypes: HumidityControlSetpointType[] = [];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"retrieving supported setpoint types...\",\n direction: \"outbound\",\n });\n const resp = await api.getSupportedSetpointTypes();\n if (resp) {\n setpointTypes = [...resp];\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(\"received supported setpoint types:\", {\n nested: logList(setpointTypes.map((type) => getEnumMemberName(HumidityControlSetpointType, type))),\n }),\n direction: \"inbound\",\n });\n }\n else {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: \"Querying supported setpoint types timed out, skipping interview...\",\n level: \"warn\",\n });\n return;\n }\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Find out the capabilities of this setpoint\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `retrieving capabilities for setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpointScaleSupported = await api.getSupportedScales(type);\n if (setpointScaleSupported) {\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received supported scales for setpoint ${setpointName}:`, {\n nested: logList(setpointScaleSupported.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n }),\n direction: \"inbound\",\n });\n const scaleValue = HumidityControlSetpointCCValues.setpointScale(type);\n const states: Record<number, string> = {};\n for (const scale of setpointScaleSupported) {\n if (scale.unit)\n states[scale.key] = scale.unit;\n }\n this.setMetadata(ctx, scaleValue, {\n ...scaleValue.meta,\n states,\n });\n }\n const setpointCaps = await api.getCapabilities(type);\n if (setpointCaps) {\n const minValueUnit = getSetpointUnit(setpointCaps.minValueScale);\n const maxValueUnit = getSetpointUnit(setpointCaps.maxValueScale);\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logText(`received capabilities for setpoint ${setpointName}:`, {\n nested: logDict({\n \"minimum value\": `${setpointCaps.minValue} ${minValueUnit}`,\n \"maximum value\": `${setpointCaps.maxValue} ${maxValueUnit}`,\n }),\n }),\n direction: \"inbound\",\n });\n }\n }\n // Query the current value for all setpoint types\n await this.refreshValues(ctx, { tag: \"interview\" });\n // Remember that the interview is complete\n this.setInterviewComplete(ctx, true);\n }\n public async refreshValues(ctx: RefreshValuesContext, options?: RefreshValuesOptions): Promise<void> {\n const node = this.getNode(ctx)!;\n const endpoint = this.getEndpoint(ctx)!;\n const api = CCAPI.create(CommandClasses[\"Humidity Control Setpoint\"], ctx, endpoint).withOptions({\n priority: options?.priority ?? MessagePriority.NodeQuery,\n tag: options?.tag,\n });\n const setpointTypes: HumidityControlSetpointType[] = this.getValue(ctx, HumidityControlSetpointCCValues.supportedSetpointTypes) ?? [];\n // Query each setpoint's current value\n for (const type of setpointTypes) {\n const setpointName = getEnumMemberName(HumidityControlSetpointType, type);\n // Every time, query the current value\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: `querying current value of setpoint ${setpointName}...`,\n direction: \"outbound\",\n });\n const setpoint = await api.get(type);\n if (setpoint) {\n const logMessage = `received current value of setpoint ${setpointName}: ${setpoint.value} ${getScale(setpoint.scale).unit ?? \"\"}`;\n ctx.logNode(node.id, {\n endpoint: this.endpointIndex,\n message: logMessage,\n direction: \"inbound\",\n });\n }\n }\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSetOptions {\n setpointType: HumidityControlSetpointType;\n value: number;\n scale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Set)\n@useSupervision()\nexport class HumidityControlSetpointCCSet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSet {\n validatePayload(raw.payload.length >= 1);\n const setpointType: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));\n return new this({\n nodeId: ctx.sourceNodeId,\n setpointType,\n value,\n scale,\n });\n }\n public setpointType: HumidityControlSetpointType;\n public value: number;\n public scale: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.setpointType & 0b1111],\n encodeFloatWithScale(this.value, this.scale),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCReportOptions {\n type: HumidityControlSetpointType;\n scale: number;\n value: number;\n}\n@CCCommand(HumidityControlSetpointCommand.Report)\nexport class HumidityControlSetpointCCReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.type = options.type;\n this.value = options.value;\n this.scale = options.scale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // Setpoint type 0 is not defined in the spec, prevent devices from using it.\n if (type === 0) {\n // Not supported\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value: 0,\n scale: 0,\n });\n }\n // parseFloatWithScale does its own validation\n const { value, scale } = parseFloatWithScale(raw.payload.subarray(1));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n value,\n scale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n const scale = getScale(this.scale);\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n const existingMetadata = this.getMetadata<ValueMetadataNumeric>(ctx, setpointValue);\n // Update the metadata when it is missing or the unit has changed\n if (existingMetadata?.unit !== scale.unit) {\n this.setMetadata(ctx, setpointValue, {\n ...(existingMetadata ?? setpointValue.meta),\n unit: scale.unit,\n });\n }\n this.setValue(ctx, setpointValue, this.value);\n // Remember the device-preferred setpoint scale so it can be used in SET commands\n this.setValue(ctx, HumidityControlSetpointCCValues.setpointScale(this.type), this.scale);\n return true;\n }\n public type: HumidityControlSetpointType;\n public scale: number;\n public value: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.type & 0b1111],\n encodeFloatWithScale(this.value, this.scale),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const scale = getScale(this.scale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n value: `${this.value} ${scale.unit}`,\n },\n };\n }\n}\nfunction testResponseForHumidityControlSetpointGet(sent: HumidityControlSetpointCCGet, received: HumidityControlSetpointCCReport) {\n // We expect a Humidity Control Setpoint Report that matches the requested setpoint type\n return received.type === sent.setpointType;\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.Get)\n@expectedCCResponse(HumidityControlSetpointCCReport, testResponseForHumidityControlSetpointGet)\nexport class HumidityControlSetpointCCGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCGet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n setpointType: raw.payload[0] & 0b1111,\n });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCSupportedReportOptions {\n supportedSetpointTypes: HumidityControlSetpointType[];\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedReport)\n@ccValueProperty(\"supportedSetpointTypes\", HumidityControlSetpointCCValues.supportedSetpointTypes)\nexport class HumidityControlSetpointCCSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedSetpointTypes = options.supportedSetpointTypes;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedSetpointTypes: HumidityControlSetpointType[] = parseBitMask(raw.payload, HumidityControlSetpointType[\"N/A\"]);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedSetpointTypes,\n });\n }\n public readonly supportedSetpointTypes: readonly HumidityControlSetpointType[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = encodeBitMask(this.supportedSetpointTypes, undefined, HumidityControlSetpointType[\"N/A\"]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"supported setpoint types\": logList(this.supportedSetpointTypes.map((t) => getEnumMemberName(HumidityControlSetpointType, t))),\n },\n };\n }\n}\n@CCCommand(HumidityControlSetpointCommand.SupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCSupportedReport)\nexport class HumidityControlSetpointCCSupportedGet extends HumidityControlSetpointCC {\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedReportOptions {\n supportedScales: number[];\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedReportOptions>) {\n super(options);\n // TODO: Check implementation:\n this.supportedScales = options.supportedScales;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedReport {\n validatePayload(raw.payload.length >= 1);\n const supportedScales = parseBitMask(Bytes.from([raw.payload[0] & 0b1111]), 0);\n return new this({\n nodeId: ctx.sourceNodeId,\n supportedScales,\n });\n }\n public readonly supportedScales: readonly number[];\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = encodeBitMask(this.supportedScales, 3, 0);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const supportedScales = this.supportedScales.map((scale) => getScale(scale));\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"scale supported\": logList(supportedScales.map((t) => `${t.key} ${t.unit} - ${t.label}`)),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCScaleSupportedGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.ScaleSupportedGet)\n@expectedCCResponse(HumidityControlSetpointCCScaleSupportedReport)\nexport class HumidityControlSetpointCCScaleSupportedGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCScaleSupportedGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCScaleSupportedGet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n setpointType: raw.payload[0] & 0b1111,\n });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesReportOptions {\n type: HumidityControlSetpointType;\n minValue: number;\n maxValue: number;\n minValueScale: number;\n maxValueScale: number;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesReport extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesReportOptions>) {\n super(options);\n this.type = options.type;\n this.minValue = options.minValue;\n this.maxValue = options.maxValue;\n this.minValueScale = options.minValueScale;\n this.maxValueScale = options.maxValueScale;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesReport {\n validatePayload(raw.payload.length >= 1);\n const type: HumidityControlSetpointType = raw.payload[0] & 0b1111;\n // parseFloatWithScale does its own validation\n const { value: minValue, scale: minValueScale, bytesRead, } = parseFloatWithScale(raw.payload.subarray(1));\n const { value: maxValue, scale: maxValueScale } = parseFloatWithScale(raw.payload.subarray(1 + bytesRead));\n return new this({\n nodeId: ctx.sourceNodeId,\n type,\n minValue,\n minValueScale,\n maxValue,\n maxValueScale,\n });\n }\n public persistValues(ctx: PersistValuesContext): boolean {\n if (!super.persistValues(ctx))\n return false;\n // Predefine the metadata\n const setpointValue = HumidityControlSetpointCCValues.setpoint(this.type);\n this.setMetadata(ctx, setpointValue, {\n ...setpointValue.meta,\n min: this.minValue,\n max: this.maxValue,\n unit: getSetpointUnit(this.minValueScale)\n || getSetpointUnit(this.maxValueScale),\n });\n return true;\n }\n public type: HumidityControlSetpointType;\n public minValue: number;\n public maxValue: number;\n public minValueScale: number;\n public maxValueScale: number;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.concat([\n [this.type & 0b1111],\n encodeFloatWithScale(this.minValue, this.minValueScale),\n encodeFloatWithScale(this.maxValue, this.maxValueScale),\n ]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n const minValueScale = getScale(this.minValueScale);\n const maxValueScale = getScale(this.maxValueScale);\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.type),\n \"min value\": `${this.minValue} ${minValueScale.unit}`,\n \"max value\": `${this.maxValue} ${maxValueScale.unit}`,\n },\n };\n }\n}\n// @publicAPI\nexport interface HumidityControlSetpointCCCapabilitiesGetOptions {\n setpointType: HumidityControlSetpointType;\n}\n@CCCommand(HumidityControlSetpointCommand.CapabilitiesGet)\n@expectedCCResponse(HumidityControlSetpointCCCapabilitiesReport)\nexport class HumidityControlSetpointCCCapabilitiesGet extends HumidityControlSetpointCC {\n public constructor(options: WithAddress<HumidityControlSetpointCCCapabilitiesGetOptions>) {\n super(options);\n this.setpointType = options.setpointType;\n }\n public static from(raw: CCRaw, ctx: CCParsingContext): HumidityControlSetpointCCCapabilitiesGet {\n validatePayload(raw.payload.length >= 1);\n return new this({\n nodeId: ctx.sourceNodeId,\n setpointType: raw.payload[0] & 0b1111,\n });\n }\n public setpointType: HumidityControlSetpointType;\n public serialize(ctx: CCEncodingContext): Promise<Bytes> {\n this.payload = Bytes.from([this.setpointType & 0b1111]);\n return super.serialize(ctx);\n }\n public toLogEntry(ctx?: GetValueDB): MessageOrCCLogEntry {\n return {\n ...super.toLogEntry(ctx),\n message: {\n \"setpoint type\": getEnumMemberName(HumidityControlSetpointType, this.setpointType),\n },\n };\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qBAAgC;AAEhC,kBAA6Z;AAC7Z,oBAA+C;AAC/C,iBAAwJ;AACxJ,0BAAkJ;AAClJ,oCAAiI;AAEjI,mBAA0J;AAE1J,gCAAgD;AAThD,MAAM,EAAE,+CAA+C,+CAA+C,2DAA2D,6DAA4D,IAAK;AAWlO,SAAS,SAAS,OAAa;AAC3B,aAAO,2BAAc,YAAY,KAAY,SAAK,6BAAgB,KAAK;AAC3E;AAFS;AAGT,SAAS,gBAAgB,OAAa;AAClC,SAAO,SAAS,KAAK,EAAE,QAAQ;AACnC;AAFS;IAII,gCAA4B,MAAA;8BADxC,mCAAI,2BAAe,2BAA2B,CAAC,CAAC;;;;oBACC;;;;;;oDAAA,YAAK;WAAA;;;;;;;;yBA8ClD,8CAA6C,CAAE;yBAoB/C,8CAA6C,CAAE;qCAY/C,0DAAyD,CAAE;wCA2B3D,6DAA4D,CAAE;AA1D/D,qCAAA,MAAA,MAAA,iBAAA,EAAA,MAAA,UAAA,MAAA,OAAA,QAAA,OAAA,SAAA,OAAA,QAAA,EAAA,KAAA,gCAAA,SAAA,KAAA,QAAA,KAAA,gCAAA,IAAa,KAAb,OAAgB,GAAA,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