Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(io): IOBase constructor do not update the fields id, name & description #344

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pi4j-core/src/main/java/com/pi4j/io/IOBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ public PROVIDER_TYPE provider(){
*/
public IOBase(PROVIDER_TYPE provider, CONFIG_TYPE config){
super();
this.id = config.id();
this.name = config.name();
this.description = config.description();
this.provider = provider;
this.config = config;
}
Expand Down
3 changes: 0 additions & 3 deletions pi4j-core/src/main/java/com/pi4j/io/gpio/GpioBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ public abstract class GpioBase<IO_TYPE extends Gpio<IO_TYPE, CONFIG_TYPE, PROVID
*/
public GpioBase(PROVIDER_TYPE provider, CONFIG_TYPE config){
super(provider, config);
this.name = config.name();
this.id = config.id();
this.description = config.description();
}

/** {@inheritDoc} */
Expand Down
3 changes: 0 additions & 3 deletions pi4j-core/src/main/java/com/pi4j/io/i2c/I2CBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public abstract class I2CBase extends IOBase<I2C, I2CConfig, I2CProvider> implem
*/
public I2CBase(I2CProvider provider, I2CConfig config) {
super(provider, config);
this.name = config.name();
this.id = config.id();
this.description = config.description();
this.isOpen = true;
}

Expand Down
3 changes: 0 additions & 3 deletions pi4j-core/src/main/java/com/pi4j/io/pwm/PwmBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ public abstract class PwmBase extends IOBase<Pwm, PwmConfig, PwmProvider> implem
*/
public PwmBase(PwmProvider provider, PwmConfig config) {
super(provider, config);
this.name = config.name();
this.id = config.id();
this.description = config.description();
for(PwmPreset preset : config.presets()){
this.presets.put(preset.name().toLowerCase().trim(), preset);
}
Expand Down
3 changes: 0 additions & 3 deletions pi4j-core/src/main/java/com/pi4j/io/spi/SpiBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public abstract class SpiBase extends IOBase<Spi, SpiConfig, SpiProvider> implem
*/
public SpiBase(SpiProvider provider, SpiConfig config) {
super(provider, config);
this.name = config.name();
this.id = config.id();
this.description = config.description();
}

/** {@inheritDoc} */
Expand Down