Server/Actions/ActionCecScan.cs
author StephaneLenclud
Sun, 21 Aug 2016 19:31:08 +0200
changeset 251 f60cfcb98c9a
parent 228 6a84d8282226
child 253 2dae7a163fff
permissions -rw-r--r--
Published v0.12.2.0
Adding setting for Logitech user name.
Improved event tree view update following Harmony connection.
Removed unneeded editable fields from Harmony command action.
StephaneLenclud@214
     1
using CecSharp;
StephaneLenclud@214
     2
using SharpLib.Ear;
StephaneLenclud@214
     3
using System;
StephaneLenclud@214
     4
using System.Collections.Generic;
StephaneLenclud@214
     5
using System.Linq;
StephaneLenclud@214
     6
using System.Runtime.Serialization;
StephaneLenclud@214
     7
using System.Text;
StephaneLenclud@214
     8
using System.Threading.Tasks;
StephaneLenclud@214
     9
StephaneLenclud@214
    10
namespace SharpDisplayManager
StephaneLenclud@214
    11
{
StephaneLenclud@214
    12
StephaneLenclud@214
    13
    [DataContract]
StephaneLenclud@231
    14
    [AttributeObject(Id = "Cec.Scan", Name = "CEC Scan", Description = "Scan devices on your CEC HDMI network.")]
StephaneLenclud@214
    15
    class ActionCecScan : SharpLib.Ear.Action
StephaneLenclud@214
    16
    {
StephaneLenclud@228
    17
        protected override void DoExecute()
StephaneLenclud@214
    18
        {
StephaneLenclud@214
    19
            if (Cec.Client.Static == null)
StephaneLenclud@214
    20
            {
StephaneLenclud@214
    21
                Console.WriteLine("WARNING: No CEC client installed.");
StephaneLenclud@222
    22
                return;
StephaneLenclud@214
    23
            }
StephaneLenclud@214
    24
StephaneLenclud@214
    25
            Cec.Client.Static.Scan();
StephaneLenclud@214
    26
        }
StephaneLenclud@214
    27
    }
StephaneLenclud@214
    28
}