node-red-contrib-smartnora
Version:
Google Smart Home integration via Smart Nora https://smart-nora.eu/
19 lines (18 loc) • 668 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const async_commands_registry_1 = require("../nora/async-commands.registry");
const util_1 = require("./util");
module.exports = function (RED) {
RED.nodes.registerType('noraf-async', function (config) {
RED.nodes.createNode(this, config);
(0, util_1.handleNodeInput)({
node: this,
nodeConfig: config,
handler: msg => async_commands_registry_1.AsyncCommandsRegistry.handle({
id: msg._asyncCommandId,
response: msg.payload,
warn: w => this.warn(w),
}),
});
});
};