コード例 #1
0
ファイル: Worker.cs プロジェクト: gabsanzsalas/SystemsVera
 public Worker(ILogger <Worker> logger, ApiClient veraClient, MqttManager mqttManager, AgentVeraSettings agentVeraSettings, Scheduler scheduler)
 {
     _logger            = logger;
     _apiClient         = veraClient;
     _mqttManager       = mqttManager;
     _agentVeraSettings = agentVeraSettings;
     _scheduler         = scheduler;
 }
コード例 #2
0
 public MqttManager(AgentVeraSettings agentVeraSettings, MqttFactory mqttFactory, ApiClient apiClient, Scheduler scheduler)
 {
     this.agentVeraSettings = agentVeraSettings;
     SetConnectionOptions();
     this.mqttClient = mqttFactory.CreateMqttClient();
     this.apiClient  = apiClient;
     this.scheduler  = scheduler;
     SubscribeMqttClientAsync();
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: gabsanzsalas/SystemsVera
 public static IHostBuilder CreateHostBuilder(string[] args) =>
 Host.CreateDefaultBuilder(args)
 .ConfigureServices((hostContext, services) =>
 {
     IConfiguration configuration    = hostContext.Configuration;
     AgentVeraSettings alarmSettings = configuration.Get <AgentVeraSettings>();
     services.AddSingleton(alarmSettings);
     services.AddTransient <ApiClient>();
     services.AddTransient <MqttFactory>();
     services.AddTransient <MqttManager>();
     services.AddTransient <Scheduler>();
     services.AddHostedService <Worker>();
 });
コード例 #4
0
ファイル: ApiClient.cs プロジェクト: gabsanzsalas/SystemsVera
 public ApiClient(AgentVeraSettings agentVeraSettings)
 {
     _httpClient            = new HttpClient();
     this.agentVeraSettings = agentVeraSettings;
 }