Server/Actions/ActionCecScan.cs
author StephaneLenclud
Thu, 25 Aug 2016 13:34:05 +0200
changeset 255 c57b8ac80fc6
parent 231 4c706feaf706
child 258 e237c2e33545
permissions -rw-r--r--
Published v1.0.2.0.
Fixed Harmony async issue prevent the config to be fetched.
StephaneLenclud@214
     1
using CecSharp;
StephaneLenclud@214
     2
using SharpLib.Ear;
StephaneLenclud@214
     3
using System;
StephaneLenclud@214
     4
using System.Collections.Generic;
StephaneLenclud@253
     5
using System.Diagnostics;
StephaneLenclud@214
     6
using System.Linq;
StephaneLenclud@214
     7
using System.Runtime.Serialization;
StephaneLenclud@214
     8
using System.Text;
StephaneLenclud@214
     9
using System.Threading.Tasks;
StephaneLenclud@214
    10
StephaneLenclud@214
    11
namespace SharpDisplayManager
StephaneLenclud@214
    12
{
StephaneLenclud@214
    13
StephaneLenclud@214
    14
    [DataContract]
StephaneLenclud@231
    15
    [AttributeObject(Id = "Cec.Scan", Name = "CEC Scan", Description = "Scan devices on your CEC HDMI network.")]
StephaneLenclud@214
    16
    class ActionCecScan : SharpLib.Ear.Action
StephaneLenclud@214
    17
    {
StephaneLenclud@228
    18
        protected override void DoExecute()
StephaneLenclud@214
    19
        {
StephaneLenclud@214
    20
            if (Cec.Client.Static == null)
StephaneLenclud@214
    21
            {
StephaneLenclud@253
    22
                Trace.WriteLine("WARNING: No CEC client installed.");
StephaneLenclud@222
    23
                return;
StephaneLenclud@214
    24
            }
StephaneLenclud@214
    25
StephaneLenclud@214
    26
            Cec.Client.Static.Scan();
StephaneLenclud@214
    27
        }
StephaneLenclud@214
    28
    }
StephaneLenclud@214
    29
}