Meshtastic-Apple/Meshtastic/Extensions/CoreData/StoreForwardConfigEntityExtension.swift
2026-04-16 12:10:00 -07:00

21 lines
656 B
Swift

import SwiftData
import MeshtasticProtobufs
extension StoreForwardConfigEntity {
convenience init(config: ModuleConfig.StoreForwardConfig) {
self.init()
self.enabled = config.enabled
self.heartbeat = config.heartbeat
self.records = Int32(config.records)
self.historyReturnMax = Int32(config.historyReturnMax)
self.historyReturnWindow = Int32(config.historyReturnWindow)
}
func update(with config: ModuleConfig.StoreForwardConfig) {
enabled = config.enabled
heartbeat = config.heartbeat
records = Int32(config.records)
historyReturnMax = Int32(config.historyReturnMax)
historyReturnWindow = Int32(config.historyReturnWindow)
}
}