Server/Actions/ActionCecStandbyTv.cs
author StephaneLenclud
Sun, 24 Jul 2016 20:36:07 +0200
changeset 214 4961ede27e0a
permissions -rw-r--r--
Adding a bunch of CEC actions.
     1 using CecSharp;
     2 using SharpLib.Ear;
     3 using System;
     4 using System.Collections.Generic;
     5 using System.Linq;
     6 using System.Runtime.Serialization;
     7 using System.Text;
     8 using System.Threading.Tasks;
     9 
    10 namespace SharpDisplayManager
    11 {
    12     [DataContract]
    13     [AttributeAction(Id = "Cec.StandbyTv", Name = "CEC Standby TV", Description = "Standby TVs on your CEC HDMI network.")]
    14     class ActionCecStandbyTv : SharpLib.Ear.Action
    15     {
    16         public override void Execute()
    17         {
    18             if (Cec.Client.Static == null)
    19             {
    20                 Console.WriteLine("WARNING: No CEC client installed.");
    21             }
    22 
    23             Cec.Client.Static.Lib.StandbyDevices(CecLogicalAddress.Tv);
    24         }
    25     }
    26 }