iOS/Sources/Shared/Notifications/LocalPush/PushProviderConfiguration.swift
Michal Šrůtek 7de47c6e62
static var to static let (#2642)
<!-- 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
2024-03-25 11:57:48 +01:00

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)"
}
}