HomeconnectLocal::Message
Inherits JSON::Serializable < Struct < Value < Object
Message on the websocket (JSON).
Constructors
new(pull : JSON::PullParser)
Sourcenew(resource : String, action : Action = Action::GET, data : Array(JSON::Any) = [] of JSON::Any, sid : Int64 | Nil = nil, msg_id : Int64 | Nil = nil, version : Int32 | Nil = nil, code : Int32 | Nil = nil)
Sourcenew(*, __pull_for_json_serializable pull : JSON::PullParser)
Sourceparse_loose(raw : String) : Message
Parse appliance frames defensively. Some appliances occasionally send boolean false for numeric envelope fields (for example code/version).
Instance methods
action
Sourceaction=(action : Action)
Sourcecode
Sourcecode=(code : Int32 | Nil)
Sourcedata
Sourcedata=(data : Array(JSON::Any))
Sourcemsg_id
Sourcemsg_id=(msg_id : Int64 | Nil)
Sourceresource
Sourceresource=(resource : String)
Sourcerespond(payload : Array(JSON::Any) = [] of JSON::Any) : Message
Create a RESPONSE message matching this message.
sid
Sourcesid=(sid : Int64 | Nil)
Sourceversion
Sourceversion=(version : Int32 | Nil)
Source