Server/Actions/ActionCecDevicePowerOn.cs
author StephaneLenclud
Wed, 05 Oct 2016 15:02:09 +0200
changeset 270 5dcd226539d4
parent 258 e237c2e33545
permissions -rw-r--r--
Published v1.3.4.0
Harmony connection retries.
     1 using CecSharp;
     2 using SharpLib.Ear;
     3 using System;
     4 using System.Collections.Generic;
     5 using System.Diagnostics;
     6 using System.Linq;
     7 using System.Runtime.InteropServices;
     8 using System.Runtime.Serialization;
     9 using System.Text;
    10 using System.Threading.Tasks;
    11 
    12 namespace SharpDisplayManager
    13 {
    14     [DataContract]
    15     [AttributeObject(Id = "Cec.Device.PowerOn", Name = "CEC Device Power On", Description = "Turns on the specified CEC device on your HDMI bus.")]
    16     public class ActionCecDevicePowerOn : ActionCecDevice
    17     {
    18         /// <summary>
    19         /// 
    20         /// </summary>
    21         /// <returns></returns>
    22         public override string BriefBase()
    23         {
    24             return "CEC Power On " + DeviceName;
    25         }
    26 
    27         /// <summary>
    28         /// 
    29         /// </summary>
    30         protected override async Task DoExecute()
    31         {
    32             if (Cec.Client.Static == null)
    33             {
    34                 Trace.WriteLine("WARNING: No CEC client installed.");
    35                 return;
    36             }
    37 
    38             Cec.Client.Static.Lib.PowerOnDevices(Device);
    39         }
    40     }
    41 }