Meshtastic-Apple/Widgets/MeshActivityAttributes.swift

34 lines
768 B
Swift
Raw Normal View History

2023-03-01 23:41:10 -08:00
//
// MeshActivityAttributes.swift
// Meshtastic
//
// Created by Garth Vander Houwen on 3/1/23.
//
#if canImport(ActivityKit)
import ActivityKit
import WidgetKit
import SwiftUI
struct MeshActivityAttributes: ActivityAttributes {
2023-03-02 22:58:49 -08:00
public typealias MeshActivityStatus = ContentState
2023-03-01 23:41:10 -08:00
public struct ContentState: Codable, Hashable {
// Dynamic stateful properties about your activity go here!
var uptimeSeconds: UInt32
var channelUtilization: Float
var airtime: Float
var sentPackets: UInt32
var receivedPackets: UInt32
var badReceivedPackets: UInt32
var nodesOnline: UInt32
var totalNodes: UInt32
var timerRange: ClosedRange<Date>
2023-03-01 23:41:10 -08:00
}
// Fixed non-changing properties about your activity go here!
var nodeNum: Int
var name: String
}
#endif