Contrequarte.SmartPlug.Core.TimePeriod.EdimaxScheduledEntryPart2ScheduledEntry C# (CSharp) Méthode

EdimaxScheduledEntryPart2ScheduledEntry() private static méthode

Converting a single schedule entry of the smartplug to a ScheduledEntry object such a single schedule entry consists of 5 characters [hour][minute][hour][minute][on/Off] [hour] is one single char representing the numbers from 0 to 23/24 [minute] is one single char representing the numbers from 0 to 59 [on/off] char '1' stands for 'on' char '0' represents 'off'
private static EdimaxScheduledEntryPart2ScheduledEntry ( string scheduledListPart ) : ScheduledEntry
scheduledListPart string string value of a singele scheduled entry, always has a length of 5 chars
Résultat ScheduledEntry
        private static ScheduledEntry EdimaxScheduledEntryPart2ScheduledEntry(string scheduledListPart)
        {
            int[] numericValues = { -1, -1, -1, -1 };
            for (int pos = 0; pos < 4; pos++)
            {
                numericValues[pos] = CharToNumber(scheduledListPart[pos]);
            }
            TimePeriod timePeriod = new TimePeriod(new PointInTime(numericValues[0], numericValues[1]),
                                                   new PointInTime(numericValues[2], numericValues[3]));

            return new ScheduledEntry(timePeriod, (scheduledListPart[4] == '1'));
        }