diff --git a/packages/cc/src/cc/AlarmSensorCC.ts b/packages/cc/src/cc/AlarmSensorCC.ts index bd51dffe6fa0..9b1494726ba4 100644 --- a/packages/cc/src/cc/AlarmSensorCC.ts +++ b/packages/cc/src/cc/AlarmSensorCC.ts @@ -435,7 +435,7 @@ export class AlarmSensorCCGet extends AlarmSensorCC { this.sensorType = options.sensorType ?? AlarmSensorType.Any; } - public static from(raw: CCRaw, ctx: CCParsingContext): AlarmSensorCCGet { + public static from(_raw: CCRaw, _ctx: CCParsingContext): AlarmSensorCCGet { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/BarrierOperatorCC.ts b/packages/cc/src/cc/BarrierOperatorCC.ts index be592ff21328..e61fcaabe740 100644 --- a/packages/cc/src/cc/BarrierOperatorCC.ts +++ b/packages/cc/src/cc/BarrierOperatorCC.ts @@ -556,8 +556,8 @@ export class BarrierOperatorCCSet extends BarrierOperatorCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): BarrierOperatorCCSet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, @@ -740,8 +740,8 @@ export class BarrierOperatorCCEventSignalingSet extends BarrierOperatorCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): BarrierOperatorCCEventSignalingSet { // TODO: Deserialize payload throw new ZWaveError( @@ -861,8 +861,8 @@ export class BarrierOperatorCCEventSignalingGet extends BarrierOperatorCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): BarrierOperatorCCEventSignalingGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/CentralSceneCC.ts b/packages/cc/src/cc/CentralSceneCC.ts index f6f701c45120..df16d120bbad 100644 --- a/packages/cc/src/cc/CentralSceneCC.ts +++ b/packages/cc/src/cc/CentralSceneCC.ts @@ -575,8 +575,8 @@ export class CentralSceneCCConfigurationSet extends CentralSceneCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): CentralSceneCCConfigurationSet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/ClimateControlScheduleCC.ts b/packages/cc/src/cc/ClimateControlScheduleCC.ts index c34f3192fc23..17b9f27ce7f2 100644 --- a/packages/cc/src/cc/ClimateControlScheduleCC.ts +++ b/packages/cc/src/cc/ClimateControlScheduleCC.ts @@ -231,8 +231,8 @@ export class ClimateControlScheduleCCSet extends ClimateControlScheduleCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ClimateControlScheduleCCSet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, @@ -378,8 +378,8 @@ export class ClimateControlScheduleCCGet extends ClimateControlScheduleCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ClimateControlScheduleCCGet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, @@ -535,8 +535,8 @@ export class ClimateControlScheduleCCOverrideSet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ClimateControlScheduleCCOverrideSet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/ClockCC.ts b/packages/cc/src/cc/ClockCC.ts index bf6a1dfa88da..73216530b91b 100644 --- a/packages/cc/src/cc/ClockCC.ts +++ b/packages/cc/src/cc/ClockCC.ts @@ -161,7 +161,7 @@ export class ClockCCSet extends ClockCC { this.minute = options.minute; } - public static from(raw: CCRaw, ctx: CCParsingContext): ClockCCSet { + public static from(_raw: CCRaw, _ctx: CCParsingContext): ClockCCSet { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/ConfigurationCC.ts b/packages/cc/src/cc/ConfigurationCC.ts index 0a1d418adc99..039c71fa07e9 100644 --- a/packages/cc/src/cc/ConfigurationCC.ts +++ b/packages/cc/src/cc/ConfigurationCC.ts @@ -2030,8 +2030,8 @@ export class ConfigurationCCBulkSet extends ConfigurationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ConfigurationCCBulkSet { // TODO: Deserialize payload throw new ZWaveError( @@ -2301,8 +2301,8 @@ export class ConfigurationCCBulkGet extends ConfigurationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ConfigurationCCBulkGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/DoorLockCC.ts b/packages/cc/src/cc/DoorLockCC.ts index d44671e77d4d..d20dbe4c926e 100644 --- a/packages/cc/src/cc/DoorLockCC.ts +++ b/packages/cc/src/cc/DoorLockCC.ts @@ -842,8 +842,8 @@ export class DoorLockCCOperationSet extends DoorLockCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): DoorLockCCOperationSet { // TODO: Deserialize payload throw new ZWaveError( @@ -1305,8 +1305,8 @@ export class DoorLockCCConfigurationSet extends DoorLockCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): DoorLockCCConfigurationSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/DoorLockLoggingCC.ts b/packages/cc/src/cc/DoorLockLoggingCC.ts index 590570d8a174..d8ba9ee64628 100644 --- a/packages/cc/src/cc/DoorLockLoggingCC.ts +++ b/packages/cc/src/cc/DoorLockLoggingCC.ts @@ -414,8 +414,8 @@ export class DoorLockLoggingCCRecordGet extends DoorLockLoggingCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): DoorLockLoggingCCRecordGet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/EntryControlCC.ts b/packages/cc/src/cc/EntryControlCC.ts index 73e03a62256d..e6d932e3e96b 100644 --- a/packages/cc/src/cc/EntryControlCC.ts +++ b/packages/cc/src/cc/EntryControlCC.ts @@ -769,8 +769,8 @@ export class EntryControlCCConfigurationSet extends EntryControlCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): EntryControlCCConfigurationSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/FirmwareUpdateMetaDataCC.ts b/packages/cc/src/cc/FirmwareUpdateMetaDataCC.ts index 0e18038d9483..282d27171710 100644 --- a/packages/cc/src/cc/FirmwareUpdateMetaDataCC.ts +++ b/packages/cc/src/cc/FirmwareUpdateMetaDataCC.ts @@ -616,8 +616,8 @@ export class FirmwareUpdateMetaDataCCRequestGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): FirmwareUpdateMetaDataCCRequestGet { // TODO: Deserialize payload throw new ZWaveError( @@ -756,8 +756,8 @@ export class FirmwareUpdateMetaDataCCReport extends FirmwareUpdateMetaDataCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): FirmwareUpdateMetaDataCCReport { // TODO: Deserialize payload throw new ZWaveError( @@ -981,8 +981,8 @@ export class FirmwareUpdateMetaDataCCActivationSet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): FirmwareUpdateMetaDataCCActivationSet { // TODO: Deserialize payload throw new ZWaveError( @@ -1103,8 +1103,8 @@ export class FirmwareUpdateMetaDataCCPrepareGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): FirmwareUpdateMetaDataCCPrepareGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/HumidityControlModeCC.ts b/packages/cc/src/cc/HumidityControlModeCC.ts index aa6e76202bd6..14618002c504 100644 --- a/packages/cc/src/cc/HumidityControlModeCC.ts +++ b/packages/cc/src/cc/HumidityControlModeCC.ts @@ -293,8 +293,8 @@ export class HumidityControlModeCCSet extends HumidityControlModeCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): HumidityControlModeCCSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/HumidityControlSetpointCC.ts b/packages/cc/src/cc/HumidityControlSetpointCC.ts index ff59eeecc790..0c4b9ef57980 100644 --- a/packages/cc/src/cc/HumidityControlSetpointCC.ts +++ b/packages/cc/src/cc/HumidityControlSetpointCC.ts @@ -533,8 +533,8 @@ export class HumidityControlSetpointCCSet extends HumidityControlSetpointCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): HumidityControlSetpointCCSet { // TODO: Deserialize payload throw new ZWaveError( @@ -700,8 +700,8 @@ export class HumidityControlSetpointCCGet extends HumidityControlSetpointCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): HumidityControlSetpointCCGet { // TODO: Deserialize payload throw new ZWaveError( @@ -870,8 +870,8 @@ export class HumidityControlSetpointCCScaleSupportedGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): HumidityControlSetpointCCScaleSupportedGet { // TODO: Deserialize payload throw new ZWaveError( @@ -1017,8 +1017,8 @@ export class HumidityControlSetpointCCCapabilitiesGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): HumidityControlSetpointCCCapabilitiesGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/IrrigationCC.ts b/packages/cc/src/cc/IrrigationCC.ts index f7bf9710a42d..5543583e7a4c 100644 --- a/packages/cc/src/cc/IrrigationCC.ts +++ b/packages/cc/src/cc/IrrigationCC.ts @@ -1645,8 +1645,8 @@ export class IrrigationCCSystemConfigSet extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCSystemConfigSet { // TODO: Deserialize payload throw new ZWaveError( @@ -2031,8 +2031,8 @@ export class IrrigationCCValveInfoGet extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveInfoGet { // TODO: Deserialize payload throw new ZWaveError( @@ -2095,8 +2095,8 @@ export class IrrigationCCValveConfigSet extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveConfigSet { // TODO: Deserialize payload throw new ZWaveError( @@ -2354,8 +2354,8 @@ export class IrrigationCCValveConfigGet extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveConfigGet { // TODO: Deserialize payload throw new ZWaveError( @@ -2406,8 +2406,8 @@ export class IrrigationCCValveRun extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveRun { // TODO: Deserialize payload throw new ZWaveError( @@ -2468,8 +2468,8 @@ export class IrrigationCCValveTableSet extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveTableSet { // TODO: Deserialize payload throw new ZWaveError( @@ -2605,8 +2605,8 @@ export class IrrigationCCValveTableGet extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveTableGet { // TODO: Deserialize payload throw new ZWaveError( @@ -2658,8 +2658,8 @@ export class IrrigationCCValveTableRun extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCValveTableRun { // TODO: Deserialize payload throw new ZWaveError( @@ -2711,8 +2711,8 @@ export class IrrigationCCSystemShutoff extends IrrigationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): IrrigationCCSystemShutoff { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/LanguageCC.ts b/packages/cc/src/cc/LanguageCC.ts index a695f730a7ea..10bc366cd897 100644 --- a/packages/cc/src/cc/LanguageCC.ts +++ b/packages/cc/src/cc/LanguageCC.ts @@ -180,7 +180,7 @@ export class LanguageCCSet extends LanguageCC { this._country = options.country; } - public static from(raw: CCRaw, ctx: CCParsingContext): LanguageCCSet { + public static from(_raw: CCRaw, _ctx: CCParsingContext): LanguageCCSet { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/LockCC.ts b/packages/cc/src/cc/LockCC.ts index ef483bdf65cb..08e96741adc3 100644 --- a/packages/cc/src/cc/LockCC.ts +++ b/packages/cc/src/cc/LockCC.ts @@ -196,7 +196,7 @@ export class LockCCSet extends LockCC { this.locked = options.locked; } - public static from(raw: CCRaw, ctx: CCParsingContext): LockCCSet { + public static from(_raw: CCRaw, _ctx: CCParsingContext): LockCCSet { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/ManufacturerSpecificCC.ts b/packages/cc/src/cc/ManufacturerSpecificCC.ts index 468308e283a3..ac8f51fc6c32 100644 --- a/packages/cc/src/cc/ManufacturerSpecificCC.ts +++ b/packages/cc/src/cc/ManufacturerSpecificCC.ts @@ -373,8 +373,8 @@ export class ManufacturerSpecificCCDeviceSpecificGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ManufacturerSpecificCCDeviceSpecificGet { throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/MultiChannelCC.ts b/packages/cc/src/cc/MultiChannelCC.ts index 44d926e18398..a33082797b0d 100644 --- a/packages/cc/src/cc/MultiChannelCC.ts +++ b/packages/cc/src/cc/MultiChannelCC.ts @@ -1291,8 +1291,8 @@ export class MultiChannelCCAggregatedMembersGet extends MultiChannelCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): MultiChannelCCAggregatedMembersGet { // TODO: Deserialize payload throw new ZWaveError( @@ -1547,7 +1547,10 @@ export class MultiChannelCCV1Get extends MultiChannelCC { this.requestedCC = options.requestedCC; } - public static from(raw: CCRaw, ctx: CCParsingContext): MultiChannelCCV1Get { + public static from( + _raw: CCRaw, + _ctx: CCParsingContext, + ): MultiChannelCCV1Get { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/NodeNamingCC.ts b/packages/cc/src/cc/NodeNamingCC.ts index 0bf7d0356792..fa265d742faf 100644 --- a/packages/cc/src/cc/NodeNamingCC.ts +++ b/packages/cc/src/cc/NodeNamingCC.ts @@ -282,8 +282,8 @@ export class NodeNamingAndLocationCCNameSet extends NodeNamingAndLocationCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): NodeNamingAndLocationCCNameSet { // TODO: Deserialize payload throw new ZWaveError( @@ -393,8 +393,8 @@ export class NodeNamingAndLocationCCLocationSet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): NodeNamingAndLocationCCLocationSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/ProtectionCC.ts b/packages/cc/src/cc/ProtectionCC.ts index 8ba4f438b3cf..dd3a6b8cfbf3 100644 --- a/packages/cc/src/cc/ProtectionCC.ts +++ b/packages/cc/src/cc/ProtectionCC.ts @@ -515,7 +515,7 @@ export class ProtectionCCSet extends ProtectionCC { this.rf = options.rf; } - public static from(raw: CCRaw, ctx: CCParsingContext): ProtectionCCSet { + public static from(_raw: CCRaw, _ctx: CCParsingContext): ProtectionCCSet { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, @@ -792,8 +792,8 @@ export class ProtectionCCExclusiveControlSet extends ProtectionCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ProtectionCCExclusiveControlSet { // TODO: Deserialize payload throw new ZWaveError( @@ -884,8 +884,8 @@ export class ProtectionCCTimeoutSet extends ProtectionCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ProtectionCCTimeoutSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/SceneActuatorConfigurationCC.ts b/packages/cc/src/cc/SceneActuatorConfigurationCC.ts index 3434322234be..0188870dbec2 100644 --- a/packages/cc/src/cc/SceneActuatorConfigurationCC.ts +++ b/packages/cc/src/cc/SceneActuatorConfigurationCC.ts @@ -372,8 +372,8 @@ export class SceneActuatorConfigurationCCSet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): SceneActuatorConfigurationCCSet { // TODO: Deserialize payload throw new ZWaveError( @@ -540,8 +540,8 @@ export class SceneActuatorConfigurationCCGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): SceneActuatorConfigurationCCGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/SceneControllerConfigurationCC.ts b/packages/cc/src/cc/SceneControllerConfigurationCC.ts index dde2106ce4ed..1c2623a02ffb 100644 --- a/packages/cc/src/cc/SceneControllerConfigurationCC.ts +++ b/packages/cc/src/cc/SceneControllerConfigurationCC.ts @@ -505,8 +505,8 @@ export class SceneControllerConfigurationCCSet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): SceneControllerConfigurationCCSet { // TODO: Deserialize payload throw new ZWaveError( @@ -650,8 +650,8 @@ export class SceneControllerConfigurationCCGet } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): SceneControllerConfigurationCCGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/ThermostatFanModeCC.ts b/packages/cc/src/cc/ThermostatFanModeCC.ts index 27096c794c01..c2e9e307760b 100644 --- a/packages/cc/src/cc/ThermostatFanModeCC.ts +++ b/packages/cc/src/cc/ThermostatFanModeCC.ts @@ -352,8 +352,8 @@ export class ThermostatFanModeCCSet extends ThermostatFanModeCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): ThermostatFanModeCCSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/TimeCC.ts b/packages/cc/src/cc/TimeCC.ts index 4865f0fdf130..34da2eef957a 100644 --- a/packages/cc/src/cc/TimeCC.ts +++ b/packages/cc/src/cc/TimeCC.ts @@ -390,7 +390,10 @@ export class TimeCCTimeOffsetSet extends TimeCC { this.dstEndDate = options.dstEnd; } - public static from(raw: CCRaw, ctx: CCParsingContext): TimeCCTimeOffsetSet { + public static from( + _raw: CCRaw, + _ctx: CCParsingContext, + ): TimeCCTimeOffsetSet { // TODO: Deserialize payload throw new ZWaveError( `${this.constructor.name}: deserialization not implemented`, diff --git a/packages/cc/src/cc/UserCodeCC.ts b/packages/cc/src/cc/UserCodeCC.ts index 311e893917d2..8ee665a9ee0b 100644 --- a/packages/cc/src/cc/UserCodeCC.ts +++ b/packages/cc/src/cc/UserCodeCC.ts @@ -2019,8 +2019,8 @@ export class UserCodeCCExtendedUserCodeSet extends UserCodeCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): UserCodeCCExtendedUserCodeSet { // TODO: Deserialize payload throw new ZWaveError( @@ -2171,8 +2171,8 @@ export class UserCodeCCExtendedUserCodeGet extends UserCodeCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): UserCodeCCExtendedUserCodeGet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/cc/src/cc/manufacturerProprietary/FibaroCC.ts b/packages/cc/src/cc/manufacturerProprietary/FibaroCC.ts index 716a98fbd360..87d27ea9403f 100644 --- a/packages/cc/src/cc/manufacturerProprietary/FibaroCC.ts +++ b/packages/cc/src/cc/manufacturerProprietary/FibaroCC.ts @@ -385,8 +385,8 @@ export class FibaroVenetianBlindCCSet extends FibaroVenetianBlindCC { } public static from( - raw: CCRaw, - ctx: CCParsingContext, + _raw: CCRaw, + _ctx: CCParsingContext, ): FibaroVenetianBlindCCSet { // TODO: Deserialize payload throw new ZWaveError( diff --git a/packages/maintenance/src/refactorCCParsing.ts b/packages/maintenance/src/refactorCCParsing.03.ts similarity index 100% rename from packages/maintenance/src/refactorCCParsing.ts rename to packages/maintenance/src/refactorCCParsing.03.ts diff --git a/packages/maintenance/src/refactorCCParsing.04.ts b/packages/maintenance/src/refactorCCParsing.04.ts new file mode 100644 index 000000000000..58d91526bf2a --- /dev/null +++ b/packages/maintenance/src/refactorCCParsing.04.ts @@ -0,0 +1,69 @@ +import fs from "node:fs/promises"; +import { Project, SyntaxKind } from "ts-morph"; + +async function main() { + const project = new Project({ + tsConfigFilePath: "packages/cc/tsconfig.json", + }); + // project.addSourceFilesAtPaths("packages/cc/src/cc/**/*CC.ts"); + + const sourceFiles = project.getSourceFiles().filter((file) => + file.getBaseNameWithoutExtension().endsWith("CC") + ); + for (const file of sourceFiles) { + // const filePath = path.relative(process.cwd(), file.getFilePath()); + + const emptyFromImpls = file.getDescendantsOfKind( + SyntaxKind.MethodDeclaration, + ) + .filter((m) => m.isStatic() && m.getName() === "from") + .filter((m) => { + const params = m.getParameters(); + if (params.length !== 2) return false; + if ( + params[0].getDescendantsOfKind(SyntaxKind.TypeReference)[0] + ?.getText() !== "CCRaw" + ) return false; + if ( + params[1].getDescendantsOfKind(SyntaxKind.TypeReference)[0] + ?.getText() !== "CCParsingContext" + ) { + return false; + } + return true; + }) + .filter((m) => { + const body = m.getBody()?.asKind(SyntaxKind.Block); + if (!body) return false; + const firstStmt = body.getStatements()[0]; + if (!firstStmt) return false; + if ( + firstStmt.isKind(SyntaxKind.ThrowStatement) + && firstStmt.getText().includes("ZWaveError") + ) { + return true; + } + return false; + }); + + if (emptyFromImpls.length === 0) continue; + + for (const impl of emptyFromImpls) { + for (const param of impl.getParameters()) { + param.rename("_" + param.getName()); + } + } + + await file.save(); + } +} + +void main().catch(async (e) => { + await fs.writeFile(`${e.filePath}.old`, e.oldText); + await fs.writeFile(`${e.filePath}.new`, e.newText); + console.error(`Error refactoring file ${e.filePath} + old text: ${e.filePath}.old + new text: ${e.filePath}.new`); + + process.exit(1); +});