struct

HomeconnectLocal::Message

Inherits JSON::Serializable < Struct < Value < Object

Message on the websocket (JSON).

Constructors

new(pull : JSON::PullParser)
Source
new(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)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
parse_loose(raw : String) : Message

Parse appliance frames defensively. Some appliances occasionally send boolean false for numeric envelope fields (for example code/version).

Source

Instance methods

action
Source
action=(action : Action)
Source
code
Source
code=(code : Int32 | Nil)
Source
data
Source
data=(data : Array(JSON::Any))
Source
msg_id
Source
msg_id=(msg_id : Int64 | Nil)
Source
resource
Source
resource=(resource : String)
Source
respond(payload : Array(JSON::Any) = [] of JSON::Any) : Message

Create a RESPONSE message matching this message.

Source
sid=(sid : Int64 | Nil)
Source
version
Source
version=(version : Int32 | Nil)
Source