public void fire() throws IllegalActionException {
super.fire();
// Check whether a command is ready
if (_commandReady()) {
Command sensedCommand = _getCommand();
byte function = sensedCommand.getFunctionByte();
byte functionOfInterest = Command.BRIGHT;
String commandValue = command.stringValue();
if (!commandValue.equals("BRIGHT")) {
functionOfInterest = Command.DIM;
}
String sensedHouseCode = "" + sensedCommand.getHouseCode();
int sensedUnitCode = sensedCommand.getUnitCode();
String houseCodeValue = houseCode.stringValue();
int unitCodeValue = ((IntToken) unitCode.getToken()).intValue();
if (sensedHouseCode.equals(houseCodeValue)
&& (sensedUnitCode == unitCodeValue)
&& (function == functionOfInterest)) {
level.send(0, new IntToken(sensedCommand.getLevel()));
} else {
level.send(0, _NO_COMMAND_TOKEN);
}
} else {
level.send(0, _NO_COMMAND_TOKEN);