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

Method propertyNotify

lib/thing.ts:589–604  ·  view source on GitHub ↗

* Notify all subscribers of a property change. * * @param {Object} property The property that changed

(property: Property)

Source from the content-addressed store, hash-verified

587 * @param {Object} property The property that changed
588 */
589 propertyNotify(property: Property): void {
590 const message = JSON.stringify({
591 messageType: 'propertyStatus',
592 data: {
593 [property.getName()]: property.getValue(),
594 },
595 });
596
597 for (const subscriber of this.subscribers) {
598 try {
599 subscriber.send(message);
600 } catch (e) {
601 // do nothing
602 }
603 }
604 }
605
606 /**
607 * Notify all subscribers of an action status change.

Callers 1

constructorMethod · 0.80

Calls 3

getValueMethod · 0.80
sendMethod · 0.80
getNameMethod · 0.45

Tested by

no test coverage detected