Server/Actions/ActionCecDevicePowerOn.cs
author StephaneLenclud
Wed, 28 Sep 2016 22:31:27 +0200
changeset 269 8e32e51a2edd
parent 258 e237c2e33545
permissions -rw-r--r--
Published V1.3.2.0
     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 }