-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Instead of a Maestro for lights we're going to use a GPIO.
Steps:
- Remove the existing
Lightclass and and tests from the project. - Create a
Lightinterface in thedevicespackage. The flash method should do the same thing as the existing light class; just change between on/off at the same frequency.
public interface Light {
void write(final boolean active);
void flash();
}- Implement the interface using a
pi4jgpio object. Place this in theio.rpipackage. Some name likeRaspberryGpioLight - Add the light channel to the config.
- Add the light to the
Rovctor and manage.
SpeedValue no longer really works; the value is a boolean not a float range. For now you can just map the speedvalue to a boolean, until you recreate the lights value fully.
eventPublisher.valuesOfType(LightASpeedValue.class)
.startWith(new LightASpeedValue())
.map(SpeedValue::getSpeed)
.map(v -> v > 0.5)