Skip to content

Commit ae7e4fc

Browse files
authored
Update legacy open page logic to use new deeplink (home-assistant#3565)
<!-- 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 --> ## Screenshots <!-- If this is a user-facing change not in the frontend, please include screenshots in light and dark mode. --> ## 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. -->
1 parent 723fb35 commit ae7e4fc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

Sources/Shared/Common/SiriIntents+ConvenienceInits.swift

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,11 @@ public extension IntentPanel {
150150
}
151151

152152
var widgetURL: URL {
153-
var components = URLComponents()
154-
components.scheme = "homeassistant"
155-
components.host = "navigate"
156-
components.path = "/" + (identifier ?? "lovelace")
157-
if let server = Current.servers.server(for: self) {
158-
components.insertWidgetServer(server: server)
159-
}
160-
return components.url!
153+
let server = Current.servers.server(for: self) ?? Current.servers.all.first
154+
return AppConstants.openPageDeeplinkURL(
155+
path: identifier ?? "lovelace",
156+
serverId: server?.identifier.rawValue ?? ""
157+
) ?? AppConstants.deeplinkURL
161158
}
162159

163160
private static func materialDesignIcon(for name: String?) -> MaterialDesignIcons {

0 commit comments

Comments
 (0)