public override void InitPlugin()
        {
            mySensors = Context.GetPlugin<MySensorsPlugin>();

            var ctrls = Get();
            foreach (var ctrl in ctrls)
            {
                ControllerBase controller = CastController(ctrl);
                if (controller != null)
                    controllers.Add(controller);
            }

            foreach (ControllerBase controller in controllers)
                controller.Init(Context);
        }
Exemplo n.º 2
0
 public void Init(IServiceContext context)
 {
     Context = context;
     mySensors = context.GetPlugin<MySensorsPlugin>();
     InitLastValues();
 }
Exemplo n.º 3
0
 public override void InitPlugin()
 {
     mySensors = Context.GetPlugin<MySensorsPlugin>();
 }
        public override void InitPlugin()
        {
            mySensors = Context.GetPlugin<MySensorsPlugin>();

            configurationSetting = GetSetting(settingName);

            if (configurationSetting == null)
            {
                configurationSetting = new MeteoStationSetting()
                {
                    Id = Guid.NewGuid(),
                    Name = settingName
                };

                configuration = Configuration.Default;
                configurationSetting.SetValue(configuration);
                SaveOrUpdate(configurationSetting);
            }
            else
                configuration = configurationSetting.GetValue(typeof(Configuration));
        }