// Path: src/main/java/be/error/rpi/config/RunConfig.java
// public static RunConfig getInstance() {
// 	if (runConfig == null) {
// 		throw new IllegalStateException("Initialize first");
// 	}
// 	return runConfig;
// }
// 
// Path: src/main/java/be/error/rpi/knx/Support.java
// public static GroupAddress createGroupAddress(String groupAddress) {
// 	try {
// 		return new GroupAddress(groupAddress);
// 	} catch (KNXException knxException) {
// 		logger.error("Could not create group address from " + groupAddress, knxException);
// 		throw new RuntimeException(knxException);
// 	}
// }
// 
// Path: src/main/java/be/error/types/LocationId.java
// public enum LocationId {
// 
// 	GELIJKVLOERS("Gelijkvloers"),
// 	NACHTHAL("Nachthal"),
// 	BADKAMER("Badkamer"),
// 	DRESSING("Dressing"),
// 	SK1("Slaapkamer1"),
// 	SK2("Slaapkamer2"),
// 	SK3("Slaapkamer3"),
// 	KEUKEN("Keuken"),
// 	EETHOEK("Eethoek"),
// 	INKOMHAL("Inkomhal"),
// 	BERGING("Berging"),
// 	VOORDEUR("Inkom buiten"),
// 	GANG("Gang"),
// 	WC("WC"),
// 	ZITHOEK("Zithoek"),
// 	GARAGE("Garage"),
// 	LZG("LZG"),
// 	AG("AG"),
// 	RZG("RZG"),
// 	VG("VG");
// 
// 	private String dimmerDescription;
// 
// 	LocationId(final String dimmerDescription) {
// 		this.dimmerDescription = dimmerDescription;
// 	}
// }


