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 moreDeclaration
Swift
public enum Origin : String, HADecodeTransformable -
The context of the event
See moreDeclaration
Swift
public struct Context : HADataDecodable -
Create with data
Throws
If any required keys are missingDeclaration
Swift
public init(data: HAData) throwsParameters
dataThe data from the server
-
Create with information
Declaration
Swift
public init( type: HAEventType, timeFired: Date, data: [String: Any], origin: Origin, context: Context )Parameters
typeThe type of the event
timeFiredThe time fired
dataThe data
originThe origin
contextThe context
View on GitHub