MCPcopy Index your code
hub / github.com/WebThingsIO/webthing-node / getEventDescriptions

Method getEventDescriptions

lib/thing.ts:292–300  ·  view source on GitHub ↗

* Get the thing's events as an array. * * @param {String?} eventName Optional event name to get descriptions for * * @returns {Object} Event descriptions.

(eventName?: string|null)

Source from the content-addressed store, hash-verified

290 * @returns {Object} Event descriptions.
291 */
292 getEventDescriptions(eventName?: string|null): Event.EventDescription[] {
293 if (!eventName) {
294 return this.events.map((e) => e.asEventDescription());
295 } else {
296 return this.events.
297 filter((e) => e.getName() === eventName).
298 map((e) => e.asEventDescription());
299 }
300 }
301
302 /**
303 * Add a property to this thing.

Callers 2

getMethod · 0.80
getMethod · 0.80

Calls 2

asEventDescriptionMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected