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 missing

    Declaration

    Swift

    public init(data: HAData) throws

    Parameters

    data

    The data from the server

  • Create with information

    Declaration

    Swift

    public init(
        event: HAResponseEvent,
        entityId: String,
        oldState: HAEntity?,
        newState: HAEntity?
    )

    Parameters

    event

    The event

    entityId

    The entity id

    oldState

    The old state, or nil

    newState

    The new state, or nil