private void LoadData(MqttPlugin plugin)
        {
            if (plugin != null)
            {
                headerLabel.Text = plugin.Name.ToUpper();
                pluginBindingSource.CurrentItemChanged   -= BindingSource_CurrentItemChanged;
                securityBindingSource.CurrentItemChanged -= BindingSource_CurrentItemChanged;

                pluginBindingSource.DataSource   = plugin;
                securityBindingSource.DataSource = plugin.Security;

                publishPanel.Controls.Clear();

                foreach (var p in plugin.Publishes)
                {
                    ProfileSubjectControl c = new ProfileSubjectControl(p, plugin);
                    c.PropertyChanged += ProfileSubjectPropertyChanged;
                    publishPanel.Controls.Add(c);
                }

                subscribePanel.Controls.Clear();

                foreach (var p in plugin.Subscribes)
                {
                    ProfileSubjectControl c = new ProfileSubjectControl(p, plugin);
                    c.PropertyChanged += ProfileSubjectPropertyChanged;
                    subscribePanel.Controls.Add(c);
                }

                pluginBindingSource.CurrentItemChanged   += BindingSource_CurrentItemChanged;
                securityBindingSource.CurrentItemChanged += BindingSource_CurrentItemChanged;
            }
        }
Example #2
0
 public TmpPlugin(DatabasePlugin database, ScriptsPlugin scripts, CronPlugin cron,
                  MqttPlugin mqtt, TelegramBotPlugin telegramBot)
 {
     this.database    = database;
     this.scripts     = scripts;
     this.cron        = cron;
     this.mqtt        = mqtt;
     this.telegramBot = telegramBot;
 }
Example #3
0
 public override async Task InitPlugin()
 {
     mqtt    = Context.Require <MqttPlugin>();
     devices = Context.Require <DevicesPlugin>();
     noolite = Context.Require <NooLitePlugin>();
 }