Server/Actions/ActionCecDeviceStandby.cs
author StephaneLenclud
Thu, 25 Aug 2016 00:42:09 +0200
changeset 253 2dae7a163fff
parent 231 4c706feaf706
child 258 e237c2e33545
permissions -rw-r--r--
Published v1.0.0.0
Updating Harmony library to v0.4.0 for keep alive support.
Improved logs mechanism.
     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.Standby", Name = "CEC Device Standby", Description = "Puts on standby the specified CEC device on your HDMI bus.")]
    16     public class ActionCecDeviceStandby : ActionCecDevice
    17     {
    18         /// <summary>
    19         /// Build a user readable string to describe this action.
    20         /// </summary>
    21         /// <returns></returns>
    22         public override string Brief()
    23         {
    24             return "CEC Standby " + DeviceName;
    25         }
    26 
    27         /// <summary>
    28         /// 
    29         /// </summary>
    30         protected override void 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.StandbyDevices(Device);
    39         }
    40 
    41     }
    42 }