import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tuwien.auto.calimero.GroupAddress;
import be.error.types.LocationId;
import static be.error.rpi.config.RunConfig.getInstance;
import static be.error.rpi.dac.dimmer.builder.DimmerBackend.I2C;
import static be.error.rpi.dac.dimmer.builder.DimmerBackend.LUCID_CONTROL;
import static be.error.rpi.knx.Support.createGroupAddress;
import static java.util.Arrays.asList;
import static java.util.Optional.empty;
import static java.util.Optional.of;
import static java.util.stream.Collectors.toList;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import java.util.ArrayList;

	public DimmerBuilder precenseOperated(String precenseDetectorLock) {
		this.precenseDetectorLock = of(createGroupAddress(precenseDetectorLock));
		return this;
	}

	/**
	 */
	public DimmerBuilder inputGroupAddressForOnOffOverride(String onOffOverride) {
		this.onOffOverride = isEmpty(onOffOverride) ? empty() : of(createGroupAddress(onOffOverride));
		return this;
	}

	/**
	 * Will listen for telegrams on the given GA which are considered on/off (1bit boolean) telegrams for toggling the LED on and off.
	 * Mostly this will be the switch FO of a KNX taster that will be bound to this GA.
	 */
	public DimmerBuilder inputGroupAddressForOnAndOff(String onOff) {
		this.onOff = of(createGroupAddress(onOff));
		return this;
	}

	/**
	 * Will listen for telegrams on the given GA which are considered dim start and dim stop (1bit boolean) telegrams for starting the dim sequence. This GA does NOT
	 * WORK WITH PERCENTAGES. When a telegram is received on this GA that is '1' or 'true', dimming will automatically start. It will only stop when a new telegram is
	 * received that is '0' or 'false'. Mostly this will be the dim FO of a KNX taster that will be bound to this GA. The dim FO will automatically send a '1' telegram
	 * when the user pushes (and keeps pushing) the button longer than x msec the button goes to dimming mode and the dim FO will send a '1' to this GA, meaning 'start
	 * dimming'. When the user releases the button, the FO will automatically send a 'on release' telegram being '0' which will make the dimming stop at te current value
	 */
	public DimmerBuilder inputGroupAddressForDimStartAndStop(String dim) {
// Path: src/main/java/be/error/rpi/config/RunConfig.java
// public static RunConfig getInstance() {
// 	if (runConfig == null) {
// 		throw new IllegalStateException("Initialize first");
// 	}
// 	return runConfig;
// }
// 
// Path: src/main/java/be/error/rpi/knx/Support.java
// public static GroupAddress createGroupAddress(String groupAddress) {
// 	try {
// 		return new GroupAddress(groupAddress);
// 	} catch (KNXException knxException) {
// 		logger.error("Could not create group address from " + groupAddress, knxException);
// 		throw new RuntimeException(knxException);
// 	}
// }
// 
// Path: src/main/java/be/error/types/LocationId.java
// public enum LocationId {
// 
// 	GELIJKVLOERS("Gelijkvloers"),
// 	NACHTHAL("Nachthal"),
// 	BADKAMER("Badkamer"),
// 	DRESSING("Dressing"),
// 	SK1("Slaapkamer1"),
// 	SK2("Slaapkamer2"),
// 	SK3("Slaapkamer3"),
// 	KEUKEN("Keuken"),
// 	EETHOEK("Eethoek"),
// 	INKOMHAL("Inkomhal"),
// 	BERGING("Berging"),
// 	VOORDEUR("Inkom buiten"),
// 	GANG("Gang"),
// 	WC("WC"),
// 	ZITHOEK("Zithoek"),
// 	GARAGE("Garage"),
// 	LZG("LZG"),
// 	AG("AG"),
// 	RZG("RZG"),
// 	VG("VG");
// 
// 	private String dimmerDescription;
// 
// 	LocationId(final String dimmerDescription) {
// 		this.dimmerDescription = dimmerDescription;
// 	}
// }


// Path: src/main/java/be/error/rpi/dac/dimmer/builder/DimmerBuilder.java
import java.util.List;
import java.util.Optional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import tuwien.auto.calimero.GroupAddress;
import be.error.types.LocationId;
import static be.error.rpi.config.RunConfig.getInstance;
import static be.error.rpi.dac.dimmer.builder.DimmerBackend.I2C;
import static be.error.rpi.dac.dimmer.builder.DimmerBackend.LUCID_CONTROL;
import static be.error.rpi.knx.Support.createGroupAddress;
import static java.util.Arrays.asList;
import static java.util.Optional.empty;
import static java.util.Optional.of;
import static java.util.stream.Collectors.toList;
import static org.apache.commons.lang3.StringUtils.isEmpty;
import java.util.ArrayList;


	public DimmerBuilder precenseOperated(String precenseDetectorLock) {
		this.precenseDetectorLock = of(createGroupAddress(precenseDetectorLock));
		return this;
	}

	/**
	 */
	public DimmerBuilder inputGroupAddressForOnOffOverride(String onOffOverride) {
		this.onOffOverride = isEmpty(onOffOverride) ? empty() : of(createGroupAddress(onOffOverride));
		return this;
	}

	/**
	 * Will listen for telegrams on the given GA which are considered on/off (1bit boolean) telegrams for toggling the LED on and off.
	 * Mostly this will be the switch FO of a KNX taster that will be bound to this GA.
	 */
	public DimmerBuilder inputGroupAddressForOnAndOff(String onOff) {
		this.onOff = of(createGroupAddress(onOff));
		return this;
	}

	/**
	 * Will listen for telegrams on the given GA which are considered dim start and dim stop (1bit boolean) telegrams for starting the dim sequence. This GA does NOT
	 * WORK WITH PERCENTAGES. When a telegram is received on this GA that is '1' or 'true', dimming will automatically start. It will only stop when a new telegram is
	 * received that is '0' or 'false'. Mostly this will be the dim FO of a KNX taster that will be bound to this GA. The dim FO will automatically send a '1' telegram
	 * when the user pushes (and keeps pushing) the button longer than x msec the button goes to dimming mode and the dim FO will send a '1' to this GA, meaning 'start
	 * dimming'. When the user releases the button, the FO will automatically send a 'on release' telegram being '0' which will make the dimming stop at te current value
	 */
	public DimmerBuilder inputGroupAddressForDimStartAndStop(String dim) {
		this.dim = of(createGroupAddress(dim));