HAKit
public enum HAKit
Namespace entrypoint of the library
-
Create a new connection
Declaration
Swift
public static func connection( configuration: HAConnectionConfiguration, connectAutomatically: Bool = true, urlSession: URLSession? = nil ) -> HAConnectionParameters
configurationThe configuration for the connection
connectAutomaticallyDefaults to
true. Whether to call .connect() automatically.urlSessionOptional custom URLSession for REST API calls. When provided, this session will be used for all REST API requests (e.g., requests with
.rest()type). This is useful for handling custom certificate validation or client certificate authentication (mTLS). If not provided, a default ephemeral session is used. Note: This only affects REST API calls, not WebSocket connections.Return Value
The connection itself
View on GitHub