ts3 config get

This commit is contained in:
2021-04-21 20:33:52 +02:00
parent 1148d416a0
commit 5daad265b8
9 changed files with 552 additions and 357 deletions

View File

@@ -0,0 +1,23 @@
import { NodeInitializer } from "node-red";
import { Ts3ConfigNode } from "../ts3-config/types";
import { Ts3GetConfig, Ts3GetNode } from "./types";
const nodeInit: NodeInitializer = (RED): void => {
function Ts3Get(
this: Ts3GetNode,
config: Ts3GetConfig
): void {
RED.nodes.createNode(this, config);
this.warn(config.configid)
this.ts3Config = RED.nodes.getNode(config.configid) as Ts3ConfigNode
this.on("input", (msg) => {
msg.payload = this.ts3Config.credentials.username
this.send(msg)
})
}
RED.nodes.registerType("ts3-get", Ts3Get);
};
export = nodeInit;