Add tdeck SVG

This commit is contained in:
Garth Vander Houwen 2024-12-13 06:40:19 -08:00
parent 940be1e88d
commit 0b61527112
4 changed files with 65 additions and 4 deletions

View file

@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "t-deck.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -176,6 +176,54 @@ enum RegionCodes: Int, CaseIterable, Identifiable {
return 100
}
}
var isCountry: Bool {
switch self {
case .unset:
return false
case .us:
return true
case .eu433:
return false
case .eu868:
return false
case .cn:
return true
case .jp:
return true
case .anz:
return false
case .kr:
return true
case .tw:
return true
case .ru:
return true
case .in:
return true
case .nz865:
return true
case .th:
return true
case .ua433:
return true
case .ua868:
return true
case .lora24:
return false
case .my433:
return true
case .my919:
return true
case .sg923:
return true
case .ph433:
return true
case .ph868:
return true
case .ph915:
return true
}
}
func protoEnumValue() -> Config.LoRaConfig.RegionCode {
switch self {

View file

@ -347,8 +347,8 @@ struct MQTTConfig: View {
nearbyTopics = []
let geocoder = CLGeocoder()
if LocationsHandler.shared.locationsArray.count > 0 {
let region = RegionCodes(rawValue: Int(node?.loRaConfig?.regionCode ?? 0))?.topic
defaultTopic = "msh/" + (region ?? "UNSET")
let region = RegionCodes(rawValue: Int(node?.loRaConfig?.regionCode ?? 0))
defaultTopic = "msh/" + (region?.topic ?? "UNSET")
geocoder.reverseGeocodeLocation(LocationsHandler.shared.locationsArray.first!, completionHandler: {(placemarks, error) in
if let error {
Logger.services.error("Failed to reverse geocode location: \(error.localizedDescription)")
@ -357,8 +357,8 @@ struct MQTTConfig: View {
if let placemarks = placemarks, let placemark = placemarks.first {
let cc = locale.region?.identifier ?? "UNK"
/// Country Topic unless you are US
if placemark.isoCountryCode ?? "unknown" != cc {
/// Country Topic unless your region is a country
if !(region?.isCountry ?? false) {
let countryTopic = defaultTopic + "/" + (placemark.isoCountryCode ?? "")
if !countryTopic.isEmpty {
nearbyTopics.append(countryTopic)