mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-09 00:55:52 -06: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 --> - `static let` plays nicely with modern Swift concurrency (async/await) - `static let` makes it impossible to mutate the values - causing undefined behavior in some cases
16 lines
513 B
Swift
16 lines
513 B
Swift
public struct PushProviderConfiguration: Codable {
|
|
public static let providerConfigurationKey = "ha_configurations"
|
|
|
|
public let serverIdentifier: Identifier<Server>
|
|
public let settingsKey: String
|
|
|
|
public init(serverIdentifier: Identifier<Server>, settingsKey: String) {
|
|
self.serverIdentifier = serverIdentifier
|
|
self.settingsKey = settingsKey
|
|
}
|
|
|
|
public static func defaultSettingsKey(for server: Server) -> String {
|
|
"LocalPush:\(server.identifier.rawValue)"
|
|
}
|
|
}
|