Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Commit 1d8a704

Browse files
committed
Changed action status messages
1 parent 737c3e9 commit 1d8a704

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

webthing/action.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, thing, name, target, input_):
3030

3131
self.href_prefix = ""
3232
self.href = "/actions/{}/{}".format(self.name, self.id)
33-
self.status = "created"
33+
self.status = "pending"
3434
self.time_requested = timestamp()
3535
self.time_completed = None
3636

@@ -99,7 +99,7 @@ def get_input(self):
9999

100100
async def start(self):
101101
"""Start performing the action."""
102-
self.status = "pending"
102+
self.status = "running"
103103
self.thing.action_notify(self)
104104
# If the action function is async
105105
if asyncio.iscoroutinefunction(self.target_function):
@@ -168,7 +168,7 @@ def as_action_description(self):
168168
"href": {"type": "string", "format": "uri"},
169169
"timeRequested": {"type": "string", "format": "date-time"},
170170
"timeCompleted": {"type": "string", "format": "date-time"},
171-
"status": {"type": "string", "enum": ["created", "pending", "completed", "cancelled", "error"]},
171+
"status": {"type": "string", "enum": ["pending", "running", "completed", "cancelled", "error"]},
172172
**({"output": self.output} if self.output else {}),
173173
**({"input": self.input} if self.input else {}),
174174
}

0 commit comments

Comments
 (0)