HARequestType

public enum HARequestType : Hashable, Comparable, ExpressibleByStringLiteral

The command to issue

  • Sent over WebSocket, the command of the request

    Declaration

    Swift

    case webSocket(String)
  • Sent over REST, the HTTP method to use and the post-api/ path

    Declaration

    Swift

    case rest(HAHTTPMethod, String)
  • Sent over WebSocket, the stt binary handler id

    Declaration

    Swift

    case sttData(HASttHandlerId)
  • Create a WebSocket request type by string literal

    Declaration

    Swift

    public init(stringLiteral value: StringLiteralType)

    Parameters

    value

    The name of the WebSocket command

  • The command of the request, agnostic of protocol type

    Declaration

    Swift

    public var command: String { get }
  • The request is issued outside of the lifecycle of a connection

    Declaration

    Swift

    public var isPerpetual: Bool { get }
  • Sort the request type by command name

    Declaration

    Swift

    public static func < (lhs: HARequestType, rhs: HARequestType) -> Bool

    Parameters

    lhs

    The first type to compare

    rhs

    The second value to compare

    Return Value

    Whether the first type preceeds the second

Requests

  • call_service

    Declaration

    Swift

    public static var callService: `Self`
  • auth/current_user

    Declaration

    Swift

    public static var currentUser: `Self`
  • get_states

    Declaration

    Swift

    public static var getStates: `Self`
  • get_config

    Declaration

    Swift

    public static var getConfig: `Self`
  • get_services

    Declaration

    Swift

    public static var getServices: `Self`

Subscription Handling

  • subscribe_events

    Declaration

    Swift

    public static var subscribeEvents: `Self`
  • unsubscribe_events

    Declaration

    Swift

    public static var unsubscribeEvents: `Self`
  • subscribe_entities

    Declaration

    Swift

    public static var subscribeEntities: `Self`

Subscriptions

  • render_template

    Declaration

    Swift

    public static var renderTemplate: `Self`

Internal

  • ping This will always get a success response, when a response is received.

    Declaration

    Swift

    public static var ping: `Self`
  • auth This is likely not useful for external consumers as this is handled automatically on connection.

    Declaration

    Swift

    public static var auth: `Self`