示例#1
0
 /// <summary>
 /// Acquires TradfriGroup object
 /// </summary>
 /// <param name="refresh">If set to true, than it will ignore existing cached value and ask the gateway for the object</param>
 /// <returns></returns>
 public TradfriSmartTask GetTradfriSmartTask(bool refresh = false)
 {
     if (!refresh && _task != null)
     {
         return(_task);
     }
     _task = JsonConvert.DeserializeObject <TradfriSmartTask>(Get().PayloadString);
     return(_task);
 }
示例#2
0
 public static ApiTradfriSmartTask Map(TradfriSmartTask sTask)
 {
     return(sTask != null ? new ApiTradfriSmartTask
     {
         ActionTurnOff = Map(sTask.ActionTurnOff),
         ActionTurnOn = Map(sTask.ActionTurnOn),
         CreatedAt = sTask.CreatedAt,
         ID = sTask.ID,
         LightState = sTask.LightState,
         RepeatDays = sTask.RepeatDays,
         TaskType = (ApiTradfriConstAttr)sTask.TaskType,
         TriggerTimeInterval = sTask.TriggerTimeInterval?.Select(tti => Map(tti))?.ToArray()
     } : null);
 }
示例#3
0
 public List <string> GetSelectedRepeatDays(TradfriSmartTask task)
 {
     return(GetSelectedRepeatDays(task.RepeatDays));
 }