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

Method callback

example/platform/gpio/gpio-property.js:80–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

78 const self = this;
79 this.config = config;
80 const callback = () => {
81 log(`log: GPIO: ${self.getName()}: open:`);
82 self.port.on('change', (value) => {
83 value = Boolean(value);
84 log(`log: GPIO: ${self.getName()}: change: ${value}`);
85 self.value.notifyOfExternalUpdate(value);
86 });
87 };
88 this.port = gpio.export(config.pin,
89 {direction: 'in', ready: callback});
90 }

Callers

nothing calls this directly

Calls 2

getNameMethod · 0.45

Tested by

no test coverage detected