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 timerRange: ClosedRange<Date>
|
2023-03-02 17:26:29 -08:00
|
|
|
var connected: Bool
|
|
|
|
|
var channelUtilization: Float
|
|
|
|
|
var airtime: Float
|
|
|
|
|
var batteryLevel: UInt32
|
2023-09-07 16:26:25 -07:00
|
|
|
var nodes: Int
|
|
|
|
|
var nodesOnline: Int
|
2023-03-01 23:41:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fixed non-changing properties about your activity go here!
|
|
|
|
|
var nodeNum: Int
|
|
|
|
|
var name: String
|
|
|
|
|
}
|
|
|
|
|
#endif
|