@@ -35,7 +35,7 @@ def __init__(self):
35
35
36
36
self .client = None
37
37
38
- def read_status (self ):
38
+ def read_status (self ): #########################################
39
39
# Get device status tree
40
40
message = {
41
41
"kind" : "rpc_request" ,
@@ -59,7 +59,7 @@ def read_status(self):
59
59
# Return status as json object: status[""]
60
60
return status_tree
61
61
62
- def read_sensor (self , id ):
62
+ def read_sensor (self , id ): #########################################
63
63
# Get sensor data
64
64
peripheral_str = self .api .get_info ('peripherals' , id )
65
65
mode = peripheral_str ['mode' ]
@@ -159,17 +159,7 @@ def e_stop(self):
159
159
160
160
def unlock (self ):
161
161
# Tell bot to unlock
162
- # No inherent return value
163
-
164
- # unlock_message = {
165
- # **RPC_REQUEST,
166
- # "body": {
167
- # "kind": "emergency_unlock",
168
- # "args": {}
169
- # }
170
- # }
171
-
172
- new_unlock = {
162
+ message = {
173
163
"kind" : "rpc_request" ,
174
164
"args" : {
175
165
"label" : "" ,
@@ -182,12 +172,12 @@ def unlock(self):
182
172
}
183
173
]
184
174
}
185
- self .broker_connect .publish (new_unlock )
175
+ self .broker_connect .publish (message )
186
176
187
- # self.broker_connect.publish(unlock_message)
177
+ # No inherent return value
188
178
return print ("Triggered device unlock." )
189
179
190
- def reboot (self ):
180
+ def reboot (self ): #########################################
191
181
# Tell bot to reboot
192
182
# No inherent return value
193
183
reboot_message = {
@@ -203,7 +193,7 @@ def reboot(self):
203
193
self .broker_connect .publish (reboot_message )
204
194
return print ("Triggered device reboot." )
205
195
206
- def shutdown (self ):
196
+ def shutdown (self ): #########################################
207
197
# Tell bot to shutdown
208
198
# No inherent return value
209
199
shutdown_message = {
@@ -278,22 +268,28 @@ def set_home(self, axis='all'):
278
268
279
269
def find_home (self , axis = 'all' , speed = 100 ):
280
270
# Move to 0,0,0
281
- # Return new xyz position as values
282
271
if speed > 100 or speed < 1 :
283
272
return print ("ERROR: Speed constrained to 1-100." )
284
273
else :
285
- find_home_message = {
286
- ** RPC_REQUEST ,
287
- "body" : {
288
- "kind" : "find_home" ,
289
- "args" : {
290
- "axis" : axis ,
291
- "speed" : speed
274
+ message = {
275
+ "kind" : "rpc_request" ,
276
+ "args" : {
277
+ "label" : "" ,
278
+ "priority" : 600
279
+ },
280
+ "body" : [
281
+ {
282
+ "kind" : "find_home" ,
283
+ "args" : {
284
+ "axis" : axis ,
285
+ "speed" : speed
286
+ }
292
287
}
293
- }
288
+ ]
294
289
}
290
+ self .broker_connect .publish (message )
295
291
296
- self . broker_connect . publish ( find_home_message )
292
+ # Return new xyz position as values
297
293
298
294
def axis_length (self , axis = 'all' ):
299
295
# Get axis length
@@ -629,7 +625,7 @@ def mark_coord(self, x, y, z, property, mark_as): # TODO: Fix "label"
629
625
630
626
# TODO: water() --> all or single coords
631
627
# Dispense water at all or single xyz coords
632
- # No inherent return value
628
+ # No inherent return value✅
633
629
# TODO: dispense() --> single coords?
634
630
# Dispense from source at all or single xyz coords
635
631
# No inherent return value
0 commit comments