Add backward action
Add backward action
This commit is contained in:
+6
-4
@@ -582,10 +582,11 @@ class EcoVacsIOT():
|
||||
|
||||
|
||||
def _handle_ctl(self, action, message):
|
||||
resp = self._ctl_to_dict(action, message['resp'])
|
||||
if resp is not None:
|
||||
for s in self.ctl_subscribers:
|
||||
s(resp)
|
||||
if not message == {}:
|
||||
resp = self._ctl_to_dict(action, message['resp'])
|
||||
if resp is not None:
|
||||
for s in self.ctl_subscribers:
|
||||
s(resp)
|
||||
|
||||
|
||||
def _ctl_to_dict(self, action, xmlstring):
|
||||
@@ -709,6 +710,7 @@ class EcoVacsXMPP(ClientXMPP):
|
||||
class VacBotCommand:
|
||||
ACTION = {
|
||||
'forward': 'forward',
|
||||
'backward': 'backward',
|
||||
'left': 'SpinLeft',
|
||||
'right': 'SpinRight',
|
||||
'turn_around': 'TurnAround',
|
||||
|
||||
+7
-3
@@ -215,9 +215,13 @@ def run(actions, debug):
|
||||
vacbot = VacBot(api.uid, api.REALM, api.resource, api.user_access_token, vacuum, config['continent'])
|
||||
#vacbot.connect_and_wait_until_ready()(
|
||||
|
||||
#vacbot.run(Clean('spotarea', 'normal', 'start', '2'))
|
||||
vacbot.request_all_statuses()
|
||||
|
||||
vacbot.run(Move('backward'))
|
||||
vacbot.run(Move('backward'))
|
||||
vacbot.run(Move('stop'))
|
||||
#vacbot.run(Clean('spotarea', 'normal', 'start', '0'))
|
||||
|
||||
#vacbot.request_all_statuses()
|
||||
|
||||
# for action in actions:
|
||||
# click.echo("performing " + str(action.vac_command))
|
||||
# vacbot.run(action.vac_command)
|
||||
|
||||
@@ -103,6 +103,9 @@ def test_move_command():
|
||||
c = Move(action='forward')
|
||||
assert_equals(ElementTree.tostring(c.to_xml()),
|
||||
b'<ctl td="Move"><move action="forward" /></ctl>')
|
||||
c = Move(action='backward')
|
||||
assert_equals(ElementTree.tostring(c.to_xml()),
|
||||
b'<ctl td="Move"><move action="backward" /></ctl>')
|
||||
c = Move(action='stop')
|
||||
assert_equals(ElementTree.tostring(c.to_xml()),
|
||||
b'<ctl td="Move"><move action="stop" /></ctl>')
|
||||
|
||||
Reference in New Issue
Block a user