diff --git a/.github/workflows/githubrelease.yml b/.github/workflows/githubrelease.yml
index 853d5c1cc..08a63a024 100644
--- a/.github/workflows/githubrelease.yml
+++ b/.github/workflows/githubrelease.yml
@@ -5,7 +5,7 @@ on:
jobs:
set_github_release:
- runs-on: macos-12
+ runs-on: macos-13
steps:
- name: checkout
uses: actions/checkout@v3
diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml
index 574f67d9b..5ab4818bf 100644
--- a/.github/workflows/pull_requests.yml
+++ b/.github/workflows/pull_requests.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: macos-12
if: ${{ github.event.pull_request.draft == false }}
steps:
- - uses: maxim-lobanov/setup-xcode@v1.1
+ - uses: maxim-lobanov/setup-xcode@v1.5.1
with:
xcode-version: latest-stable
@@ -25,7 +25,6 @@ jobs:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60
- uses: maierj/fastlane-action@v2.0.1
+ uses: maierj/fastlane-action@v2.3.0
with:
lane: unittests
- skip-tracking: true
diff --git a/.swiftlint.yml b/.swiftlint.yml
index 54404646e..d9cc6f35e 100644
--- a/.swiftlint.yml
+++ b/.swiftlint.yml
@@ -3,7 +3,6 @@ opt_in_rules:
- empty_count
- redundant_type_annotation
- trailing_closure
- - unused_import
- implicit_return
- multiline_function_chains
- anyobject_protocol
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e6578138b..28ed7ec96 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
+## [Version 2.4.58, Build 1580410536] - 2023-05-31Z
+
+- Implement forceAsItem support for Charts in Sitemaps
+- Fixes #689
+
## [Version 2.4.53, Build 1580410519] - 2022-08-27Z
- Fixes an incompatibility with openHAB 1.x systems
diff --git a/Gemfile.lock b/Gemfile.lock
index d894f1a49..36e0aeb3e 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -8,7 +8,7 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
- aws-partitions (1.659.0)
+ aws-partitions (1.660.0)
aws-sdk-core (3.167.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
@@ -66,7 +66,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
- fastlane (2.210.1)
+ fastlane (2.211.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
@@ -219,4 +219,4 @@ DEPENDENCIES
fastlane-plugin-versioning
BUNDLED WITH
- 2.3.24
+ 2.3.11
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/DataExtension.swift b/OpenHABCore/Sources/OpenHABCore/Model/DataExtension.swift
index af1146d34..5e9c20c4e 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/DataExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/DataExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/DataObject.swift b/OpenHABCore/Sources/OpenHABCore/Model/DataObject.swift
index 82e8bad8c..0ac36900f 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/DataObject.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/DataObject.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/NumberState.swift b/OpenHABCore/Sources/OpenHABCore/Model/NumberState.swift
index c5aca256e..9b906cc28 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/NumberState.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/NumberState.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABItem.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABItem.swift
index 776dc1d74..3bdfd5b19 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABItem.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABItem.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABLinkedPage.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABLinkedPage.swift
index 84f6ba694..58ac1639c 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABLinkedPage.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABLinkedPage.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift
index 77d4be37d..5363ef993 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABOptions.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABServerProperties.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABServerProperties.swift
index bc6cb2bec..21830cb6c 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABServerProperties.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABServerProperties.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemap.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemap.swift
index e1681d6ef..05dfa09a5 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemap.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemap.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift
index f205b8797..f0760b2a6 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABSitemapPage.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABStateDescription.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABStateDescription.swift
index ec2fbabad..ade7b2210 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABStateDescription.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABStateDescription.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABUiTile.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABUiTile.swift
index 4a04c4b4c..3e602a331 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABUiTile.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABUiTile.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift
index aedc37403..86971fb8e 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidget.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -91,6 +91,7 @@ public class OpenHABWidget: NSObject, MKAnnotation, Identifiable {
public var text = ""
public var legend: Bool?
public var encoding = ""
+ public var forceAsItem: Bool?
public var item: OpenHABItem?
public var linkedPage: OpenHABLinkedPage?
public var mappings: [OpenHABWidgetMapping] = []
@@ -108,7 +109,7 @@ public class OpenHABWidget: NSObject, MKAnnotation, Identifiable {
// Text between square brackets
public var labelValue: String? {
// Swift 5 raw strings
- let regex = try? NSRegularExpression(pattern: #"\[(.*?)\]"#, options: [])
+ let regex = try? NSRegularExpression(pattern: #"\[(.*?)\]"#, options: [.dotMatchesLineSeparators])
guard let match = regex?.firstMatch(in: label, options: [], range: NSRange(location: 0, length: (label as NSString).length)) else { return nil }
guard let range = Range(match.range(at: 1), in: label) else { return nil }
return String(label[range])
@@ -212,7 +213,7 @@ extension OpenHABWidget.WidgetType: UnknownCaseRepresentable {
extension OpenHABWidget {
// This is an ugly initializer
- convenience init(widgetId: String, label: String, icon: String, type: WidgetType, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABLinkedPage?, mappings: [OpenHABWidgetMapping], widgets: [OpenHABWidget], visibility: Bool?, switchSupport: Bool?) {
+ convenience init(widgetId: String, label: String, icon: String, type: WidgetType, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABLinkedPage?, mappings: [OpenHABWidgetMapping], widgets: [OpenHABWidget], visibility: Bool?, switchSupport: Bool?, forceAsItem: Bool?) {
self.init()
id = widgetId
self.widgetId = widgetId
@@ -250,6 +251,8 @@ extension OpenHABWidget {
self.step = abs(self.step)
self.visibility = visibility ?? true
self.switchSupport = switchSupport ?? false
+
+ self.forceAsItem = forceAsItem
}
convenience init(xml xmlElement: XMLElement) {
@@ -322,6 +325,7 @@ public extension OpenHABWidget {
let widgets: [OpenHABWidget.CodingData]
let visibility: Bool?
let switchSupport: Bool?
+ let forceAsItem: Bool?
}
}
@@ -329,7 +333,7 @@ public extension OpenHABWidget {
extension OpenHABWidget.CodingData {
var openHABWidget: OpenHABWidget {
let mappedWidgets = widgets.map(\.openHABWidget)
- return OpenHABWidget(widgetId: widgetId, label: label, icon: icon, type: type, url: url, period: period, minValue: minValue, maxValue: maxValue, step: step, refresh: refresh, height: height, isLeaf: isLeaf, iconColor: iconColor, labelColor: labelcolor, valueColor: valuecolor, service: service, state: state, text: text, legend: legend, encoding: encoding, item: item?.openHABItem, linkedPage: linkedPage, mappings: mappings, widgets: mappedWidgets, visibility: visibility, switchSupport: switchSupport)
+ return OpenHABWidget(widgetId: widgetId, label: label, icon: icon, type: type, url: url, period: period, minValue: minValue, maxValue: maxValue, step: step, refresh: refresh, height: height, isLeaf: isLeaf, iconColor: iconColor, labelColor: labelcolor, valueColor: valuecolor, service: service, state: state, text: text, legend: legend, encoding: encoding, item: item?.openHABItem, linkedPage: linkedPage, mappings: mappings, widgets: mappedWidgets, visibility: visibility, switchSupport: switchSupport, forceAsItem: forceAsItem)
}
}
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidgetMapping.swift b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidgetMapping.swift
index 6b2199716..373014c09 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidgetMapping.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/OpenHABWidgetMapping.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Model/Sequence+KeyPath.swift b/OpenHABCore/Sources/OpenHABCore/Model/Sequence+KeyPath.swift
index 4064413c6..a2d24ed34 100644
--- a/OpenHABCore/Sources/OpenHABCore/Model/Sequence+KeyPath.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Model/Sequence+KeyPath.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift b/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift
index 9dedf6e5e..78dd94dd1 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/ClientCertificateManager.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Collection+SafeAccess.swift b/OpenHABCore/Sources/OpenHABCore/Util/Collection+SafeAccess.swift
index 19fa2f0f6..8e29a4e9d 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/Collection+SafeAccess.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/Collection+SafeAccess.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/DateFormatterExtension.swift b/OpenHABCore/Sources/OpenHABCore/Util/DateFormatterExtension.swift
index 89d24e1b7..57005ac18 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/DateFormatterExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/DateFormatterExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/DoubleExtension.swift b/OpenHABCore/Sources/OpenHABCore/Util/DoubleExtension.swift
index 1850086ab..7cbee9994 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/DoubleExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/DoubleExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift b/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift
index 2f80ad0d8..29fb5fe39 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -114,7 +114,7 @@ public extension Endpoint {
}
// swiftlint:disable:next function_parameter_count
- static func chart(rootUrl: String, period: String?, type: OpenHABItem.ItemType?, service: String?, name: String?, legend: Bool?, theme: ChartStyle = .light) -> Endpoint {
+ static func chart(rootUrl: String, period: String?, type: OpenHABItem.ItemType?, service: String?, name: String?, legend: Bool?, theme: ChartStyle = .light, forceAsItem: Bool?) -> Endpoint {
let random = Int.random(in: 0 ..< 1000)
var endpoint = Endpoint(
baseURL: rootUrl,
@@ -125,7 +125,9 @@ public extension Endpoint {
]
)
- if type == .group {
+ let forceAsItem = forceAsItem ?? false
+
+ if type == .group, !forceAsItem {
endpoint.queryItems.append(URLQueryItem(name: "groups", value: name))
} else {
endpoint.queryItems.append(URLQueryItem(name: "items", value: name))
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Equatable.swift b/OpenHABCore/Sources/OpenHABCore/Util/Equatable.swift
index d1a8ebe5e..f67477fe5 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/Equatable.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/Equatable.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Future.swift b/OpenHABCore/Sources/OpenHABCore/Util/Future.swift
index b99c4c3d8..77a0080b2 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/Future.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/Future.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/KeyedDecodingContainerProtocolExtension.swift b/OpenHABCore/Sources/OpenHABCore/Util/KeyedDecodingContainerProtocolExtension.swift
index 9ef78d856..151a4e446 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/KeyedDecodingContainerProtocolExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/KeyedDecodingContainerProtocolExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift b/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift
index c29f0cb51..573b8f6f3 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/NetworkConnection.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OSLogExtension.swift b/OpenHABCore/Sources/OpenHABCore/Util/OSLogExtension.swift
index 39b12173d..da121d43e 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/OSLogExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/OSLogExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABAccessTokenAdapter.swift b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABAccessTokenAdapter.swift
index a7ae4d036..5b6b35231 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABAccessTokenAdapter.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABAccessTokenAdapter.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift
index 3792407ad..92aa6085d 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABItemCache.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift
index bccb31f09..a78cd4148 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABLogger.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABSessionDelegate.swift b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABSessionDelegate.swift
index b933f3d27..48b26251a 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/OpenHABSessionDelegate.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/OpenHABSessionDelegate.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -16,6 +16,7 @@ import Foundation
// The alternative method is explained by jshier in https://github.com/Alamofire/Alamofire/issues/2886#issuecomment-517951747
class OpenHABSessionDelegate: SessionDelegate {
+ // swiftlint:disable:next large_tuple
typealias ChallengeEvaluation = (disposition: URLSession.AuthChallengeDisposition, credential: URLCredential?, error: AFError?)
var eventMonitor: EventMonitor?
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift b/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift
index a59e2a33b..b73d4773a 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -91,6 +91,7 @@ public enum Preferences {
@UserDefault("sendCrashReports", defaultValue: false) public static var sendCrashReports: Bool
@UserDefault("sortSitemapsBy", defaultValue: 0) public static var sortSitemapsby: Int
@UserDefault("defaultMainUIPath", defaultValue: "") public static var defaultMainUIPath: String
+ @UserDefault("alwaysAllowWebRTC", defaultValue: false) public static var alwaysAllowWebRTC: Bool
// MARK: - Private
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/ServerCertificateManager.swift b/OpenHABCore/Sources/OpenHABCore/Util/ServerCertificateManager.swift
index 7b36f431a..a9aac69ed 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/ServerCertificateManager.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/ServerCertificateManager.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/StringExtension.swift b/OpenHABCore/Sources/OpenHABCore/Util/StringExtension.swift
index b201b7493..cc8808b75 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/StringExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/StringExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/UIColorExtension.swift b/OpenHABCore/Sources/OpenHABCore/Util/UIColorExtension.swift
index f319a4139..bd9d6ceb0 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/UIColorExtension.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/UIColorExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Sources/OpenHABCore/Util/UnknownCaseRepresentable.swift b/OpenHABCore/Sources/OpenHABCore/Util/UnknownCaseRepresentable.swift
index c24cf6957..281460ee3 100644
--- a/OpenHABCore/Sources/OpenHABCore/Util/UnknownCaseRepresentable.swift
+++ b/OpenHABCore/Sources/OpenHABCore/Util/UnknownCaseRepresentable.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/ItemCacheTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/ItemCacheTests.swift
index 6d7505b2b..6a3b8f3d4 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/ItemCacheTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/ItemCacheTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/JSONData.swift b/OpenHABCore/Tests/OpenHABCoreTests/JSONData.swift
index ed4398399..5cee6a181 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/JSONData.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/JSONData.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/JSONParserTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/JSONParserTests.swift
index 0534ad264..a52f5bf55 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/JSONParserTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/JSONParserTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/MockURLProtocol.swift b/OpenHABCore/Tests/OpenHABCoreTests/MockURLProtocol.swift
index 3e611f809..652510ad2 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/MockURLProtocol.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/MockURLProtocol.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/NumberStateTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/NumberStateTests.swift
index 6e4d29349..cd44a8ca9 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/NumberStateTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/NumberStateTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/OpenHABCoreGeneralTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/OpenHABCoreGeneralTests.swift
index e5ec2f983..5b80d3f04 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/OpenHABCoreGeneralTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/OpenHABCoreGeneralTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/ParseAsTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/ParseAsTests.swift
index f9e250945..240c667b1 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/ParseAsTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/ParseAsTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/RESTAPITests.swift b/OpenHABCore/Tests/OpenHABCoreTests/RESTAPITests.swift
index 97a69c568..0374856ae 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/RESTAPITests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/RESTAPITests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/UserDefaultsTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/UserDefaultsTests.swift
index a71d815b8..9e290c514 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/UserDefaultsTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/UserDefaultsTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/XMLData.swift b/OpenHABCore/Tests/OpenHABCoreTests/XMLData.swift
index 30750f53b..9dfc29031 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/XMLData.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/XMLData.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/OpenHABCore/Tests/OpenHABCoreTests/XMLParserTests.swift b/OpenHABCore/Tests/OpenHABCoreTests/XMLParserTests.swift
index 7aefa1910..711411413 100644
--- a/OpenHABCore/Tests/OpenHABCoreTests/XMLParserTests.swift
+++ b/OpenHABCore/Tests/OpenHABCoreTests/XMLParserTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/README.md b/README.md
index 1fe7c5aef..fcaa4b58c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
-
+
openHAB client for iOS
diff --git a/fastlane/Fastfile b/fastlane/Fastfile
index 120fce128..d44df67b3 100644
--- a/fastlane/Fastfile
+++ b/fastlane/Fastfile
@@ -57,7 +57,7 @@ platform :ios do
scheme: 'openHABTestsSwift',
xcargs: '-skipPackagePluginValidation',
testplan: 'openHABTests',
- devices: ['iPhone 13 Pro'],
+ devices: ['iPhone 14 Pro'],
clean: true
)
end
@@ -176,7 +176,7 @@ platform :ios do
)
push_to_git_remote(tags: true)
sh 'git checkout develop'
-
+
if is_ci?
set_github_release(
api_bearer: ENV['FASTLANE_GITHUB_RELEASE_API_BEARER'],
@@ -187,7 +187,7 @@ platform :ios do
commitish: 'main'
# upload_assets: no assets supported
)
- else
+ else
set_github_release(
api_token: ENV['GITHUB_API_TOKEN'],
repository_name: 'openhab/openhab-ios',
@@ -198,7 +198,7 @@ platform :ios do
# upload_assets: no assets supported
)
end
-
+
end
end
diff --git a/fastlane/SnapshotHelper.swift b/fastlane/SnapshotHelper.swift
index 40ec58f99..e97caeeee 100644
--- a/fastlane/SnapshotHelper.swift
+++ b/fastlane/SnapshotHelper.swift
@@ -1,14 +1,3 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
-//
-// See the NOTICE file(s) distributed with this work for additional
-// information.
-//
-// This program and the accompanying materials are made available under the
-// terms of the Eclipse Public License 2.0 which is available at
-// http://www.eclipse.org/legal/epl-2.0
-//
-// SPDX-License-Identifier: EPL-2.0
-
// -----------------------------------------------------
// IMPORTANT: When modifying this file, make sure to
// increment the version number at the very
diff --git a/openHAB.xcodeproj/project.pbxproj b/openHAB.xcodeproj/project.pbxproj
index b0af4a9de..3fe6531cd 100644
--- a/openHAB.xcodeproj/project.pbxproj
+++ b/openHAB.xcodeproj/project.pbxproj
@@ -1517,7 +1517,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
- CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -1531,7 +1531,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
- MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openhab.openHABIntents;
@@ -1560,7 +1560,7 @@
CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -1573,7 +1573,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
- MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openhab.openHABIntents;
@@ -1618,6 +1618,7 @@
CURRENT_PROJECT_VERSION = 1580410529;
CURRENT_PROJECT_VERSION = 1580410531;
CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -1646,6 +1647,7 @@
MARKETING_VERSION = 2.4.55;
MARKETING_VERSION = 2.4.56;
MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openHABUITests;
@@ -1694,6 +1696,7 @@
CURRENT_PROJECT_VERSION = 1580410529;
CURRENT_PROJECT_VERSION = 1580410531;
CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -1722,6 +1725,7 @@
MARKETING_VERSION = 2.4.55;
MARKETING_VERSION = 2.4.56;
MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openHABUITests;
@@ -1988,7 +1992,7 @@
CURRENT_PROJECT_VERSION = 1580410446;
CURRENT_PROJECT_VERSION = 1580410455;
"CODE_SIGN_STYLE[sdk=*]" = Automatic;
- CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
@@ -2001,7 +2005,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
- MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openhab.watchkitapp;
@@ -2053,6 +2057,7 @@
CURRENT_PROJECT_VERSION = 1580410529;
CURRENT_PROJECT_VERSION = 1580410531;
CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = "compiler-default";
@@ -2065,7 +2070,7 @@
"@executable_path/Frameworks",
"@executable_path/../../Frameworks",
);
- MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openhab.watchkitapp;
@@ -2257,6 +2262,7 @@
CURRENT_PROJECT_VERSION = 1580410529;
CURRENT_PROJECT_VERSION = 1580410531;
CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -2285,6 +2291,7 @@
MARKETING_VERSION = 2.4.55;
MARKETING_VERSION = 2.4.56;
MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.reg-labs.openHABTestsSwift";
@@ -2334,6 +2341,7 @@
CURRENT_PROJECT_VERSION = 1580410529;
CURRENT_PROJECT_VERSION = 1580410531;
CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_C_LANGUAGE_STANDARD = gnu11;
@@ -2362,6 +2370,7 @@
MARKETING_VERSION = 2.4.55;
MARKETING_VERSION = 2.4.56;
MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
PRODUCT_BUNDLE_IDENTIFIER = "com.reg-labs.openHABTestsSwift";
@@ -2522,6 +2531,7 @@
CURRENT_PROJECT_VERSION = 1580410529;
CURRENT_PROJECT_VERSION = 1580410531;
CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -2555,6 +2565,7 @@
MARKETING_VERSION = 2.4.55;
MARKETING_VERSION = 2.4.56;
MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
OTHER_SWIFT_FLAGS = "$(inherited) -DDEBUG -Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200";
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openhab;
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -2588,7 +2599,7 @@
CODE_SIGN_IDENTITY = "Apple Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
- CURRENT_PROJECT_VERSION = 1580410532;
+ CURRENT_PROJECT_VERSION = 1580410536;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = PBAPXHRAM9;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
@@ -2622,6 +2633,7 @@
MARKETING_VERSION = 2.4.55;
MARKETING_VERSION = 2.4.56;
MARKETING_VERSION = 2.4.57;
+ MARKETING_VERSION = 2.4.58;
PRODUCT_BUNDLE_IDENTIFIER = es.spaphone.openhab;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
@@ -2710,8 +2722,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/weakfl/SwiftLintPlugin.git";
requirement = {
- branch = main;
- kind = branch;
+ kind = upToNextMajorVersion;
+ minimumVersion = 0.50.3;
};
};
937E4480270B378F00A98C26 /* XCRemoteSwiftPackageReference "Fuzi.git" */ = {
diff --git a/openHAB.xcworkspace/xcshareddata/swiftpm/Package.resolved b/openHAB.xcworkspace/xcshareddata/swiftpm/Package.resolved
index 6b34bcbf6..d6c4f01a7 100644
--- a/openHAB.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/openHAB.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -213,17 +213,17 @@
"repositoryURL": "https://github.com/weakfl/SwiftFormatPlugin.git",
"state": {
"branch": null,
- "revision": "503a58bf51ee8b40cb53a83a84b13f3daf43ff42",
- "version": "0.50.3"
+ "revision": "749f67e06cddc05bfbff8e1b1a17f2c4c8e150eb",
+ "version": "0.50.7"
}
},
{
"package": "SwiftLintPlugin",
"repositoryURL": "https://github.com/weakfl/SwiftLintPlugin.git",
"state": {
- "branch": "main",
- "revision": "efa3f94160b65329b2a2596033e05cfe66286a23",
- "version": null
+ "branch": null,
+ "revision": "8cbc2433be11093a4c9c243eafc101cb5ada820b",
+ "version": "0.50.3"
}
},
{
diff --git a/openHAB/AppDelegate.swift b/openHAB/AppDelegate.swift
index 3794c8527..d17d186a5 100644
--- a/openHAB/AppDelegate.swift
+++ b/openHAB/AppDelegate.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/ColorPickerUITableViewCell.swift b/openHAB/ColorPickerUITableViewCell.swift
index c5996a3fd..7b7433b2c 100644
--- a/openHAB/ColorPickerUITableViewCell.swift
+++ b/openHAB/ColorPickerUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/ColorPickerViewController.swift b/openHAB/ColorPickerViewController.swift
index b315438ec..a5cdbc22b 100644
--- a/openHAB/ColorPickerViewController.swift
+++ b/openHAB/ColorPickerViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -62,6 +62,7 @@ class ColorPickerViewController: DefaultColorPickerViewController {
}
func sendColorUpdate(color: UIColor) {
+ // swiftlint:disable:next large_tuple
var (hue, saturation, brightness, alpha): (CGFloat, CGFloat, CGFloat, CGFloat) = (0.0, 0.0, 0.0, 0.0)
color.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha)
diff --git a/openHAB/DrawerUITableViewCell.swift b/openHAB/DrawerUITableViewCell.swift
index 0b4cffc13..2ebb6a2f8 100644
--- a/openHAB/DrawerUITableViewCell.swift
+++ b/openHAB/DrawerUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/DynamicButtonStyleBell.swift b/openHAB/DynamicButtonStyleBell.swift
index 84188fed7..f7571722e 100644
--- a/openHAB/DynamicButtonStyleBell.swift
+++ b/openHAB/DynamicButtonStyleBell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/DynamicButtonStyleGear.swift b/openHAB/DynamicButtonStyleGear.swift
index 33f218fd3..5610aa135 100644
--- a/openHAB/DynamicButtonStyleGear.swift
+++ b/openHAB/DynamicButtonStyleGear.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/FrameUITableViewCell.swift b/openHAB/FrameUITableViewCell.swift
index 0ce64315d..ee76ab09e 100644
--- a/openHAB/FrameUITableViewCell.swift
+++ b/openHAB/FrameUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/GenericUITableViewCell.swift b/openHAB/GenericUITableViewCell.swift
index f66a6de97..15b99c53c 100644
--- a/openHAB/GenericUITableViewCell.swift
+++ b/openHAB/GenericUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -17,8 +17,17 @@ protocol GenericCellCacheProtocol: UITableViewCell {
func invalidateCache()
}
+protocol GenericUITableViewCellTouchEventDelegate: AnyObject {
+ func touchDown()
+ func touchUp()
+}
+
class GenericUITableViewCell: UITableViewCell {
private var _widget: OpenHABWidget!
+
+ // optional event callback if table cells neeed to notify on touch up or down events
+ weak var touchEventDelegate: GenericUITableViewCellTouchEventDelegate?
+
var widget: OpenHABWidget! {
get {
_widget
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/Contents.json b/openHAB/Images.xcassets/AppIcon.appiconset/Contents.json
index 0e6af4b0b..b3f44eb29 100644
--- a/openHAB/Images.xcassets/AppIcon.appiconset/Contents.json
+++ b/openHAB/Images.xcassets/AppIcon.appiconset/Contents.json
@@ -1,116 +1,14 @@
{
"images" : [
{
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "icon_20pt@2x-1.png",
- "scale" : "2x"
- },
- {
- "size" : "20x20",
- "idiom" : "iphone",
- "filename" : "icon_20pt@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "icon_29pt@2x-1.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "iphone",
- "filename" : "icon_29pt@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "icon_40pt@2x-1.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "iphone",
- "filename" : "icon_40pt@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "icon_60pt@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "60x60",
- "idiom" : "iphone",
- "filename" : "icon_60pt@3x.png",
- "scale" : "3x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "icon_20pt.png",
- "scale" : "1x"
- },
- {
- "size" : "20x20",
- "idiom" : "ipad",
- "filename" : "icon_20pt@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "icon_29pt.png",
- "scale" : "1x"
- },
- {
- "size" : "29x29",
- "idiom" : "ipad",
- "filename" : "icon_29pt@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "icon_40pt.png",
- "scale" : "1x"
- },
- {
- "size" : "40x40",
- "idiom" : "ipad",
- "filename" : "icon_40pt@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "icon_76pt.png",
- "scale" : "1x"
- },
- {
- "size" : "76x76",
- "idiom" : "ipad",
- "filename" : "icon_76pt@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "83.5x83.5",
- "idiom" : "ipad",
- "filename" : "icon_83.5@2x.png",
- "scale" : "2x"
- },
- {
- "size" : "1024x1024",
- "idiom" : "ios-marketing",
"filename" : "Icon.png",
- "scale" : "1x"
+ "idiom" : "universal",
+ "platform" : "ios",
+ "size" : "1024x1024"
}
],
"info" : {
- "version" : 1,
- "author" : "xcode"
+ "author" : "xcode",
+ "version" : 1
}
-}
\ No newline at end of file
+}
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt.png
deleted file mode 100644
index 6a4da9da6..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png
deleted file mode 100644
index a018d991c..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@2x-1.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@2x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@2x.png
deleted file mode 100644
index a018d991c..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@2x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@3x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@3x.png
deleted file mode 100644
index 0a762e088..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_20pt@3x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt.png
deleted file mode 100644
index 258267356..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png
deleted file mode 100644
index cdb3748a6..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@2x-1.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@2x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@2x.png
deleted file mode 100644
index cdb3748a6..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@2x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@3x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@3x.png
deleted file mode 100644
index a344bcc27..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_29pt@3x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt.png
deleted file mode 100644
index a018d991c..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png
deleted file mode 100644
index b5b074799..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@2x-1.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@2x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@2x.png
deleted file mode 100644
index b5b074799..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@2x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@3x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@3x.png
deleted file mode 100644
index eff9bb752..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_40pt@3x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_60pt@2x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_60pt@2x.png
deleted file mode 100644
index eff9bb752..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_60pt@2x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_60pt@3x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_60pt@3x.png
deleted file mode 100644
index 737961575..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_60pt@3x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_76pt.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_76pt.png
deleted file mode 100644
index bcf20aed5..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_76pt.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_76pt@2x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_76pt@2x.png
deleted file mode 100644
index 0e0fdd2f0..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_76pt@2x.png and /dev/null differ
diff --git a/openHAB/Images.xcassets/AppIcon.appiconset/icon_83.5@2x.png b/openHAB/Images.xcassets/AppIcon.appiconset/icon_83.5@2x.png
deleted file mode 100644
index 21a25393c..000000000
Binary files a/openHAB/Images.xcassets/AppIcon.appiconset/icon_83.5@2x.png and /dev/null differ
diff --git a/openHAB/Main.storyboard b/openHAB/Main.storyboard
index b6a621d9c..fd3790ea0 100644
--- a/openHAB/Main.storyboard
+++ b/openHAB/Main.storyboard
@@ -1,9 +1,9 @@
-
+
-
+
@@ -25,7 +25,7 @@
-
+
@@ -50,20 +50,20 @@
-
+
-
+
@@ -84,14 +84,14 @@
-
+
-
+
-
+
-
+
@@ -151,7 +151,7 @@
-
+
@@ -213,7 +213,7 @@
-
+
@@ -254,7 +254,7 @@
-
+
@@ -269,19 +269,20 @@
+
-
+
-
+
@@ -307,19 +308,19 @@
-
+
-
+
-
+
-
+
@@ -343,7 +344,7 @@
-
+
@@ -361,7 +362,7 @@
-
+
@@ -392,7 +393,7 @@
-
+
@@ -438,12 +439,12 @@
-
+
-
+
@@ -476,7 +477,7 @@
-
+
@@ -498,7 +499,7 @@
-
+
@@ -523,7 +524,7 @@
-
+
@@ -534,7 +535,7 @@
-
+
@@ -580,14 +581,14 @@
-
+
-
+
@@ -595,7 +596,7 @@
-
+
@@ -617,14 +618,14 @@
-
+
-
+
@@ -632,7 +633,7 @@
-
+
@@ -656,14 +657,14 @@
-
+
-
+
@@ -671,7 +672,7 @@
-
+
@@ -696,14 +697,14 @@
-
+
-
+
@@ -711,7 +712,7 @@
-
+
@@ -735,14 +736,14 @@
-
+
-
+
@@ -750,7 +751,7 @@
-
+
@@ -774,14 +775,14 @@
-
+
-
+
@@ -789,7 +790,7 @@
-
+
@@ -815,14 +816,14 @@
-
+
-
+
@@ -830,7 +831,7 @@
-
+
@@ -853,14 +854,14 @@
-
+
-
+
@@ -868,7 +869,7 @@
-
+
@@ -891,14 +892,14 @@
-
+
-
+
@@ -906,11 +907,11 @@
-
+
@@ -936,14 +937,14 @@
-
+
-
+
-
+
@@ -965,26 +966,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
@@ -1009,14 +1048,14 @@
-
+
-
+
-
+
@@ -1036,14 +1075,14 @@
-
+
-
+
@@ -1051,7 +1090,7 @@
-
+
@@ -1074,14 +1113,14 @@
-
+
-
+
-
-
+
+
@@ -1097,22 +1136,22 @@
-
+
-
-
+
+
-
-
+
+
@@ -1129,14 +1168,14 @@
-
+
-
+
@@ -1144,7 +1183,7 @@
-
+
@@ -1165,14 +1204,14 @@
-
+
-
+
@@ -1198,10 +1237,10 @@
-
+
-
+
@@ -1224,10 +1263,10 @@
-
+
-
+
@@ -1250,12 +1289,12 @@
-
+
@@ -1291,20 +1330,20 @@
-
+
-
+
-
+
@@ -1364,7 +1403,7 @@
-
+
@@ -1386,12 +1425,12 @@
-
+
-
+
@@ -1441,7 +1480,7 @@
-
+
@@ -1469,11 +1508,11 @@
-
+
-
+
@@ -1504,7 +1543,7 @@
-
+
@@ -1526,7 +1565,7 @@
-
+
@@ -1540,7 +1579,7 @@
-
+
diff --git a/openHAB/MapViewTableViewCell.swift b/openHAB/MapViewTableViewCell.swift
index 636e09134..906444d24 100644
--- a/openHAB/MapViewTableViewCell.swift
+++ b/openHAB/MapViewTableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/MulticastDelegate.swift b/openHAB/MulticastDelegate.swift
index c1c3e233e..f099eaa4c 100644
--- a/openHAB/MulticastDelegate.swift
+++ b/openHAB/MulticastDelegate.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -22,10 +22,8 @@ class MulticastDelegate {
}
func remove(_ delegateToRemove: T) {
- for delegate in delegates.allObjects.reversed() {
- if delegate === delegateToRemove as AnyObject {
- delegates.remove(delegate)
- }
+ for delegate in delegates.allObjects.reversed() where delegate === delegateToRemove as AnyObject {
+ delegates.remove(delegate)
}
}
diff --git a/openHAB/NewImageTableViewCell.swift b/openHAB/NewImageTableViewCell.swift
index 57c6695b2..15f8640ba 100644
--- a/openHAB/NewImageTableViewCell.swift
+++ b/openHAB/NewImageTableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/NewImageUITableViewCell.swift b/openHAB/NewImageUITableViewCell.swift
index 3c26b482e..11e887921 100644
--- a/openHAB/NewImageUITableViewCell.swift
+++ b/openHAB/NewImageUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -41,7 +41,16 @@ class NewImageUITableViewCell: GenericUITableViewCell {
switch widget.type {
case .chart:
- return .link(url: Endpoint.chart(rootUrl: appData!.openHABRootUrl, period: widget.period, type: widget.item?.type, service: widget.service, name: widget.item?.name, legend: widget.legend, theme: chartStyle).url)
+ return .link(url: Endpoint.chart(
+ rootUrl: appData!.openHABRootUrl,
+ period: widget.period,
+ type: widget.item?.type,
+ service: widget.service,
+ name: widget.item?.name,
+ legend: widget.legend,
+ theme: chartStyle,
+ forceAsItem: widget.forceAsItem
+ ).url)
case .image:
if let item = widget.item {
return widgetPayload(fromItem: item)
@@ -78,15 +87,6 @@ class NewImageUITableViewCell: GenericUITableViewCell {
chartStyle = OHInterfaceStyle.current == .light ? ChartStyle.light : ChartStyle.dark
}
- override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
- super.traitCollectionDidChange(previousTraitCollection)
-
- chartStyle = OHInterfaceStyle.current == .light ? ChartStyle.light : ChartStyle.dark
- if widget.type == .chart {
- loadImage()
- }
- }
-
override func willMove(toSuperview newSuperview: UIView?) {
super.willMove(toSuperview: newSuperview)
@@ -184,6 +184,15 @@ class NewImageUITableViewCell: GenericUITableViewCell {
os_log("Refreshing image on %g seconds schedule", log: .viewCycle, type: .info, Double(widget.refresh) / 1000)
loadImage()
}
+
+ override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
+ super.traitCollectionDidChange(previousTraitCollection)
+
+ chartStyle = OHInterfaceStyle.current == .light ? ChartStyle.light : ChartStyle.dark
+ if widget.type == .chart {
+ loadImage()
+ }
+ }
}
extension NewImageUITableViewCell: GenericCellCacheProtocol {
diff --git a/openHAB/NotificationTableViewCell.swift b/openHAB/NotificationTableViewCell.swift
index 99478dccf..6d666e604 100644
--- a/openHAB/NotificationTableViewCell.swift
+++ b/openHAB/NotificationTableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABClientCertificatesViewController.swift b/openHAB/OpenHABClientCertificatesViewController.swift
index 754428490..9e1837282 100644
--- a/openHAB/OpenHABClientCertificatesViewController.swift
+++ b/openHAB/OpenHABClientCertificatesViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABDataObject.swift b/openHAB/OpenHABDataObject.swift
index a0c332269..d264f5c6d 100644
--- a/openHAB/OpenHABDataObject.swift
+++ b/openHAB/OpenHABDataObject.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABDrawerItem.swift b/openHAB/OpenHABDrawerItem.swift
index 3d949e7da..efb620570 100644
--- a/openHAB/OpenHABDrawerItem.swift
+++ b/openHAB/OpenHABDrawerItem.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABDrawerTableViewController.swift b/openHAB/OpenHABDrawerTableViewController.swift
index 4030eb1d5..c912082c5 100644
--- a/openHAB/OpenHABDrawerTableViewController.swift
+++ b/openHAB/OpenHABDrawerTableViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABLegalViewController.swift b/openHAB/OpenHABLegalViewController.swift
index e6470ef00..9aa1ec601 100644
--- a/openHAB/OpenHABLegalViewController.swift
+++ b/openHAB/OpenHABLegalViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABNotification.swift b/openHAB/OpenHABNotification.swift
index 1185c4f48..d4eecb580 100644
--- a/openHAB/OpenHABNotification.swift
+++ b/openHAB/OpenHABNotification.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABNotificationsViewController.swift b/openHAB/OpenHABNotificationsViewController.swift
index 27281631c..1f604b87c 100644
--- a/openHAB/OpenHABNotificationsViewController.swift
+++ b/openHAB/OpenHABNotificationsViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABRootViewController.swift b/openHAB/OpenHABRootViewController.swift
index 902a8bceb..9d1f95f0c 100644
--- a/openHAB/OpenHABRootViewController.swift
+++ b/openHAB/OpenHABRootViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABSelectionTableViewController.swift b/openHAB/OpenHABSelectionTableViewController.swift
index cfec3c6d2..e3bc64820 100644
--- a/openHAB/OpenHABSelectionTableViewController.swift
+++ b/openHAB/OpenHABSelectionTableViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -13,6 +13,7 @@ import OpenHABCore
import os.log
import UIKit
+// swiftlint:disable:next type_name
public protocol OpenHABSelectionTableViewControllerDelegate: NSObjectProtocol {
func didSelectWidgetMapping(_ selectedMapping: Int)
}
diff --git a/openHAB/OpenHABSettingsViewController.swift b/openHAB/OpenHABSettingsViewController.swift
index 24a03e5e6..0b9aad913 100644
--- a/openHAB/OpenHABSettingsViewController.swift
+++ b/openHAB/OpenHABSettingsViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -31,6 +31,7 @@ class OpenHABSettingsViewController: UITableViewController, UITextFieldDelegate
var settingsSendCrashReports = false
var settingsSortSitemapsBy: SortSitemapsOrder = .label
var settingsDefaultMainUIPath = ""
+ var settingsAlwaysAllowWebRTC = false
var appData: OpenHABDataObject? {
AppDelegate.appDelegate.appData
@@ -53,6 +54,7 @@ class OpenHABSettingsViewController: UITableViewController, UITextFieldDelegate
@IBOutlet private var useCurrentMainUIPathButton: UIButton!
@IBOutlet private var defaultMainUIPathTextField: UITextField!
@IBOutlet private var appVersionLabel: UILabel!
+ @IBOutlet private var alwaysAllowWebRTCSwitch: UISwitch!
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
@@ -235,6 +237,7 @@ class OpenHABSettingsViewController: UITableViewController, UITextFieldDelegate
iconSegmentedControl?.selectedSegmentIndex = settingsIconType.rawValue
sortSitemapsBy?.selectedSegmentIndex = settingsSortSitemapsBy.rawValue
defaultMainUIPathTextField?.text = settingsDefaultMainUIPath
+ alwaysAllowWebRTCSwitch?.isOn = settingsAlwaysAllowWebRTC
if settingsDemomode == true {
disableConnectionSettings()
} else {
@@ -260,6 +263,7 @@ class OpenHABSettingsViewController: UITableViewController, UITextFieldDelegate
settingsIconType = IconType(rawValue: Preferences.iconType) ?? .png
settingsSortSitemapsBy = SortSitemapsOrder(rawValue: Preferences.sortSitemapsby) ?? .label
settingsDefaultMainUIPath = Preferences.defaultMainUIPath
+ settingsAlwaysAllowWebRTC = Preferences.alwaysAllowWebRTC
}
func updateSettings() {
@@ -277,6 +281,7 @@ class OpenHABSettingsViewController: UITableViewController, UITextFieldDelegate
settingsIconType = IconType(rawValue: iconSegmentedControl.selectedSegmentIndex) ?? .png
settingsSortSitemapsBy = SortSitemapsOrder(rawValue: sortSitemapsBy.selectedSegmentIndex) ?? .label
settingsDefaultMainUIPath = defaultMainUIPathTextField?.text ?? ""
+ settingsAlwaysAllowWebRTC = alwaysAllowWebRTCSwitch?.isOn ?? false
}
func saveSettings() {
@@ -293,6 +298,7 @@ class OpenHABSettingsViewController: UITableViewController, UITextFieldDelegate
Preferences.sendCrashReports = settingsSendCrashReports
Preferences.sortSitemapsby = settingsSortSitemapsBy.rawValue
Preferences.defaultMainUIPath = settingsDefaultMainUIPath
+ Preferences.alwaysAllowWebRTC = settingsAlwaysAllowWebRTC
WatchMessageService.singleton.syncPreferencesToWatch()
}
diff --git a/openHAB/OpenHABSitemapViewController.swift b/openHAB/OpenHABSitemapViewController.swift
index 62a8a4fa4..019f6b272 100644
--- a/openHAB/OpenHABSitemapViewController.swift
+++ b/openHAB/OpenHABSitemapViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -57,7 +57,7 @@ struct OpenHABImageProcessor: ImageProcessor {
}
}
-class OpenHABSitemapViewController: OpenHABViewController {
+class OpenHABSitemapViewController: OpenHABViewController, GenericUITableViewCellTouchEventDelegate {
var pageUrl = ""
// private var hamburgerButton: DynamicButton!
private var selectedWidgetRow: Int = 0
@@ -81,6 +81,8 @@ class OpenHABSitemapViewController: OpenHABViewController {
private var serverProperties: OpenHABServerProperties?
private let search = UISearchController(searchResultsController: nil)
private var webViewController: OpenHABWebViewController?
+ private var isUserInteracting = false
+ private var isWaitingToReload = false
var relevantPage: OpenHABSitemapPage? {
if isFiltering {
@@ -244,6 +246,21 @@ class OpenHABSitemapViewController: OpenHABViewController {
widgetTableView.reloadData()
}
+ /// Implementation of GenericUITableViewCellTouchEventDelegate
+ func touchDown() {
+ isUserInteracting = true
+ }
+
+ /// Implementation of GenericUITableViewCellTouchEventDelegate
+ func touchUp() {
+ isUserInteracting = false
+ if isWaitingToReload {
+ widgetTableView.reloadData()
+ refreshControl?.endRefreshing()
+ }
+ isWaitingToReload = false
+ }
+
func configureTableView() {
widgetTableView.dataSource = self
widgetTableView.delegate = self
@@ -354,8 +371,13 @@ class OpenHABSitemapViewController: OpenHABViewController {
self.currentPage?.sendCommand = { [weak self] item, command in
self?.sendCommand(item, commandToSend: command)
}
- self.widgetTableView.reloadData()
- self.refreshControl?.endRefreshing()
+ // isUserInteracting fixes https://github.com/openhab/openhab-ios/issues/646 where reloading while the user is interacting can have unintended consequences
+ if !self.isUserInteracting {
+ self.widgetTableView.reloadData()
+ self.refreshControl?.endRefreshing()
+ } else {
+ self.isWaitingToReload = true
+ }
self.parent?.navigationItem.title = self.currentPage?.title.components(separatedBy: "[")[0]
self.loadPage(true)
@@ -696,6 +718,7 @@ extension OpenHABSitemapViewController: UITableViewDelegate, UITableViewDataSour
if let cell = cell as? GenericUITableViewCell {
cell.widget = widget
cell.displayWidget()
+ cell.touchEventDelegate = self
}
// Check if this is not the last row in the widgets list
diff --git a/openHAB/OpenHABTracker.swift b/openHAB/OpenHABTracker.swift
index b6e20df00..311028181 100644
--- a/openHAB/OpenHABTracker.swift
+++ b/openHAB/OpenHABTracker.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -47,7 +47,8 @@ class OpenHABTracker: NSObject {
start()
}
- @objc func restart() {
+ @objc
+ func restart() {
reach?.stopListening()
start()
}
@@ -71,13 +72,12 @@ class OpenHABTracker: NSObject {
let nStatus = status
// use a timer to prevent bouncing/flapping around when switching between wifi, vpn, and wwan
self.restartTimer?.invalidate()
- self.restartTimer = Timer.scheduledTimer(withTimeInterval: 2.0, repeats: false) { _ in
+ self.restartTimer = Timer.scheduledTimer(withTimeInterval: 3.0, repeats: false) { _ in
if nStatus != self.oldReachabilityStatus {
if let oldReachabilityStatus = self.oldReachabilityStatus {
os_log("OpenHABTracker Network status changed from %{PUBLIC}@ to %{PUBLIC}@", log: OSLog.remoteAccess, type: .info, self.string(from: oldReachabilityStatus) ?? "", self.string(from: nStatus) ?? "")
}
self.oldReachabilityStatus = nStatus
- // (self.delegate as? OpenHABTrackerExtendedDelegate)?.openHABTrackingNetworkChange(nStatus)
if self.isNetworkConnected() {
self.restart()
}
@@ -92,54 +92,16 @@ class OpenHABTracker: NSObject {
os_log("OpenHABTracker demo mode preference is on", log: .default, type: .info)
tryDemoMode()
} else {
- // Check if network is WiFi. If not, go for remote URL
- if !isNetworkWiFi(), !isNetworkVPN() {
- os_log("OpenHABTracker network is not WiFi", log: .default, type: .info)
- tryRemoteUrl()
- // If it is WiFi
+ if isNetworkWiFi(), openHABLocalUrl.isEmpty {
+ startDiscovery()
} else {
- os_log("OpenHABTracker network is Wifi", log: .default, type: .info)
- // Check if local URL is configured
- if openHABLocalUrl.isEmpty {
- startDiscovery()
- } else {
- tryLocalThenRemoteUrl()
- }
+ os_log("OpenHABTracker network trying all", log: .default, type: .info)
+ tryAll()
}
}
} else {
- var errorDetail: [AnyHashable: Any] = [:]
- errorDetail[NSLocalizedDescriptionKey] = NSLocalizedString("network_not_available", comment: "")
- let trackingError = NSError(domain: "openHAB", code: 100, userInfo: errorDetail as? [String: Any])
- multicastDelegate.invoke { $0.openHABTrackingError(trackingError) }
- }
- }
-
- private func tryLocalThenRemoteUrl() {
- multicastDelegate.invoke { $0.openHABTrackingProgress(NSLocalizedString("connecting_local", comment: "")) }
- let openHABUrl = normalizeUrl(openHABLocalUrl)
- getServerInfo(URL(string: openHABUrl!)) { url, version, error in
- if let error {
- os_log("OpenHABTracker failed connecting to local, trying remote: %{PUBLIC}@", log: .default, type: .info, error.localizedDescription)
- self.tryRemoteUrl()
- } else {
- self.appData?.openHABVersion = version
- self.appData?.openHABRootUrl = url?.absoluteString ?? ""
- self.multicastDelegate.invoke { $0.openHABTracked(url, version: version) }
- }
- }
- }
-
- private func tryRemoteUrl() {
- let openHABUrl = normalizeUrl(openHABRemoteUrl)
- if !(openHABUrl ?? "").isEmpty {
- multicastDelegate.invoke { $0.openHABTrackingProgress(NSLocalizedString("connecting_remote", comment: "")) }
- tryUrl(URL(string: openHABUrl!))
- } else {
- var errorDetail: [AnyHashable: Any] = [:]
- errorDetail[NSLocalizedDescriptionKey] = NSLocalizedString("remote_url_not_configured", comment: "")
- let trackingError = NSError(domain: "openHAB", code: 101, userInfo: errorDetail as? [String: Any])
- multicastDelegate.invoke { $0.openHABTrackingError(trackingError) }
+ os_log("OpenHABTracker network not available", log: .default, type: .info)
+ multicastDelegate.invoke { $0.openHABTrackingError(errorMessage("network_not_available")) }
}
}
@@ -153,8 +115,10 @@ class OpenHABTracker: NSObject {
tryUrl(URL(staticString: "https://demo.openhab.org"))
}
+ /// Attemps to connect to the URL and get the openHAB version
+ /// - Parameter tryUrl: Completes with the url and version of openHAB that succeeded, or an Error object if failed
private func tryUrl(_ tryUrl: URL?) {
- getServerInfo(tryUrl) { url, version, error in
+ getServerInfoForUrl(tryUrl) { url, version, error in
if let error {
self.multicastDelegate.invoke { $0.openHABTrackingError(error) }
} else {
@@ -165,28 +129,119 @@ class OpenHABTracker: NSObject {
}
}
- private func getServerInfo(_ url: URL?, completion: @escaping (URL?, Int, Error?) -> Void) {
+ /// Attemps to connect in parallel to the remote and local URLs if configured, the first URL to succeed wins
+ private func tryAll() {
+ var urls = [String: Double]()
+ if !openHABLocalUrl.isEmpty {
+ urls[openHABLocalUrl] = 0.0
+ }
+ if !openHABRemoteUrl.isEmpty {
+ urls[openHABRemoteUrl] = openHABLocalUrl.isEmpty ? 0 : 1.5
+ }
+ if urls.isEmpty {
+ multicastDelegate.invoke { $0.openHABTrackingError(errorMessage("error")) }
+ return
+ }
+ multicastDelegate.invoke { $0.openHABTrackingProgress(NSLocalizedString("connecting", comment: "")) }
+ tryUrls(urls) { url, version, error in
+ if let error {
+ os_log("OpenHABTracker failed %{PUBLIC}@", log: .default, type: .info, error.localizedDescription)
+ self.multicastDelegate.invoke { $0.openHABTrackingError(error) }
+ } else {
+ self.appData?.openHABVersion = version
+ self.appData?.openHABRootUrl = url?.absoluteString ?? ""
+ self.multicastDelegate.invoke { $0.openHABTracked(url, version: version) }
+ }
+ }
+ }
+
+ /// Tries to connect in parallel to all URL's passed in and completes when either the first requests succeedes, or all fail.
+ /// - Parameters:
+ /// - urls: Tuple of String URLS and a request Delay value
+ /// - completion: Completes with the url and version of openHAB that succeeded, or an Error object if all failed
+ private func tryUrls(_ urls: [String: Double], completion: @escaping (URL?, Int, Error?) -> Void) {
+ var isRequestCompletedSuccessfully = false
+ // request in flight
+ var requests = [URL: DataRequest]()
+ // timers that have yet to be executed
+ var timers = [URL: Timer]()
+ for (urlString, delay) in urls {
+ let url = URL(string: urlString)!
+ let restUrl = URL(string: "rest/", relativeTo: url)!
+ let timer = Timer.scheduledTimer(withTimeInterval: delay, repeats: false) { _ in
+ let request = NetworkConnection.shared.manager.request(restUrl, method: .get)
+ .validate()
+ requests[url] = request
+ // remove us from the outstanding timer list
+ timers.removeValue(forKey: url)
+ request.responseData { response in
+ // remove us from the outstanding request list
+ requests.removeValue(forKey: url)
+ os_log("OpenHABTracker response for URL %{PUBLIC}@", log: .notifications, type: .error, url.absoluteString)
+ switch response.result {
+ case let .success(data):
+ let version = self.getServerInfoFromData(data: data)
+ if version > 0, !isRequestCompletedSuccessfully {
+ isRequestCompletedSuccessfully = true
+ // cancel any timers not yet fired
+ timers.values.forEach { $0.invalidate() }
+ // cancel any requests still in flight
+ requests.values.forEach { $0.cancel() }
+ completion(url, version, nil)
+ }
+ case let .failure(error):
+ os_log("OpenHABTracker request failure %{PUBLIC}@", log: .notifications, type: .error, error.localizedDescription)
+ }
+ // check if we are the last attempt
+ if !isRequestCompletedSuccessfully, requests.isEmpty, timers.isEmpty {
+ os_log("OpenHABTracker last response", log: .notifications, type: .error)
+ completion(nil, 0, self.errorMessage("network_not_available"))
+ }
+ }
+ request.resume()
+ }
+ timers[url] = timer
+ RunLoop.main.add(timer, forMode: .common)
+ }
+ }
+
+ /// Attempts to parse the data response from a request and determine if its an openHAB server and its server version
+ /// - Parameter data: request data
+ /// - Returns: Version of openHAB or -1 if not an openHAB server
+ private func getServerInfoFromData(data: Data) -> Int {
+ do {
+ let serverProperties = try data.decoded(as: OpenHABServerProperties.self)
+ os_log("OpenHABTracker openHAB version %@", log: .remoteAccess, type: .info, serverProperties.version)
+ // OH versions 2.0 through 2.4 return "1" as thier version, so set the floor to 2 so we do not think this is a OH 1.x serevr
+ return max(2, Int(serverProperties.version) ?? 2)
+ } catch {
+ // testing for OH 1.x
+ let str = String(decoding: data, as: UTF8.self)
+ if str.hasPrefix(" Void) {
let strUrl = url?.absoluteString ?? ""
os_log("OpenHABTracker getServerInfo, trying: %{PUBLIC}@", log: .default, type: .info, strUrl)
NetworkConnection.tracker(openHABRootUrl: strUrl) { response in
os_log("OpenHABTracker getServerInfo, recieved data for URL: %{PUBLIC}@", log: .default, type: .info, strUrl)
switch response.result {
case let .success(data):
- do {
- let serverProperties = try data.decoded(as: OpenHABServerProperties.self)
- os_log("OpenHABTracker openHAB version %@", log: .remoteAccess, type: .info, serverProperties.version)
- // OH versions 2.0 through 2.4 return "1" as thier version, so set the floor to 2 so we do not think this is a OH 1.x serevr
- let version = max(2, Int(serverProperties.version) ?? 2)
+ let version = self.getServerInfoFromData(data: data)
+ if version > 0 {
completion(url, version, nil)
- } catch {
- // testing for OH 1.x
- let str = String(decoding: data, as: UTF8.self)
- if str.hasPrefix(" Bool {
- if let settings = CFNetworkCopySystemProxySettings()?.takeRetainedValue() as? [String: Any],
- let scopes = settings["__SCOPED__"] as? [String: Any] {
- for key in scopes.keys where key.contains("tap") || key.contains("tun") || key.contains("ppp") || key.contains("ipsec") || key.contains("ipsec0") {
- return true
- }
- }
- return false
- }
-
func string(from status: NetworkReachabilityManager.NetworkReachabilityStatus) -> String? {
switch status {
case .unknown, .notReachable:
@@ -238,6 +281,12 @@ class OpenHABTracker: NSObject {
return connectionType == .ethernetOrWiFi ? "WiFi" : "WWAN"
}
}
+
+ func errorMessage(_ message: String) -> NSError {
+ var errorDetail: [AnyHashable: Any] = [:]
+ errorDetail[NSLocalizedDescriptionKey] = NSLocalizedString(message, comment: "")
+ return NSError(domain: "openHAB", code: 101, userInfo: errorDetail as? [String: Any])
+ }
}
extension OpenHABTracker: NetServiceDelegate, NetServiceBrowserDelegate {
@@ -267,7 +316,7 @@ extension OpenHABTracker: NetServiceDelegate, NetServiceBrowserDelegate {
func netService(_ netService: NetService, didNotResolve errorDict: [String: NSNumber]) {
os_log("OpenHABTracker discovery didn't resolve openHAB", log: .default, type: .info)
- tryRemoteUrl()
+ tryAll()
}
}
diff --git a/openHAB/OpenHABViewController.swift b/openHAB/OpenHABViewController.swift
index 1097152e6..22cb97ae3 100644
--- a/openHAB/OpenHABViewController.swift
+++ b/openHAB/OpenHABViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/OpenHABWebViewController.swift b/openHAB/OpenHABWebViewController.swift
index fb8a6a377..721108404 100644
--- a/openHAB/OpenHABWebViewController.swift
+++ b/openHAB/OpenHABWebViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -51,35 +51,6 @@ class OpenHABWebViewController: OpenHABViewController {
private lazy var webView: WKWebView = newWebView()
- private func newWebView() -> WKWebView {
- let config = WKWebViewConfiguration()
- config.allowsInlineMediaPlayback = true
- config.mediaTypesRequiringUserActionForPlayback = []
- // 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]
- webView.scrollView.bounces = false
- webView.navigationDelegate = self
- webView.uiDelegate = self
- // support dark mode and avoid white flashing when loading
- webView.isOpaque = false
- webView.backgroundColor = UIColor.clear
- // watch for URL changes so we can store the last visited path
- observation = webView.observe(\.url, options: [.new]) { _, _ in
- if let webviewURL = webView.url {
- let url = URL(string: webviewURL.path, relativeTo: URL(string: self.openHABTrackedRootUrl))
- if let path = url?.path {
- os_log("navigation change base: %{PUBLIC}@ path: %{PUBLIC}@", log: OSLog.default, type: .info, self.openHABTrackedRootUrl, path)
- self.appData?.currentWebViewPath = path
- }
- }
- }
- return webView
- }
-
override func viewDidLoad() {
super.viewDidLoad()
navigationController?.interactivePopGestureRecognizer?.isEnabled = true
@@ -190,6 +161,36 @@ class OpenHABWebViewController: OpenHABViewController {
"web"
}
+ private func newWebView() -> WKWebView {
+ let config = WKWebViewConfiguration()
+ config.allowsInlineMediaPlayback = true
+ config.mediaTypesRequiringUserActionForPlayback = []
+ // 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]
+ webView.scrollView.bounces = false
+ webView.navigationDelegate = self
+ webView.uiDelegate = self
+ // support dark mode and avoid white flashing when loading
+ webView.isOpaque = false
+ webView.backgroundColor = UIColor.clear
+ // watch for URL changes so we can store the last visited path
+ observation = webView.observe(\.url, options: [.new]) { _, _ in
+ if let webviewURL = webView.url {
+ let url = URL(string: webviewURL.path, relativeTo: URL(string: self.openHABTrackedRootUrl))
+ if let path = url?.path {
+ os_log("navigation change base: %{PUBLIC}@ path: %{PUBLIC}@", log: OSLog.default, type: .info, self.openHABTrackedRootUrl, path)
+ // append trailing slash as WebUI/Vue/F7 will try and issue a 302 if the url is navigated to directly, this can be problamatic on myopenHAB
+ self.appData?.currentWebViewPath = path.hasSuffix("/") ? path : path + "/"
+ }
+ }
+ }
+ return webView
+ }
+
deinit {
observation = nil
}
@@ -214,12 +215,12 @@ extension OpenHABWebViewController: WKScriptMessageHandler {
sseTimer?.invalidate()
case "sseConnected-false":
os_log("WKScriptMessage sseConnected is false", log: OSLog.remoteAccess, type: .info)
- sseTimer = Timer.scheduledTimer(withTimeInterval: 5.0, repeats: false) { _ in
- self.showPopupMessage(seconds: 60, title: NSLocalizedString("connecting", comment: ""), message: "", theme: .error)
- self.sseTimer = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: false) { _ in
- self.showPopupMessage(seconds: 60, title: NSLocalizedString("connecting", comment: ""), message: "", theme: .error)
+ sseTimer?.invalidate()
+ sseTimer = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: false) { _ in
+ self.sseTimer = Timer.scheduledTimer(withTimeInterval: 20.0, repeats: false) { _ in
self.reloadView()
}
+ self.showPopupMessage(seconds: 20, title: NSLocalizedString("connecting", comment: ""), message: "", theme: .error)
}
default: break
}
@@ -289,7 +290,9 @@ extension OpenHABWebViewController: WKNavigationDelegate {
return
}
let credential = URLCredential(trust: serverTrust)
- completionHandler(.useCredential, credential)
+ DispatchQueue.main.async {
+ completionHandler(.useCredential, credential)
+ }
} else {
var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling
var credential: URLCredential?
@@ -309,6 +312,11 @@ extension OpenHABWebViewController: WKNavigationDelegate {
os_log("webViewWebContentProcessDidTerminate reloading view", log: .wkwebview, type: .info)
reloadView()
}
+
+ @available(iOS 15, *)
+ func webView(_ webView: WKWebView, requestMediaCapturePermissionFor origin: WKSecurityOrigin, initiatedByFrame frame: WKFrameInfo, type: WKMediaCaptureType, decisionHandler: @escaping (WKPermissionDecision) -> Void) {
+ decisionHandler(Preferences.alwaysAllowWebRTC ? .grant : .prompt)
+ }
}
extension OpenHABWebViewController: WKUIDelegate {
diff --git a/openHAB/PlayerView.swift b/openHAB/PlayerView.swift
index f3eb7a37c..116385481 100644
--- a/openHAB/PlayerView.swift
+++ b/openHAB/PlayerView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/Resources/de.lproj/Localizable.strings b/openHAB/Resources/de.lproj/Localizable.strings
index f2d4c4ea5..221d1bdeb 100644
--- a/openHAB/Resources/de.lproj/Localizable.strings
+++ b/openHAB/Resources/de.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Sitemap-Einstellungen";
"about_settings" = "Über";
"uselastpath_settings" = "Zuletzt besuchten Pfad verwenden?";
+"always_allow_webrtc" = "WebRTC immer erlauben";
diff --git a/openHAB/Resources/en.lproj/Localizable.strings b/openHAB/Resources/en.lproj/Localizable.strings
index 77e7994bc..7c6d649e9 100644
--- a/openHAB/Resources/en.lproj/Localizable.strings
+++ b/openHAB/Resources/en.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Sitemap Settings";
"about_settings" = "About";
"uselastpath_settings" = "Use last visited path?";
+"always_allow_webrtc" = "Always Allow WebRTC";
diff --git a/openHAB/Resources/es.lproj/Localizable.strings b/openHAB/Resources/es.lproj/Localizable.strings
index ad3e713ce..463c908a4 100644
--- a/openHAB/Resources/es.lproj/Localizable.strings
+++ b/openHAB/Resources/es.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Ajustes del esquema";
"about_settings" = "Acerca de";
"uselastpath_settings" = "¿Usar la última ruta visitada?";
+"always_allow_webrtc" = "Consenti sempre WebRTC";
diff --git a/openHAB/Resources/fi.lproj/Localizable.strings b/openHAB/Resources/fi.lproj/Localizable.strings
index ea6ef2f34..fad0af249 100644
--- a/openHAB/Resources/fi.lproj/Localizable.strings
+++ b/openHAB/Resources/fi.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Sitemap Settings";
"about_settings" = "About";
"uselastpath_settings" = "Käytä edellistä polkua?";
+"always_allow_webrtc" = "Always Allow WebRTC";
diff --git a/openHAB/Resources/fr.lproj/Localizable.strings b/openHAB/Resources/fr.lproj/Localizable.strings
index 68ffadbbb..acac85857 100644
--- a/openHAB/Resources/fr.lproj/Localizable.strings
+++ b/openHAB/Resources/fr.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Paramètres Sitemap";
"about_settings" = "A propos";
"uselastpath_settings" = "Utiliser le chemin de la dernière visite?";
+"always_allow_webrtc" = "Toujours autoriser WebRTC";
diff --git a/openHAB/Resources/it.lproj/Localizable.strings b/openHAB/Resources/it.lproj/Localizable.strings
index bd66ee1db..c58dbb8ab 100644
--- a/openHAB/Resources/it.lproj/Localizable.strings
+++ b/openHAB/Resources/it.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Impostazioni Sitemap";
"about_settings" = "Info";
"uselastpath_settings" = "Usare L'Ultimo Percorso Visitato?";
+"always_allow_webrtc" = "Consenti sempre WebRTC";
diff --git a/openHAB/Resources/nb.lproj/Localizable.strings b/openHAB/Resources/nb.lproj/Localizable.strings
index ed12b30e0..41958b2db 100644
--- a/openHAB/Resources/nb.lproj/Localizable.strings
+++ b/openHAB/Resources/nb.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Innstillinger for Sitemap";
"about_settings" = "Om";
"uselastpath_settings" = "Bruk sist brukte bane?";
+"always_allow_webrtc" = "Always Allow WebRTC";
diff --git a/openHAB/Resources/nl.lproj/Localizable.strings b/openHAB/Resources/nl.lproj/Localizable.strings
index de48eab1a..67c26120d 100644
--- a/openHAB/Resources/nl.lproj/Localizable.strings
+++ b/openHAB/Resources/nl.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Sitemap instellingen";
"about_settings" = "Over";
"uselastpath_settings" = "Laatst bezochte pad gebruiken?";
+"always_allow_webrtc" = "WebRTC altijd toestaan";
diff --git a/openHAB/Resources/no.lproj/Localizable.strings b/openHAB/Resources/no.lproj/Localizable.strings
index e1503fda4..2e0dab2cb 100644
--- a/openHAB/Resources/no.lproj/Localizable.strings
+++ b/openHAB/Resources/no.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Innstillinger for Sitemap";
"about_settings" = "Om";
"uselastpath_settings" = "Bruk sist brukte bane?";
+"always_allow_webrtc" = "Always Allow WebRTC";
diff --git a/openHAB/Resources/ru.lproj/Localizable.strings b/openHAB/Resources/ru.lproj/Localizable.strings
index 547ddc50d..05509fbfe 100644
--- a/openHAB/Resources/ru.lproj/Localizable.strings
+++ b/openHAB/Resources/ru.lproj/Localizable.strings
@@ -77,3 +77,4 @@
"sitemap_settings" = "Sitemap Settings";
"about_settings" = "About";
"uselastpath_settings" = "Use last visited path?";
+"always_allow_webrtc" = "Always Allow WebRTC";
diff --git a/openHAB/ReusableView.swift b/openHAB/ReusableView.swift
index fccd63052..b0e726c11 100644
--- a/openHAB/ReusableView.swift
+++ b/openHAB/ReusableView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/RollershutterUITableViewCell.swift b/openHAB/RollershutterUITableViewCell.swift
index 1f8c5219b..7b472877d 100644
--- a/openHAB/RollershutterUITableViewCell.swift
+++ b/openHAB/RollershutterUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/ScaleAspectFitImageView.swift b/openHAB/ScaleAspectFitImageView.swift
index 206c6793a..2e3f33e42 100644
--- a/openHAB/ScaleAspectFitImageView.swift
+++ b/openHAB/ScaleAspectFitImageView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/ScaledHeightUIImageView.swift b/openHAB/ScaledHeightUIImageView.swift
index 52a86b0ba..442111dbf 100644
--- a/openHAB/ScaledHeightUIImageView.swift
+++ b/openHAB/ScaledHeightUIImageView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/SegmentedUITableViewCell.swift b/openHAB/SegmentedUITableViewCell.swift
index 33a68d394..26bc3c03f 100644
--- a/openHAB/SegmentedUITableViewCell.swift
+++ b/openHAB/SegmentedUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/SelectionUITableViewCell.swift b/openHAB/SelectionUITableViewCell.swift
index 3e4aecded..5a9f21013 100644
--- a/openHAB/SelectionUITableViewCell.swift
+++ b/openHAB/SelectionUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/SetpointUITableViewCell.swift b/openHAB/SetpointUITableViewCell.swift
index 85b3636cf..cd89e2b78 100644
--- a/openHAB/SetpointUITableViewCell.swift
+++ b/openHAB/SetpointUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/SliderUITableViewCell.swift b/openHAB/SliderUITableViewCell.swift
index 1f81d5c34..dea205eae 100644
--- a/openHAB/SliderUITableViewCell.swift
+++ b/openHAB/SliderUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -52,6 +52,11 @@ class SliderUITableViewCell: GenericUITableViewCell {
@IBAction private func sliderTouchUp(_ sender: UISlider) {
sliderDidChange(toValue: widgetValue)
+ touchEventDelegate?.touchUp()
+ }
+
+ @IBAction private func sliderTouchDown(_ sender: UISlider) {
+ touchEventDelegate?.touchDown()
}
@IBAction private func sliderTouchOutside(_ sender: UISlider) {
diff --git a/openHAB/SpinnerViewController.swift b/openHAB/SpinnerViewController.swift
index 5aa1dc140..ba143f51f 100644
--- a/openHAB/SpinnerViewController.swift
+++ b/openHAB/SpinnerViewController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/SwitchUITableViewCell.swift b/openHAB/SwitchUITableViewCell.swift
index c9f47e848..d9c177d40 100644
--- a/openHAB/SwitchUITableViewCell.swift
+++ b/openHAB/SwitchUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/Throttler.swift b/openHAB/Throttler.swift
index 50338b556..be18187e7 100644
--- a/openHAB/Throttler.swift
+++ b/openHAB/Throttler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/UIAlertView+Block.swift b/openHAB/UIAlertView+Block.swift
index 250f9dc55..aee6f9f33 100644
--- a/openHAB/UIAlertView+Block.swift
+++ b/openHAB/UIAlertView+Block.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/UICircleButton.swift b/openHAB/UICircleButton.swift
index 794dc41f1..c7de0cbd6 100644
--- a/openHAB/UICircleButton.swift
+++ b/openHAB/UICircleButton.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/UILabel+Localization.swift b/openHAB/UILabel+Localization.swift
index c599d0c12..e6fee91ca 100644
--- a/openHAB/UILabel+Localization.swift
+++ b/openHAB/UILabel+Localization.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/UITableView.swift b/openHAB/UITableView.swift
index 972db9f9b..27a58865a 100644
--- a/openHAB/UITableView.swift
+++ b/openHAB/UITableView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/UIViewController+Localization.swift b/openHAB/UIViewController+Localization.swift
index c32c71117..68e4fe574 100644
--- a/openHAB/UIViewController+Localization.swift
+++ b/openHAB/UIViewController+Localization.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/URL+Static.swift b/openHAB/URL+Static.swift
index 291582b28..fb02a3160 100644
--- a/openHAB/URL+Static.swift
+++ b/openHAB/URL+Static.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/VideoUITableViewCell.swift b/openHAB/VideoUITableViewCell.swift
index 5b2a66ed9..c54b09baa 100644
--- a/openHAB/VideoUITableViewCell.swift
+++ b/openHAB/VideoUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/WatchMessageService.swift b/openHAB/WatchMessageService.swift
index 3410490a8..444beb86e 100644
--- a/openHAB/WatchMessageService.swift
+++ b/openHAB/WatchMessageService.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHAB/WebUITableViewCell.swift b/openHAB/WebUITableViewCell.swift
index 576760d49..a88a810f3 100644
--- a/openHAB/WebUITableViewCell.swift
+++ b/openHAB/WebUITableViewCell.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/GetItemStateIntentHandler.swift b/openHABIntents/GetItemStateIntentHandler.swift
index 11830f43d..80c8cc0ee 100644
--- a/openHABIntents/GetItemStateIntentHandler.swift
+++ b/openHABIntents/GetItemStateIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/IntentHandler.swift b/openHABIntents/IntentHandler.swift
index dfd5b5a78..e3eefdcc5 100644
--- a/openHABIntents/IntentHandler.swift
+++ b/openHABIntents/IntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/SetColorValueIntentHandler.swift b/openHABIntents/SetColorValueIntentHandler.swift
index be9804f8f..3c9ec77bb 100644
--- a/openHABIntents/SetColorValueIntentHandler.swift
+++ b/openHABIntents/SetColorValueIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/SetContactStateValueIntentHandler.swift b/openHABIntents/SetContactStateValueIntentHandler.swift
index 37d241893..18d581ebf 100644
--- a/openHABIntents/SetContactStateValueIntentHandler.swift
+++ b/openHABIntents/SetContactStateValueIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/SetDimmerRollerValueIntentHandler.swift b/openHABIntents/SetDimmerRollerValueIntentHandler.swift
index a59ee7673..936c5b25e 100644
--- a/openHABIntents/SetDimmerRollerValueIntentHandler.swift
+++ b/openHABIntents/SetDimmerRollerValueIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/SetNumberValueIntentHandler.swift b/openHABIntents/SetNumberValueIntentHandler.swift
index dded1d188..44606ca80 100644
--- a/openHABIntents/SetNumberValueIntentHandler.swift
+++ b/openHABIntents/SetNumberValueIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/SetStringValueIntentHandler.swift b/openHABIntents/SetStringValueIntentHandler.swift
index db06b472c..95e4044e0 100644
--- a/openHABIntents/SetStringValueIntentHandler.swift
+++ b/openHABIntents/SetStringValueIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABIntents/SetSwitchStateIntentHandler.swift b/openHABIntents/SetSwitchStateIntentHandler.swift
index 6093efd0a..e23f4c914 100644
--- a/openHABIntents/SetSwitchStateIntentHandler.swift
+++ b/openHABIntents/SetSwitchStateIntentHandler.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/LocalizationTests.swift b/openHABTestsSwift/LocalizationTests.swift
index 2639ebc58..680fdc719 100644
--- a/openHABTestsSwift/LocalizationTests.swift
+++ b/openHABTestsSwift/LocalizationTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/OpenHABEndPoint.swift b/openHABTestsSwift/OpenHABEndPoint.swift
index 5899d3920..50c38a6ed 100644
--- a/openHABTestsSwift/OpenHABEndPoint.swift
+++ b/openHABTestsSwift/OpenHABEndPoint.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/OpenHABGeneralTests.swift b/openHABTestsSwift/OpenHABGeneralTests.swift
index 86749ae55..24937a646 100644
--- a/openHABTestsSwift/OpenHABGeneralTests.swift
+++ b/openHABTestsSwift/OpenHABGeneralTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/OpenHABJSONParserTests.swift b/openHABTestsSwift/OpenHABJSONParserTests.swift
index cc3d3dfcf..d09ebc665 100644
--- a/openHABTestsSwift/OpenHABJSONParserTests.swift
+++ b/openHABTestsSwift/OpenHABJSONParserTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/OpenHABSVGTests.swift b/openHABTestsSwift/OpenHABSVGTests.swift
index 53e356552..4717420cd 100644
--- a/openHABTestsSwift/OpenHABSVGTests.swift
+++ b/openHABTestsSwift/OpenHABSVGTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/OpenHABWatchTests.swift b/openHABTestsSwift/OpenHABWatchTests.swift
index 2c71e7aa5..9a44167e4 100644
--- a/openHABTestsSwift/OpenHABWatchTests.swift
+++ b/openHABTestsSwift/OpenHABWatchTests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABTestsSwift/XCTestCaseExtension.swift b/openHABTestsSwift/XCTestCaseExtension.swift
index 8b91b1465..acb6cdc72 100644
--- a/openHABTestsSwift/XCTestCaseExtension.swift
+++ b/openHABTestsSwift/XCTestCaseExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABUITests/OpenHABUITests.swift b/openHABUITests/OpenHABUITests.swift
index c907ce216..6bb5117ea 100644
--- a/openHABUITests/OpenHABUITests.swift
+++ b/openHABUITests/OpenHABUITests.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/ComplicationController.swift b/openHABWatch Extension/ComplicationController.swift
index e7d0bfc86..e2a349e9d 100644
--- a/openHABWatch Extension/ComplicationController.swift
+++ b/openHABWatch Extension/ComplicationController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/ExtensionDelegate.swift b/openHABWatch Extension/ExtensionDelegate.swift
index a09196712..ede5e53c6 100644
--- a/openHABWatch Extension/ExtensionDelegate.swift
+++ b/openHABWatch Extension/ExtensionDelegate.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/HostingController.swift b/openHABWatch Extension/HostingController.swift
index 29900b900..d37e2942d 100644
--- a/openHABWatch Extension/HostingController.swift
+++ b/openHABWatch Extension/HostingController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/NotificationController.swift b/openHABWatch Extension/NotificationController.swift
index cd2a7a23e..3a04fafe0 100644
--- a/openHABWatch Extension/NotificationController.swift
+++ b/openHABWatch Extension/NotificationController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/NotificationView.swift b/openHABWatch Extension/NotificationView.swift
index 55276bad3..41f6ba952 100644
--- a/openHABWatch Extension/NotificationView.swift
+++ b/openHABWatch Extension/NotificationView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/OpenHABWatchTracker.swift b/openHABWatch Extension/OpenHABWatchTracker.swift
index cb1ab4224..aa8cbac3a 100644
--- a/openHABWatch Extension/OpenHABWatchTracker.swift
+++ b/openHABWatch Extension/OpenHABWatchTracker.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/PreferencesHostingController.swift b/openHABWatch Extension/PreferencesHostingController.swift
index 8a21afb9c..75df87ae2 100644
--- a/openHABWatch Extension/PreferencesHostingController.swift
+++ b/openHABWatch Extension/PreferencesHostingController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/UserDefaultsExtension.swift b/openHABWatch Extension/UserDefaultsExtension.swift
index e14ee4c86..e20a85b24 100644
--- a/openHABWatch Extension/UserDefaultsExtension.swift
+++ b/openHABWatch Extension/UserDefaultsExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/ContentView.swift b/openHABWatch Extension/Views/ContentView.swift
index 2e2dc8d43..2b03102a3 100644
--- a/openHABWatch Extension/Views/ContentView.swift
+++ b/openHABWatch Extension/Views/ContentView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -81,7 +81,16 @@ struct ContentView: View {
ImageRow(URL: URL(string: widget.url))
}
case .chart:
- let url = Endpoint.chart(rootUrl: settings.openHABRootUrl, period: widget.period, type: widget.item?.type ?? .none, service: widget.service, name: widget.item?.name, legend: widget.legend, theme: .dark).url
+ let url = Endpoint.chart(
+ rootUrl: settings.openHABRootUrl,
+ period: widget.period,
+ type: widget.item?.type ?? .none,
+ service: widget.service,
+ name: widget.item?.name,
+ legend: widget.legend,
+ theme: .dark,
+ forceAsItem: widget.forceAsItem
+ ).url
ImageRow(URL: url)
case .mapview:
MapViewRow(widget: widget)
diff --git a/openHABWatch Extension/Views/PreferencesSwiftUIView.swift b/openHABWatch Extension/Views/PreferencesSwiftUIView.swift
index 25e6c2d85..727a286c3 100644
--- a/openHABWatch Extension/Views/PreferencesSwiftUIView.swift
+++ b/openHABWatch Extension/Views/PreferencesSwiftUIView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/ColorPickerRow.swift b/openHABWatch Extension/Views/Rows/ColorPickerRow.swift
index 976919593..07fad256f 100644
--- a/openHABWatch Extension/Views/Rows/ColorPickerRow.swift
+++ b/openHABWatch Extension/Views/Rows/ColorPickerRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/FrameRow.swift b/openHABWatch Extension/Views/Rows/FrameRow.swift
index 02f2a1ccc..5ea262c2b 100644
--- a/openHABWatch Extension/Views/Rows/FrameRow.swift
+++ b/openHABWatch Extension/Views/Rows/FrameRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/GenericRow.swift b/openHABWatch Extension/Views/Rows/GenericRow.swift
index c6288096d..5728da9d5 100644
--- a/openHABWatch Extension/Views/Rows/GenericRow.swift
+++ b/openHABWatch Extension/Views/Rows/GenericRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/ImageRawRow.swift b/openHABWatch Extension/Views/Rows/ImageRawRow.swift
index f99a89459..186241dfd 100644
--- a/openHABWatch Extension/Views/Rows/ImageRawRow.swift
+++ b/openHABWatch Extension/Views/Rows/ImageRawRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/ImageRow.swift b/openHABWatch Extension/Views/Rows/ImageRow.swift
index b904be31d..333902e2f 100644
--- a/openHABWatch Extension/Views/Rows/ImageRow.swift
+++ b/openHABWatch Extension/Views/Rows/ImageRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/MapViewRow.swift b/openHABWatch Extension/Views/Rows/MapViewRow.swift
index 5dae077f0..d0d21f3d0 100644
--- a/openHABWatch Extension/Views/Rows/MapViewRow.swift
+++ b/openHABWatch Extension/Views/Rows/MapViewRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/PreferencesRowUIView.swift b/openHABWatch Extension/Views/Rows/PreferencesRowUIView.swift
index e8c99e4c9..8410944f5 100644
--- a/openHABWatch Extension/Views/Rows/PreferencesRowUIView.swift
+++ b/openHABWatch Extension/Views/Rows/PreferencesRowUIView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/RollershutterRow.swift b/openHABWatch Extension/Views/Rows/RollershutterRow.swift
index 5a43fbbff..f92edeabc 100644
--- a/openHABWatch Extension/Views/Rows/RollershutterRow.swift
+++ b/openHABWatch Extension/Views/Rows/RollershutterRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/SegmentRow.swift b/openHABWatch Extension/Views/Rows/SegmentRow.swift
index 3bcf0ba01..33ff21324 100644
--- a/openHABWatch Extension/Views/Rows/SegmentRow.swift
+++ b/openHABWatch Extension/Views/Rows/SegmentRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/SetpointRow.swift b/openHABWatch Extension/Views/Rows/SetpointRow.swift
index fc8c8c0f3..1c6785551 100644
--- a/openHABWatch Extension/Views/Rows/SetpointRow.swift
+++ b/openHABWatch Extension/Views/Rows/SetpointRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/SliderRow.swift b/openHABWatch Extension/Views/Rows/SliderRow.swift
index 703af0573..8aa566703 100644
--- a/openHABWatch Extension/Views/Rows/SliderRow.swift
+++ b/openHABWatch Extension/Views/Rows/SliderRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Rows/SwitchRow.swift b/openHABWatch Extension/Views/Rows/SwitchRow.swift
index 03a776379..c9e2a859b 100644
--- a/openHABWatch Extension/Views/Rows/SwitchRow.swift
+++ b/openHABWatch Extension/Views/Rows/SwitchRow.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/Color+Extension.swift b/openHABWatch Extension/Views/Utils/Color+Extension.swift
index 35798aa5a..092e4757c 100644
--- a/openHABWatch Extension/Views/Utils/Color+Extension.swift
+++ b/openHABWatch Extension/Views/Utils/Color+Extension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/ColorSelection.swift b/openHABWatch Extension/Views/Utils/ColorSelection.swift
index a3fd76388..16815f74a 100644
--- a/openHABWatch Extension/Views/Utils/ColorSelection.swift
+++ b/openHABWatch Extension/Views/Utils/ColorSelection.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/DetailTextLabelView.swift b/openHABWatch Extension/Views/Utils/DetailTextLabelView.swift
index c32254429..b30512c4e 100644
--- a/openHABWatch Extension/Views/Utils/DetailTextLabelView.swift
+++ b/openHABWatch Extension/Views/Utils/DetailTextLabelView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/EncircledIconWithAction.swift b/openHABWatch Extension/Views/Utils/EncircledIconWithAction.swift
index f145e6133..628f94716 100644
--- a/openHABWatch Extension/Views/Utils/EncircledIconWithAction.swift
+++ b/openHABWatch Extension/Views/Utils/EncircledIconWithAction.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/IconView.swift b/openHABWatch Extension/Views/Utils/IconView.swift
index be4f9999a..9a586150b 100644
--- a/openHABWatch Extension/Views/Utils/IconView.swift
+++ b/openHABWatch Extension/Views/Utils/IconView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/MapView.swift b/openHABWatch Extension/Views/Utils/MapView.swift
index 813733876..46fe7b5f6 100644
--- a/openHABWatch Extension/Views/Utils/MapView.swift
+++ b/openHABWatch Extension/Views/Utils/MapView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/PreviewConstants.swift b/openHABWatch Extension/Views/Utils/PreviewConstants.swift
index 00df902a7..4fdbba711 100644
--- a/openHABWatch Extension/Views/Utils/PreviewConstants.swift
+++ b/openHABWatch Extension/Views/Utils/PreviewConstants.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/TextLabelView.swift b/openHABWatch Extension/Views/Utils/TextLabelView.swift
index 21ae5eff0..9a07ec640 100644
--- a/openHABWatch Extension/Views/Utils/TextLabelView.swift
+++ b/openHABWatch Extension/Views/Utils/TextLabelView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/Views/Utils/Unwrap.swift b/openHABWatch Extension/Views/Utils/Unwrap.swift
index 4ff3708e3..a2aa658c0 100644
--- a/openHABWatch Extension/Views/Utils/Unwrap.swift
+++ b/openHABWatch Extension/Views/Utils/Unwrap.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/ButtonTableRowController.swift b/openHABWatch Extension/openHABWatch Extension/ButtonTableRowController.swift
index d3b693604..e0374b4fc 100644
--- a/openHABWatch Extension/openHABWatch Extension/ButtonTableRowController.swift
+++ b/openHABWatch Extension/openHABWatch Extension/ButtonTableRowController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/ComplicationController.swift b/openHABWatch Extension/openHABWatch Extension/ComplicationController.swift
index 7fbfe5025..ac93753ae 100644
--- a/openHABWatch Extension/openHABWatch Extension/ComplicationController.swift
+++ b/openHABWatch Extension/openHABWatch Extension/ComplicationController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/ExtensionDelegate.swift b/openHABWatch Extension/openHABWatch Extension/ExtensionDelegate.swift
index 50e731c86..aad19bd0c 100644
--- a/openHABWatch Extension/openHABWatch Extension/ExtensionDelegate.swift
+++ b/openHABWatch Extension/openHABWatch Extension/ExtensionDelegate.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/InterfaceController.swift b/openHABWatch Extension/openHABWatch Extension/InterfaceController.swift
index 43fcef309..52bdd601a 100644
--- a/openHABWatch Extension/openHABWatch Extension/InterfaceController.swift
+++ b/openHABWatch Extension/openHABWatch Extension/InterfaceController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/Model/LazyView.swift b/openHABWatch Extension/openHABWatch Extension/Model/LazyView.swift
index fbbc2a408..474a9696b 100644
--- a/openHABWatch Extension/openHABWatch Extension/Model/LazyView.swift
+++ b/openHABWatch Extension/openHABWatch Extension/Model/LazyView.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABDataObject.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABDataObject.swift
index 3a267e9e8..cb2d53da1 100644
--- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABDataObject.swift
+++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABDataObject.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift
index 025d6f53f..15b913241 100644
--- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift
+++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABSitemapPage.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift
index 4481266b9..c3a6e19bf 100644
--- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift
+++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidget.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
@@ -73,6 +73,7 @@ class ObservableOpenHABWidget: NSObject, MKAnnotation, Identifiable, ObservableO
var widgets: [ObservableOpenHABWidget] = []
public var visibility = true
public var switchSupport = false
+ public var forceAsItem: Bool?
@Published var stateEnumBinding: WidgetTypeEnum = .unassigned
@@ -210,7 +211,7 @@ class ObservableOpenHABWidget: NSObject, MKAnnotation, Identifiable, ObservableO
extension ObservableOpenHABWidget {
// This is an ugly initializer
- convenience init(widgetId: String, label: String, icon: String, type: String, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABLinkedPage?, mappings: [OpenHABWidgetMapping], widgets: [ObservableOpenHABWidget]) {
+ convenience init(widgetId: String, label: String, icon: String, type: String, url: String?, period: String?, minValue: Double?, maxValue: Double?, step: Double?, refresh: Int?, height: Double?, isLeaf: Bool?, iconColor: String?, labelColor: String?, valueColor: String?, service: String?, state: String?, text: String?, legend: Bool?, encoding: String?, item: OpenHABItem?, linkedPage: OpenHABLinkedPage?, mappings: [OpenHABWidgetMapping], widgets: [ObservableOpenHABWidget], forceAsItem: Bool?) {
self.init()
id = widgetId
@@ -249,6 +250,8 @@ extension ObservableOpenHABWidget {
self.maxValue = max(self.minValue, self.maxValue)
self.step = abs(self.step)
+ self.forceAsItem = forceAsItem
+
stateEnumBinding = stateEnum
}
@@ -323,6 +326,7 @@ extension ObservableOpenHABWidget {
let linkedPage: OpenHABLinkedPage?
let mappings: [OpenHABWidgetMapping]
let widgets: [ObservableOpenHABWidget.CodingData]
+ let forceAsItem: Bool?
}
}
@@ -330,7 +334,7 @@ extension ObservableOpenHABWidget {
extension ObservableOpenHABWidget.CodingData {
var openHABWidget: ObservableOpenHABWidget {
let mappedWidgets = widgets.map(\.openHABWidget)
- return ObservableOpenHABWidget(widgetId: widgetId, label: label, icon: icon, type: type, url: url, period: period, minValue: minValue, maxValue: maxValue, step: step, refresh: refresh, height: height, isLeaf: isLeaf, iconColor: iconColor, labelColor: labelcolor, valueColor: valuecolor, service: service, state: state, text: text, legend: legend, encoding: encoding, item: item?.openHABItem, linkedPage: linkedPage, mappings: mappings, widgets: mappedWidgets)
+ return ObservableOpenHABWidget(widgetId: widgetId, label: label, icon: icon, type: type, url: url, period: period, minValue: minValue, maxValue: maxValue, step: step, refresh: refresh, height: height, isLeaf: isLeaf, iconColor: iconColor, labelColor: labelcolor, valueColor: valuecolor, service: service, state: state, text: text, legend: legend, encoding: encoding, item: item?.openHABItem, linkedPage: linkedPage, mappings: mappings, widgets: mappedWidgets, forceAsItem: forceAsItem)
}
}
diff --git a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift
index 0bda4e06b..23fcfc6b1 100644
--- a/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift
+++ b/openHABWatch Extension/openHABWatch Extension/Model/ObservableOpenHABWidgetExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/Model/UserDefaultsBacked.swift b/openHABWatch Extension/openHABWatch Extension/Model/UserDefaultsBacked.swift
index 0e64509b5..6c0de7bbc 100644
--- a/openHABWatch Extension/openHABWatch Extension/Model/UserDefaultsBacked.swift
+++ b/openHABWatch Extension/openHABWatch Extension/Model/UserDefaultsBacked.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/NotificationController.swift b/openHABWatch Extension/openHABWatch Extension/NotificationController.swift
index 5a979612a..808272f65 100644
--- a/openHABWatch Extension/openHABWatch Extension/NotificationController.swift
+++ b/openHABWatch Extension/openHABWatch Extension/NotificationController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/PrefsInterfaceController.swift b/openHABWatch Extension/openHABWatch Extension/PrefsInterfaceController.swift
index f7399dde8..690641a4b 100644
--- a/openHABWatch Extension/openHABWatch Extension/PrefsInterfaceController.swift
+++ b/openHABWatch Extension/openHABWatch Extension/PrefsInterfaceController.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/UserData.swift b/openHABWatch Extension/openHABWatch Extension/UserData.swift
index c7f527143..1c93caaa5 100644
--- a/openHABWatch Extension/openHABWatch Extension/UserData.swift
+++ b/openHABWatch Extension/openHABWatch Extension/UserData.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/UserDefaultsExtension.swift b/openHABWatch Extension/openHABWatch Extension/UserDefaultsExtension.swift
index 85fc0772c..244ce3dff 100644
--- a/openHABWatch Extension/openHABWatch Extension/UserDefaultsExtension.swift
+++ b/openHABWatch Extension/openHABWatch Extension/UserDefaultsExtension.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/app/AppState.swift b/openHABWatch Extension/openHABWatch Extension/app/AppState.swift
index b7c816cb0..192c0e3ab 100644
--- a/openHABWatch Extension/openHABWatch Extension/app/AppState.swift
+++ b/openHABWatch Extension/openHABWatch Extension/app/AppState.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift b/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift
index 6ce4a3b67..a28e0a182 100644
--- a/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift
+++ b/openHABWatch Extension/openHABWatch Extension/external/AppMessageService.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.
diff --git a/openHABWatch Extension/openHABWatch Extension/external/OpenHabService.swift b/openHABWatch Extension/openHABWatch Extension/external/OpenHabService.swift
index 1076de66c..32d10edba 100644
--- a/openHABWatch Extension/openHABWatch Extension/external/OpenHabService.swift
+++ b/openHABWatch Extension/openHABWatch Extension/external/OpenHabService.swift
@@ -1,4 +1,4 @@
-// Copyright (c) 2010-2022 Contributors to the openHAB project
+// Copyright (c) 2010-2023 Contributors to the openHAB project
//
// See the NOTICE file(s) distributed with this work for additional
// information.