HAResponseEvent

public struct HAResponseEvent : HADataDecodable

An event fired on the event bus

  • The type of event

    Declaration

    Swift

    public var type: HAEventType
  • When the event was fired

    Declaration

    Swift

    public var timeFired: Date
  • Data that came with the event

    Declaration

    Swift

    public var data: [String : Any]
  • The origin of the event

    Declaration

    Swift

    public var origin: Origin
  • The context of the event, e.g. who executed it

    Declaration

    Swift

    public var context: Context
  • The origin of the event

    See more

    Declaration

    Swift

    public enum Origin : String, HADecodeTransformable
  • The context of the event

    See more

    Declaration

    Swift

    public struct Context : HADataDecodable
  • Create with data

    Throws

    If any required keys are missing

    Declaration

    Swift

    public init(data: HAData) throws

    Parameters

    data

    The data from the server

  • Create with information

    Declaration

    Swift

    public init(
        type: HAEventType,
        timeFired: Date,
        data: [String: Any],
        origin: Origin,
        context: Context
    )

    Parameters

    type

    The type of the event

    timeFired

    The time fired

    data

    The data

    origin

    The origin

    context

    The context