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

Method addAvailableEvent

lib/thing.ts:433–442  ·  view source on GitHub ↗

* Add an available event. * * @param {String} name Name of the event * @param {Object} metadata Event metadata, i.e. type, description, etc., as * an object.

(name: string, metadata: Event.EventMetadata)

Source from the content-addressed store, hash-verified

431 * an object.
432 */
433 addAvailableEvent(name: string, metadata: Event.EventMetadata): void {
434 if (!metadata) {
435 metadata = {};
436 }
437
438 this.availableEvents[name] = {
439 metadata: metadata,
440 subscribers: new Set(),
441 };
442 }
443
444 /**
445 * Perform an action on the thing.

Callers 2

makeThingFunction · 0.95
constructorMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected