Method: Unifi::Client::Main#stat_sessions

Defined in:
lib/unifi/client/main.rb

#stat_sessions(start_time = nil, end_time = Time.now.to_i, mac = nil) ⇒ Object



131
132
133
134
135
136
# File 'lib/unifi/client/main.rb', line 131

def stat_sessions(start_time = nil, end_time = Time.now.to_i, mac = nil)
  body = { start: start_time ? start_time : end_time - (7 * 24 * 3600), end: end_time, type: 'all' }
  body[:mac] = mac if mac
  response = self.class.get("/s/#{@site}/stat/session", { body: body.to_json })
  response.parsed_response
end