Ejemplo n.º 1
0
        private static async void Pin_HeatingFallingAsync() //winter and summer
        {
            var _sendData = new Pins();

            if (!IsWaterJustFinished && !IsWaterHeatPinOn) //if waterheating LED is off AND the waterheating counter isnt started then stop roomheating
            {
                TelemetryDataClass.RoomHeatingInMinutes = (int)(METHOD.DateTimeTZ().DateTime - dateTimeRoomHeat).TotalMinutes;
                TelemetryDataClass.SourceInfo           = $"3. Roomheating {TelemetryDataClass.RoomHeatingInMinutes} min";
                await _sendData.SendData();

                TelemetryDataClass.RoomHeatingInMinutes = 0;
            }

            await Task.Delay(TimeSpan.FromSeconds(3)); //wait for a 3 seconds, maybe the waterheating just finished and it is already off?

            if (IsWaterHeatPinOn)                      //heating system in WATERHEATING mode, waterheating LED always on, this is for summer time
            {
                TelemetryDataClass.WaterHeatingInMinutes = (int)(METHOD.DateTimeTZ().DateTime - dateTimeWaterHeat).TotalMinutes;
                TelemetryDataClass.SourceInfo            = $"4. Waterheating {TelemetryDataClass.WaterHeatingInMinutes} min";
                await _sendData.SendData();

                TelemetryDataClass.WaterHeatingInMinutes = 0;
            }
        }