Package com.opensourcewithslu.utilities
Class DigitalOutputConfiguration
java.lang.Object
com.opensourcewithslu.utilities.DigitalOutputConfiguration
@Prototype
@EachProperty("pi4j.digital-output")
public class DigitalOutputConfiguration
extends Object
This class handles the configuration of a digital output component.
-
Constructor Summary
ConstructorDescriptionThe DigitalOutputConfiguration constructor. -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the pin address for the component.getId()
Gets the id of the component.com.pi4j.io.gpio.digital.DigitalState
Gets the initial state of the component.getName()
Gets the name of the component.Gets the provider for the component.com.pi4j.io.gpio.digital.DigitalState
Gets the shutdown state of the component.void
setAddress
(int address) Sets the pin address.void
setInitial
(com.pi4j.io.gpio.digital.DigitalState initial) Sets the initial state for the component.void
Sets the name of the component.void
setProvider
(String provider) Sets the provider.void
setShutdown
(com.pi4j.io.gpio.digital.DigitalState shutdown) Sets the shutdown state for the component.
-
Constructor Details
-
DigitalOutputConfiguration
The DigitalOutputConfiguration 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 String name of the component.
-
setName
Sets the name of the component.- Parameters:
name
- The String that the name will be set as.
-
getInitial
public com.pi4j.io.gpio.digital.DigitalState getInitial()Gets the initial state of the component.- Returns:
- The initial state of the component.
-
setInitial
public void setInitial(com.pi4j.io.gpio.digital.DigitalState initial) Sets the initial state for the component.- Parameters:
initial
- The Digital state that the component will start was.
-
getShutdown
public com.pi4j.io.gpio.digital.DigitalState getShutdown()Gets the shutdown state of the component.- Returns:
- The digital state of the component.
-
setShutdown
public void setShutdown(com.pi4j.io.gpio.digital.DigitalState shutdown) Sets the shutdown state for the component.- Parameters:
shutdown
- DigitalState enum.
-
getAddress
public int getAddress()Gets the pin address for the component.- Returns:
- An array of the pin addresses.
-
setAddress
public void setAddress(int address) Sets the pin address.- Parameters:
address
- Integer representing the new pin address.
-
getProvider
Gets the provider for the component.- Returns:
- A String representation of the provider.
-
setProvider
Sets the provider.- Parameters:
provider
- The new provider for the component.
-