C# Class Contrequarte.SmartPlug.Core.TimePeriod

Exibir arquivo Open project: contrequarte/SmartPlugSP2101W Class Usage Examples

Public Methods

Method Description
EdimaxScheduleList2ScheduledEntries ( string edimaxScheduleList ) : IEnumerable

Converting the value of an Edimax node to a List. the node value looks like following e.g.: 00011-0c0m1-m0mu1-n0nP1

IsIntersectionFree ( IEnumerable timePeriods ) : bool

Checking, if an enumeration of TimePeriod objects doesn't contain intersecting TimePeriods

TimePeriod ( PointInTime begin, PointInTime end ) : System

Private Methods

Method Description
CharToNumber ( char charToConvert ) : int

Converting the characters used in to the corresponding number to get the times coded mor human readable

EdimaxScheduledEntryPart2ScheduledEntry ( string scheduledListPart ) : ScheduledEntry

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'

Method Details

EdimaxScheduleList2ScheduledEntries() public static method

Converting the value of an Edimax node to a List. the node value looks like following e.g.: 00011-0c0m1-m0mu1-n0nP1
public static EdimaxScheduleList2ScheduledEntries ( string edimaxScheduleList ) : IEnumerable
edimaxScheduleList string string representing the schedule list from an Edimax SmartPlug
return IEnumerable

IsIntersectionFree() public static method

Checking, if an enumeration of TimePeriod objects doesn't contain intersecting TimePeriods
public static IsIntersectionFree ( IEnumerable timePeriods ) : bool
timePeriods IEnumerable enumeration of Timeperiod objects to check
return bool

TimePeriod() public method

public TimePeriod ( PointInTime begin, PointInTime end ) : System
begin PointInTime
end PointInTime
return System