Skip to content

Commit f522b6b

Browse files
committed
Fix typo
1 parent 00f8c8f commit f522b6b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

otbox.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,14 @@ def _on_mqtt_connect(self, client, userdata, flags, rc):
300300
self.tb.on_mqtt_connect()
301301

302302
# discover motes
303-
self._excecute_command_safely('box', 'all', json.dumps({'token': 123}), 'discovermotes')
303+
self._execute_command_safely('box', 'all', json.dumps({'token': 123}), 'discovermotes')
304304

305305
def _on_mqtt_message(self, client, userdata, message):
306306

307307
# call the handler
308-
self._excecute_commands(message.topic, message.payload)
308+
self._execute_commands(message.topic, message.payload)
309309

310-
def _excecute_commands(self, topic, payload):
310+
def _execute_commands(self, topic, payload):
311311
# parse the topic to extract deviceType, deviceId and cmd ([0-9\-]+)
312312
try:
313313
m = re.search('{0}/deviceType/([a-z]+)/deviceId/([\w,\-]+)/cmd/([a-z]+)'.format(self.testbed), topic)
@@ -336,15 +336,15 @@ def _excecute_commands(self, topic, payload):
336336
for d in device_to_comand:
337337
commands_handlers += [threading.Thread(
338338
name = '{0}_command_{1}'.format(d, cmd),
339-
target = self._excecute_command_safely,
339+
target = self._execute_command_safely,
340340
args = (deviceType, d, payload, cmd))
341341
]
342342
for handler in commands_handlers:
343343
handler.start()
344344
except:
345345
self.logger.exception("Could not parse command with topic %s", topic)
346346

347-
def _excecute_command_safely(self, deviceType, deviceId, payload, cmd):
347+
def _execute_command_safely(self, deviceType, deviceId, payload, cmd):
348348
'''
349349
Executes the handler of a command in a try/except environment so exception doesn't crash server.
350350
'''

0 commit comments

Comments
 (0)