HAResponseEventStateChanged
public struct HAResponseEventStateChanged : HADataDecodable
State changed event
-
The underlying event and the information it contains
Todo
should this be moved from composition to inheritence?Declaration
Swift
public var event: HAResponseEvent -
The entity ID which is changing
Declaration
Swift
public var entityId: String -
The old state of the entity, if there was one
Declaration
Swift
public var oldState: HAEntity? -
The new state of the entity, if there is one
Declaration
Swift
public var newState: HAEntity? -
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( event: HAResponseEvent, entityId: String, oldState: HAEntity?, newState: HAEntity? )Parameters
eventThe event
entityIdThe entity id
oldStateThe old state, or nil
newStateThe new state, or nil
View on GitHub