Meshtastic-Apple/Widgets/MeshActivityAttributes.swift

30 lines
649 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 timerRange: ClosedRange<Date>
var connected: Bool
var channelUtilization: Float
var airtime: Float
var batteryLevel: UInt32
2023-03-01 23:41:10 -08:00
}
// Fixed non-changing properties about your activity go here!
var nodeNum: Int
var name: String
}
#endif