diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1c0d720f..336b229e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,6 +9,7 @@ on: type: choice description: 'Select version bump type:' options: + - none - patch - minor - major diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift index 5484d214..1e610277 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABCommandOptions.swift @@ -13,5 +13,5 @@ import Foundation public class OpenHABCommandOptions: Decodable { public var command = "" - public var label = "" + public var label: String? = "" } diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift index b881bd56..f0fe5511 100644 --- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift +++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift @@ -118,7 +118,7 @@ public class OpenHABWidget: NSObject, MKAnnotation, Identifiable { public var mappingsOrItemOptions: [OpenHABWidgetMapping] { if mappings.isEmpty, let commandOptions = item?.commandDescription?.commandOptions { - commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label) } + commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label ?? "") } } else if mappings.isEmpty, let stateOptions = item?.stateDescription?.options { stateOptions.map { OpenHABWidgetMapping(command: $0.value, label: $0.label) } } else { diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 600ee55d..2782273f 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -100,7 +100,7 @@ platform :ios do type = options[:bump] - if !options[:isfeaturebuild] + if !options[:isfeaturebuild] && type != 'none' increment_version_number_in_xcodeproj( bump_type: type, xcodeproj: 'openHAB.xcodeproj', diff --git a/openHAB.xcodeproj/project.pbxproj b/openHAB.xcodeproj/project.pbxproj index 875c9414..2ae25261 100644 --- a/openHAB.xcodeproj/project.pbxproj +++ b/openHAB.xcodeproj/project.pbxproj @@ -1643,7 +1643,7 @@ CODE_SIGN_ENTITLEMENTS = openHABIntents/openHABIntents.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1657,7 +1657,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.openHABIntents; @@ -1686,7 +1686,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = PBAPXHRAM9; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = PBAPXHRAM9; @@ -1700,7 +1700,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.openHABIntents; @@ -1727,7 +1727,7 @@ CODE_SIGN_ENTITLEMENTS = NotificationService/NotificationService.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = PBAPXHRAM9; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -1746,7 +1746,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.NotificationService; @@ -1774,7 +1774,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = PBAPXHRAM9; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = PBAPXHRAM9; @@ -1793,7 +1793,7 @@ "@executable_path/../../Frameworks", ); LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.NotificationService; @@ -1820,7 +1820,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1831,7 +1831,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openHABUITests; @@ -1866,7 +1866,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -1877,7 +1877,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openHABUITests; @@ -1911,7 +1911,7 @@ CODE_SIGN_ENTITLEMENTS = "openHABWatch Extension/openHABWatch Extension.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_C_LANGUAGE_STANDARD = "compiler-default"; @@ -1922,7 +1922,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.watchkitapp; @@ -1957,7 +1957,7 @@ "CODE_SIGN_IDENTITY[sdk=watchos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = PBAPXHRAM9; "DEVELOPMENT_TEAM[sdk=watchos*]" = PBAPXHRAM9; @@ -1969,7 +1969,7 @@ "@executable_path/Frameworks", "@executable_path/../../Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app.watchkitapp; @@ -2001,7 +2001,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2012,7 +2012,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.reg-labs.openHABTestsSwift"; @@ -2044,7 +2044,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; CODE_SIGN_STYLE = Automatic; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -2055,7 +2055,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.reg-labs.openHABTestsSwift"; @@ -2203,7 +2203,7 @@ CODE_SIGN_ENTITLEMENTS = openHAB/openHAB.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEVELOPMENT_TEAM = PBAPXHRAM9; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "openHAB/openHAB-Prefix.pch"; @@ -2218,7 +2218,7 @@ "@loader_path/../../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200"; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2247,7 +2247,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CODE_SIGN_STYLE = Manual; - CURRENT_PROJECT_VERSION = 11; + CURRENT_PROJECT_VERSION = 12; DEVELOPMENT_TEAM = PBAPXHRAM9; "DEVELOPMENT_TEAM[sdk=iphoneos*]" = PBAPXHRAM9; GCC_PRECOMPILE_PREFIX_HEADER = YES; @@ -2263,7 +2263,7 @@ "@loader_path/../../Frameworks", ); LIBRARY_SEARCH_PATHS = "$(inherited)"; - MARKETING_VERSION = 3.0.5; + MARKETING_VERSION = 3.0.6; PRODUCT_BUNDLE_IDENTIFIER = org.openhab.app; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; diff --git a/openHAB/OpenHABSitemapViewController.swift b/openHAB/OpenHABSitemapViewController.swift index bfddc625..e02d3ed5 100644 --- a/openHAB/OpenHABSitemapViewController.swift +++ b/openHAB/OpenHABSitemapViewController.swift @@ -340,7 +340,12 @@ class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCel return sitemapPageCodingData.openHABSitemapPage }() } catch { + //Printing the error is the only way to actually get the real issue, localizedDescription is pretty useless here + print(error) os_log("Should not throw %{PUBLIC}@", log: OSLog.remoteAccess, type: .error, error.localizedDescription) + DispatchQueue.main.async { + self.showPopupMessage(seconds: 5, title: NSLocalizedString("error", comment: ""), message: error.localizedDescription, theme: .error) + } } currentPage = openHABSitemapPage diff --git a/openHAB/OpenHABWebViewController.swift b/openHAB/OpenHABWebViewController.swift index e0cbb224..6ac6533a 100644 --- a/openHAB/OpenHABWebViewController.swift +++ b/openHAB/OpenHABWebViewController.swift @@ -224,6 +224,7 @@ class OpenHABWebViewController: OpenHABViewController { // adds: window.webkit.messageHandlers.xxxx.postMessage to JS env config.userContentController.add(self, name: "Native") config.userContentController.addUserScript(WKUserScript(source: js, injectionTime: .atDocumentStart, forMainFrameOnly: false)) + let webView = WKWebView(frame: view.bounds, configuration: config) // Alow rotation of webview webView.autoresizingMask = [.flexibleWidth, .flexibleHeight] @@ -233,6 +234,10 @@ class OpenHABWebViewController: OpenHABViewController { // support dark mode and avoid white flashing when loading webView.isOpaque = false webView.backgroundColor = UIColor.clear + if UIDevice.current.userInterfaceIdiom == .pad { + // since ios 13 Safari sets the user agent to desktop mode on iPads so the view renders correctly with larger screens + webView.customUserAgent = "Mozilla/5.0 (iPad; CPU OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1" + } if #available(iOS 16.4, *) { webView.isInspectable = true } diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift index 8e0c798b..051ea2e2 100644 --- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift +++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift @@ -95,7 +95,7 @@ class ObservableOpenHABWidget: NSObject, MKAnnotation, Identifiable, ObservableO var mappingsOrItemOptions: [OpenHABWidgetMapping] { if mappings.isEmpty, let commandOptions = item?.commandDescription?.commandOptions { - commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label) } + commandOptions.map { OpenHABWidgetMapping(command: $0.command, label: $0.label ?? "") } } else if mappings.isEmpty, let stateOptions = item?.stateDescription?.options { stateOptions.map { OpenHABWidgetMapping(command: $0.value, label: $0.label) } } else {