MCPcopy Create free account
hub / github.com/WebThingsIO/webthing-node / asActionDescription

Method asActionDescription

lib/action.ts:57–75  ·  view source on GitHub ↗

* Get the action description. * * @returns {Object} Description of the action as an object.

()

Source from the content-addressed store, hash-verified

55 * @returns {Object} Description of the action as an object.
56 */
57 asActionDescription(): Action.ActionDescription {
58 const description: Action.ActionDescription = {
59 [this.name]: {
60 href: this.hrefPrefix + this.href,
61 timeRequested: this.timeRequested,
62 status: this.status,
63 },
64 };
65
66 if (this.input !== null) {
67 description[this.name].input = this.input;
68 }
69
70 if (this.timeCompleted !== null) {
71 description[this.name].timeCompleted = this.timeCompleted;
72 }
73
74 return description;
75 }
76
77 /**
78 * Set the prefix of any hrefs associated with this action.

Callers 5

getActionDescriptionsMethod · 0.80
actionNotifyMethod · 0.80
postMethod · 0.80
postMethod · 0.80
getMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected