Module: SleepIQ::Pump

Included in:
Client
Defined in:
lib/sleepiq/pump.rb

Instance Method Summary collapse

Instance Method Details

#force_idle(bedid = @bedid) ⇒ Object



10
11
12
13
14
15
# File 'lib/sleepiq/pump.rb', line 10

def force_idle(bedid = @bedid)
  result = @conn.put { |req| req.url "rest/bed/#{bedid}/pump/forceIdle" }
  raise "status code was #{result.status}, #{result.body}" unless result.status == 200

  result.body
end

#pump_status(bedid = @bedid) ⇒ Object



3
4
5
6
7
8
# File 'lib/sleepiq/pump.rb', line 3

def pump_status(bedid = @bedid)
  result = @conn.get { |req| req.url "rest/bed/#{bedid}/pump/status" }
  raise "status code was #{result.status}, #{result.body}" unless result.status == 200

  result.body
end