public TemperatureWorker(
     ILogger <TemperatureWorker> logger,
     ITemperatureReader temperatureReader,
     IHubContext <TemperatureHub> temperatureHubContext,
     ITemperatureSource temperatureSource)
 {
     this.logger                = logger;
     this.temperatureReader     = temperatureReader;
     this.temperatureHubContext = temperatureHubContext;
     this.temperatureSource     = temperatureSource;
 }
 public CpuTemperatureMonitor(
     ILogger <CpuTemperatureMonitor> logger,
     IOptions <AzureIoTHubConfiguration> azureIoTHubConnectionConfiguration,
     IOptions <CpuTemperatureMonitorConfiguration> cpuTemperatureMonitorConfiguration,
     ITemperatureReader temperatureReader
     )
 {
     _logger = logger;
     _azureIoTHubConnectionConfiguration = azureIoTHubConnectionConfiguration;
     _cpuTemperatureMonitorConfiguration = cpuTemperatureMonitorConfiguration;
     _temperatureReader = temperatureReader;
     _deviceClient      = DeviceClient.CreateFromConnectionString(_azureIoTHubConnectionConfiguration.Value.ConnectionString, TransportType.Mqtt);
 }
Exemplo n.º 3
0
		public Hardware(
			IOutputConnection pumpOutputConnection,
			IOutputConnection elementOutputConnection,
			ITemperatureReader tankTemperatureReader,
			ITemperatureReader inletTemperatureReader,
			ITemperatureReader roofTemperatureReader

			)
		{
			PumpOutputConnection = pumpOutputConnection;
			ElementOutputConnection = elementOutputConnection;
			TankTemperatureReader = tankTemperatureReader;
			InletTemperatureReader = inletTemperatureReader;
			RoofTemperatureReader = roofTemperatureReader;
		}
Exemplo n.º 4
0
        public Hardware(
            IOutputConnection pumpOutputConnection,
            IOutputConnection pumpLedOutputConnection,
            IOutputConnection elementOutputConnection,
            IOutputConnection elementLedOutputConnection,
            ITemperatureReader tankTemperatureReader,
            ITemperatureReader inletTemperatureReader,
            ITemperatureReader roofTemperatureReader

            )
        {
            PumpOutputConnection       = pumpOutputConnection;
            PumpLedOutputConnection    = pumpLedOutputConnection;
            ElementOutputConnection    = elementOutputConnection;
            ElementLedOutputConnection = elementLedOutputConnection;
            TankTemperatureReader      = tankTemperatureReader;
            InletTemperatureReader     = inletTemperatureReader;
            RoofTemperatureReader      = roofTemperatureReader;
        }
Exemplo n.º 5
0
        public static SensorReaderRunner WithTemperature(this SensorReaderRunner readerRunner, TemperatureSensorType type)
        {
            ITemperatureReader reader = null;

            switch (type)
            {
            case TemperatureSensorType.BME280:
                reader = new BME280Reader();
                break;

            case TemperatureSensorType.DHT22:
                reader = new DHT22Reader();
                break;
            }
            if (reader != null)
            {
                readerRunner.TemperatureReaders.Add(reader);
            }
            return(readerRunner);
        }