[update] fix stop error & relative_time

This commit is contained in:
peterlu14
2022-04-08 11:17:07 +08:00
parent 71850b31a8
commit 455fa1f86b
5 changed files with 47 additions and 31 deletions
+5 -2
View File
@@ -9,7 +9,6 @@ class Action():
self._duration = action.get('duration', None)
self._goto = action.get('goto', None)
self._cycle = action.get('cycle', None)
self._instruction = None
self.update_instruction()
@@ -19,12 +18,16 @@ class Action():
return self._type
def update_instruction(self):
instruction_type = self._type
if instruction_type == 'stop':
instruction_type = 'interrupt'
self._instruction = {
"device_instruction": {
"header": "call_instruction",
"device": self._target,
"arguments": {
"instruction": self._type,
"instruction": instruction_type,
}
},
"device_parameter": {