use of me.retrodaredevil.solarthing.type.closed.meta.DeviceInfoPacket in project solarthing by wildmountainfarms.
the class SolarThingGraphQLMetaService method getFragmentDeviceInfo.
@GraphQLQuery(name = "fragmentDeviceInfo")
@Nullable
public DeviceInfoPacket getFragmentDeviceInfo(@GraphQLContext SimplePacketNode packetNode) {
int fragmentId = packetNode.getFragmentId();
MetaDatabase metaDatabase = simpleQueryHandler.queryMeta();
for (TargetedMetaPacket targetedMetaPacket : metaDatabase.getMeta(packetNode.getDateMillis(), fragmentId)) {
if (targetedMetaPacket instanceof DeviceInfoPacket) {
return (DeviceInfoPacket) targetedMetaPacket;
}
}
return null;
}
Aggregations