Skip to content

Commit

Permalink
Passing iconType from iOS to watchOS
Browse files Browse the repository at this point in the history
Avoid swiftformat on too long line
  • Loading branch information
timbms committed Jan 12, 2024
1 parent ce0f178 commit 3e2b282
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
12 changes: 11 additions & 1 deletion OpenHABCore/Sources/OpenHABCore/Model/OpenHABItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,17 @@ public extension OpenHABItem.CodingData {
var openHABItem: OpenHABItem {
let mappedMembers = members?.map(\.openHABItem) ?? []

return OpenHABItem(name: name, type: type, state: state, link: link, label: label, groupType: groupType, stateDescription: stateDescription?.openHABStateDescription, commandDescription: commandDescription?.openHABCommandDescription, members: mappedMembers, category: category, options: options)
return OpenHABItem(name: name,
type: type,
state: state,
link: link,
label: label,
groupType: groupType,
stateDescription: stateDescription?.openHABStateDescription,
commandDescription: commandDescription?.openHABCommandDescription,
members: mappedMembers,
category: category,
options: options)
}
}

Expand Down
3 changes: 2 additions & 1 deletion openHAB/WatchMessageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ class WatchMessageService: NSObject, WCSessionDelegate {
"defaultSitemap": Preferences.defaultSitemap,
"ignoreSSL": Preferences.ignoreSSL,
"trustedCertificates": NetworkConnection.shared.serverCertificateManager.trustedCertificates,
"sitemapForWatch": Preferences.sitemapForWatch
"sitemapForWatch": Preferences.sitemapForWatch,
"iconType": Preferences.iconType
]

return applicationDict
Expand Down
4 changes: 4 additions & 0 deletions openHABWatch/External/AppMessageService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class AppMessageService: NSObject, WCSessionDelegate {
ObservableOpenHABDataObject.shared.openHABAlwaysSendCreds = alwaysSendCreds
}

if let iconType = applicationContext["iconType"] as? IconType {
ObservableOpenHABDataObject.shared.iconType = iconType
}

ObservableOpenHABDataObject.shared.haveReceivedAppContext = true
}
}
Expand Down

0 comments on commit 3e2b282

Please sign in to comment.