mirror of
https://github.com/home-assistant/iOS.git
synced 2026-06-24 20:17:30 -05:00
<!-- Thank you for submitting a Pull Request and helping to improve Home Assistant. Please complete the following sections to help the processing and review of your changes. Please do not delete anything from this template. --> ## Summary <!-- Provide a brief summary of the changes you have made and most importantly what they aim to achieve --> This PR bumps HAKit to 0.4.15 which allows mTLS on Apple Watch. It also includes connectivity changes + a settings screen to visualize connectivity information and define where to execute scripts and scenes from. ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> <img width="742" height="864" alt="CleanShot 2026-06-16 at 16 39 30@2x" src="https://github.com/user-attachments/assets/3b9ec512-76f4-4a2f-a677-710c7f37bef4" /> ## Link to pull request in Documentation repository <!-- Pull requests that add, change or remove functionality must have a corresponding pull request in the Companion App Documentation repository (https://github.com/home-assistant/companion.home-assistant). Please add the number of this pull request after the "#" --> Documentation: home-assistant/companion.home-assistant# ## Any other notes <!-- If there is any other information of note, like if this Pull Request is part of a bigger change, please include it here. --> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
29 lines
714 B
Swift
29 lines
714 B
Swift
import Combine
|
|
import Foundation
|
|
import Shared
|
|
|
|
final class WatchSettingsViewModel: ObservableObject {
|
|
@Published private(set) var servers: [Server] = []
|
|
@Published private(set) var lastUpdated: Date?
|
|
|
|
init() {
|
|
Current.servers.add(observer: self)
|
|
reload()
|
|
}
|
|
|
|
private func reload() {
|
|
let all = Current.servers.all
|
|
let updatedAt = WatchUserDefaults.shared.date(for: .serversUpdatedAt)
|
|
DispatchQueue.main.async { [weak self] in
|
|
self?.servers = all
|
|
self?.lastUpdated = updatedAt
|
|
}
|
|
}
|
|
}
|
|
|
|
extension WatchSettingsViewModel: ServerObserver {
|
|
func serversDidChange(_ serverManager: ServerManager) {
|
|
reload()
|
|
}
|
|
}
|