public override void Configure(Container container) { JsConfig.EmitCamelCaseNames = true; Plugins.Add(new SwaggerFeature()); var manager = new InsteonManager(insteonSource); container.Register(manager); var settingsProvider = new SettingsProvider(new RoamingAppDataStorage("Insteon")); var mySettings = settingsProvider.GetSettings <SmartThingsSettings>(); container.Register(mySettings); manager.Network.Devices.DeviceStatusChanged += (sender, data) => { logger.DebugFormat("{0}:{1}", data.Device.Address, data.DeviceStatus); var settings = container.Resolve <SmartThingsSettings>(); var cb = new SmartThingsCallbacks(settings); cb.PushDeviceStatusUpdate(data.Device, data.DeviceStatus); }; GlobalResponseFilters.Add((req, res, dto) => { res.AddHeader("X-Insteon", ServiceName); }); manager.Connect(); }
public override void Configure(Container container) { JsConfig.EmitCamelCaseNames = true; Plugins.Add(new SwaggerFeature()); var manager = new InsteonManager(insteonSource); container.Register(manager); var settingsProvider = new SettingsProvider(new RoamingAppDataStorage("Insteon")); var mySettings = settingsProvider.GetSettings<SmartThingsSettings>(); container.Register(mySettings); manager.Network.Devices.DeviceStatusChanged += (sender, data) => { logger.DebugFormat("{0}:{1}", data.Device.Address, data.DeviceStatus); var settings = container.Resolve<SmartThingsSettings>(); var cb = new SmartThingsCallbacks(settings); cb.PushDeviceStatusUpdate(data.Device, data.DeviceStatus); }; GlobalResponseFilters.Add((req, res, dto) => { res.AddHeader("X-Insteon", ServiceName); }); manager.Connect(); }