Hi, I am writing nodes to control a robot. Therefore I am including a robot control pallet.
Is it possible to subscribe to RED.events in the onpaletteadd function so that I can update the color of the buttons according to the current status of the robot.
onpaletteadd: function () {
// In the onpaletteadd function the default variables of the node get node assigned automatically moreover RED.nodes is not yet ready
const node = this;
// The html content of the sidebar page has been specified a a data-template, from where it can be loaded:
const htmlContent = $($('script[type="text/x-red"][data-template-name="robot-sidebar"]').i18n().html());
// Add a new "MySidebarName" tab sheet to the right sidebar in the flow editor, where you show the html content
RED.sidebar.addTab({
id: "robot-sidebar",
label: "Robot Control",
name: "Robot Control",
content: htmlContent,
closeable: false,
enableOnEdit: true,
iconClass: "fa fa-terminal"
});
RED.events.on(event, (msg) => {