Sure:
package Extensions;
import com.tinkerforge.*;
import com.tinkerforge.IPConnection.TimeoutException;
public class DualRelay extends BrickletDualRelay
{
public DualRelay(String uid)
{
super(uid);
}
public void switchState(int relay) throws TimeoutException
{
boolean relay1 = getState().relay1;
boolean relay2 = getState().relay2;
if(relay == 0)
{
if (relay1)
{
setState(false, relay2);
} else {
setState(true, relay2);
}
} else if(relay == 1)
{
if(relay2)
{
setState(relay1, false);
} else {
setState(relay1, true);
}
}
}
}
I've made a git repository for the extensions at Bitbucket.org:
https://bitbucket.org/Antonas/tinkerforge-extensions
If any of you want an invite, send me a PM.