Package com.opensourcewithslu.utilities
Class PwmConfiguration
java.lang.Object
com.opensourcewithslu.utilities.PwmConfiguration
The PwmConfiguration class handles the configuration of a pwm component.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the pin address for the component.getId()
Gets the id of the component.int
Gets the initial state that the component is in when first initialized.getName()
Gets the name of the component.Gets the provider for the component.com.pi4j.io.pwm.PwmType
Gets the pwm type of the component.int
Gets the shutdown state for the component.void
setAddress
(int address) Sets a new pin address for the component.void
setInitial
(int initial) Sets the initial state that the component will be in when first initialized.void
Sets the name of the component.void
setProvider
(String provider) Sets the provider of the component.void
setPwmType
(String pwmType) Sets the pwm type.void
setShutdown
(int shutdown) Sets the shutdown state for the component.
-
Constructor Details
-
PwmConfiguration
PwmConfiguration constructor.- Parameters:
id
- The configuration id as defined in the application.yml
-
-
Method Details
-
getId
Gets the id of the component.- Returns:
- The id of the component.
-
getName
Gets the name of the component.- Returns:
- The name of the component.
-
setName
Sets the name of the component.- Parameters:
name
- The string name to replace the existing name.
-
getAddress
public int getAddress()Gets the pin address for the component.- Returns:
- The address as an integer.
-
setAddress
public void setAddress(int address) Sets a new pin address for the component.- Parameters:
address
- An integer representing the new pin address.
-
getInitial
public int getInitial()Gets the initial state that the component is in when first initialized.- Returns:
- The state as an integer.
-
setInitial
public void setInitial(int initial) Sets the initial state that the component will be in when first initialized.- Parameters:
initial
- The startup state as an integer.
-
getShutdown
public int getShutdown()Gets the shutdown state for the component.- Returns:
- The shutdown state as an integer.
-
setShutdown
public void setShutdown(int shutdown) Sets the shutdown state for the component.- Parameters:
shutdown
- Integer representing the new shutdown state.
-
getPwmType
public com.pi4j.io.pwm.PwmType getPwmType()Gets the pwm type of the component.- Returns:
- A PwmType object.
-
setPwmType
Sets the pwm type.- Parameters:
pwmType
- A string representing the new pwm type. Either SOFTWARE or HARDWARE.
-
getProvider
Gets the provider for the component.- Returns:
- The provider as a String.
-
setProvider
Sets the provider of the component.- Parameters:
provider
- The new provider as a String.
-