Class: Botvac::Robot
- Inherits:
-
Object
- Object
- Botvac::Robot
- Defined in:
- lib/botvac/robot.rb
Defined Under Namespace
Classes: Hmac
Instance Attribute Summary collapse
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#serial ⇒ Object
Returns the value of attribute serial.
Instance Method Summary collapse
- #disable_schedule ⇒ Object
- #enable_schedule ⇒ Object
- #get_robot_state ⇒ Object
- #get_schedule ⇒ Object
-
#initialize(serial, secret) ⇒ Robot
constructor
A new instance of Robot.
- #pause_cleaning ⇒ Object
- #send_to_base ⇒ Object
- #start_cleaning ⇒ Object
- #stop_cleaning ⇒ Object
Constructor Details
#initialize(serial, secret) ⇒ Robot
Returns a new instance of Robot.
10 11 12 13 |
# File 'lib/botvac/robot.rb', line 10 def initialize(serial, secret) self.serial = serial self.secret = secret end |
Instance Attribute Details
#secret ⇒ Object
Returns the value of attribute secret.
8 9 10 |
# File 'lib/botvac/robot.rb', line 8 def secret @secret end |
#serial ⇒ Object
Returns the value of attribute serial.
8 9 10 |
# File 'lib/botvac/robot.rb', line 8 def serial @serial end |
Instance Method Details
#disable_schedule ⇒ Object
49 50 51 |
# File 'lib/botvac/robot.rb', line 49 def disable_schedule connection.post("messages", JSON.dump({ reqId: "1", cmd: "disableSchedule"})).body end |
#enable_schedule ⇒ Object
45 46 47 |
# File 'lib/botvac/robot.rb', line 45 def enable_schedule connection.post("messages", JSON.dump({ reqId: "1", cmd: "enableSchedule" })).body end |
#get_robot_state ⇒ Object
41 42 43 |
# File 'lib/botvac/robot.rb', line 41 def get_robot_state connection.post("messages", JSON.dump({ reqId: "1", cmd: "getRobotState" })).body end |
#get_schedule ⇒ Object
53 54 55 |
# File 'lib/botvac/robot.rb', line 53 def get_schedule connection.post("messages", JSON.dump({ reqId: "1", cmd: "getSchedule" })).body end |
#pause_cleaning ⇒ Object
29 30 31 |
# File 'lib/botvac/robot.rb', line 29 def pause_cleaning connection.post("messages", JSON.dump({ reqId: "1",cmd: "pauseCleaning" })).body end |
#send_to_base ⇒ Object
37 38 39 |
# File 'lib/botvac/robot.rb', line 37 def send_to_base connection.post("messages", JSON.dump({ reqId: "1",cmd: "sendToBase" })).body end |
#start_cleaning ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/botvac/robot.rb', line 15 def start_cleaning connection.post("messages", JSON.dump( { reqId: "1", cmd: "startCleaning", params: { category: 2, mode: 2, modifier: 2 } } )).body end |
#stop_cleaning ⇒ Object
33 34 35 |
# File 'lib/botvac/robot.rb', line 33 def stop_cleaning connection.post("messages", JSON.dump({ reqId: "1",cmd: "stopCleaning" })).body end |