use of me.retrodaredevil.solarthing.type.event.feedback.ImmutableExecutionFeedbackPacket in project solarthing by wildmountainfarms.
the class ExecutingCommandFeedbackActionNode method createAction.
@Override
public Action createAction(ActionEnvironment actionEnvironment) {
SourceEnvironment sourceEnvironment = actionEnvironment.getInjectEnvironment().get(SourceEnvironment.class);
EventReceiverEnvironment eventReceiverEnvironment = actionEnvironment.getInjectEnvironment().get(EventReceiverEnvironment.class);
OpenSource source = sourceEnvironment.getSource();
PacketListReceiverHandler packetListReceiverHandler = eventReceiverEnvironment.getEventPacketListReceiverHandler();
List<Packet> packets = Arrays.asList(new ImmutableExecutionFeedbackPacket(message, category, new OpenSourceExecutionReason(source)));
return Actions.createRunOnce(() -> {
LOGGER.debug("Going to upload an execution feedback packet.");
Instant now = Instant.now();
packetListReceiverHandler.uploadSimple(now, packets);
});
}
Aggregations