Method: M2X::Client::Stream#update_value

Defined in:
lib/m2x/stream.rb

#update_value(value, timestamp = nil) ⇒ Object

Update the current value of the stream. The timestamp is optional. If omitted, the current server time will be used

m2x.att.com/developer/documentation/v2/device#Update-Data-Stream-Value



79
80
81
82
83
84
85
# File 'lib/m2x/stream.rb', line 79

def update_value(value, timestamp=nil)
  params = { value: value }

  params[:timestamp] = timestamp if timestamp

  @client.put("#{path}/value", nil, params, "Content-Type" => "application/json")
end