Skip to content

Commit

Permalink
Merge pull request #778 from meshtastic/node-detail-role
Browse files Browse the repository at this point in the history
Add device role to node details
  • Loading branch information
garthvh authored Jul 10, 2024
2 parents 333a4e4 + efa32c1 commit ff903d5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Meshtastic/Views/Nodes/Helpers/NodeDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,19 @@ struct NodeDetail: View {
}
}

if let role = node.user?.role, let deviceRole = DeviceRoles(rawValue: Int(role)) {
HStack {
Label {
Text("Role")
} icon: {
Image(systemName: deviceRole.systemName)
.symbolRenderingMode(.multicolor)
}
Spacer()
Text(deviceRole.name)
}
}

if let dm = node.telemetries?.filtered(using: NSPredicate(format: "metricsType == 0")).lastObject as? TelemetryEntity, dm.uptimeSeconds > 0 {
HStack {
Label {
Expand Down

0 comments on commit ff903d5

Please sign in to comment.