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

Method getAction

lib/thing.ts:401–413  ·  view source on GitHub ↗

* Get an action. * * @param {String} actionName Name of the action * @param {String} actionId ID of the action * @returns {Object} The requested action if found, else null

(actionName: string, actionId: string)

Source from the content-addressed store, hash-verified

399 * @returns {Object} The requested action if found, else null
400 */
401 getAction(actionName: string, actionId: string): Action|null {
402 if (!this.actions.hasOwnProperty(actionName)) {
403 return null;
404 }
405
406 for (const action of this.actions[actionName]) {
407 if (action.getId() === actionId) {
408 return action;
409 }
410 }
411
412 return null;
413 }
414
415
416 /**

Callers 2

removeActionMethod · 0.95
getMethod · 0.80

Calls 1

getIdMethod · 0.45

Tested by

no test coverage detected