use of me.retrodaredevil.solarthing.solar.outback.fx.ACMode in project solarthing by wildmountainfarms.
the class GeneratorStateEvent method run.
@Override
public void run(MessageSender sender, FragmentedPacketGroup previous, FragmentedPacketGroup current) {
FXStatusPacket fx = OutbackUtil.getMasterFX(current);
if (fx == null)
return;
ACMode mode = fx.getACMode();
final Boolean wasGeneratorOn = this.generatorOn;
if (mode == ACMode.NO_AC) {
this.generatorOn = false;
if (Boolean.TRUE.equals(wasGeneratorOn)) {
sender.sendMessage("Generator has turned off!");
}
} else if (mode == ACMode.AC_USE) {
this.generatorOn = true;
if (Boolean.FALSE.equals(wasGeneratorOn)) {
sender.sendMessage("Generator power being used!");
}
}
}
Aggregations