Updatest to CotjaDdvc01RoomBridge to enable source control joins on EISC (need to update API words in dictionary to match existing interface extensions)

This commit is contained in:
Neil Dorin
2018-07-18 15:04:39 -06:00
parent 385686e7e0
commit b16d61f64c
7 changed files with 150 additions and 9 deletions

View File

@@ -92,6 +92,10 @@ namespace PepperDash.Essentials.Bridges
};
}
/// <summary>
/// API class for IBasicCommunication devices
/// </summary>
public class IBasicCommunicationApi : DeviceApiBase
{
public IBasicCommunication Device { get; set; }

View File

@@ -105,6 +105,8 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
<Compile Include="Bridges\BridgeBase.cs" />
<Compile Include="Bridges\BridgeFactory.cs" />
<Compile Include="Configuration ORIGINAL\Builders\TPConfig.cs" />
<Compile Include="Configuration ORIGINAL\Configuration.cs" />
<Compile Include="Configuration ORIGINAL\ConfigurationHelpers.cs" />
@@ -154,6 +156,7 @@
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IPowerExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ISetTopBoxControlsExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ITransportExtensions.cs" />
<Compile Include="Room\Cotija\RoomBridges\SourceDeviceMapDictionary.cs" />
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" />

View File

@@ -80,8 +80,26 @@ namespace PepperDash.Essentials
},
"mobilehttpdebug", "1 enables more verbose HTTP response debugging", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(TestHttpRequest,
"mobilehttprequest", "Tests an HTTP get to URL given", ConsoleAccessLevelEnum.AccessOperator);
"mobilehttprequest", "Tests an HTTP get to URL given", ConsoleAccessLevelEnum.AccessOperator);
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
}
/// <summary>
/// Sends message to server to indicate the system is shutting down
/// </summary>
/// <param name="programEventType"></param>
void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
{
if (programEventType == eProgramStatusEventType.Stopping && WSClient.Connected)
{
SendMessageToServer(JObject.FromObject( new
{
type = "/system/close"
}));
}
}
/// <summary>
@@ -449,7 +467,12 @@ namespace PepperDash.Essentials
/// </summary>
/// <param name="content"></param>
void HandleHeartBeat(JToken content)
{
{
SendMessageToServer(JObject.FromObject(new
{
type = "/system/heartbeatAck"
}));
var code = content["userCode"];
if(code != null)
{

View File

@@ -250,6 +250,18 @@ namespace PepperDash.Essentials.Room.Cotija
EISC.PulseBool(BoolJoin.ShutdownEnd)));
Parent.AddAction(@"/room/room1/shutdownCancel", new Action(() =>
EISC.PulseBool(BoolJoin.ShutdownCancel)));
// Source Device (Current Source)'
SourceDeviceMapDictionary sourceJoinMap = new SourceDeviceMapDictionary();
var prefix = @"/device/currentSource/";
foreach (var item in sourceJoinMap)
{
Parent.AddAction(prefix + item.Key, new PressAndHoldAction(b => EISC.SetBool(item.Value, b)));
}
}
/// <summary>
@@ -319,12 +331,17 @@ namespace PepperDash.Essentials.Room.Cotija
//Room
if (co.Rooms == null)
co.Rooms = new List<EssentialsRoomConfig>();
var rm = new EssentialsRoomConfig();
if (co.Rooms.Count == 0)
{
Debug.Console(0, this, "Adding room to config");
co.Rooms.Add(rm);
}
var rm = new EssentialsRoomConfig();
if (co.Rooms.Count == 0)
{
Debug.Console(0, this, "Adding room to config");
co.Rooms.Add(rm);
}
else
{
Debug.Console(0, this, "Replacing Room[0] in config");
co.Rooms[0] = rm;
}
rm.Name = EISC.StringOutput[501].StringValue;
rm.Key = "room1";
rm.Type = "ddvc01";

View File

@@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Room.Cotija
{
/// <summary>
/// Contains all of the default joins that map to API funtions
/// </summary>
public class SourceDeviceMapDictionary : Dictionary<string, uint>
{
public SourceDeviceMapDictionary(): base()
{
var dictionary = new Dictionary<string, uint>
{
{"preset01", 101},
{"preset02", 102},
{"preset03", 103},
{"preset04", 104},
{"preset05", 105},
{"preset06", 106},
{"preset07", 107},
{"preset08", 108},
{"preset09", 109},
{"preset10", 110},
{"preset11", 111},
{"preset12", 112},
{"preset13", 113},
{"preset14", 114},
{"preset15", 115},
{"preset16", 116},
{"preset17", 117},
{"preset18", 118},
{"preset19", 119},
{"preset20", 120},
{"preset21", 121},
{"preset22", 122},
{"preset23", 123},
{"preset24", 124},
{"key0", 130},
{"key1", 131},
{"key2", 132},
{"key3", 133},
{"key4", 134},
{"key5", 135},
{"key6", 136},
{"key7", 137},
{"key8", 138},
{"key9", 139},
{"keyDash", 140},
{"keyEnter", 141},
{"channelUp", 142},
{"channelDown", 143},
{"channelLast", 144},
{"exit", 145},
{"power", 146},
{"red", 147},
{"green", 148},
{"yellow", 149},
{"blue", 150},
{"video", 151},
{"previous", 152},
{"next", 153},
{"rewind", 154},
{"ffwd", 155},
{"closedCaption", 156},
{"stop", 157},
{"pause", 158},
{"cursorUp", 159},
{"cursorDown", 160},
{"cursorLeft", 161},
{"cursorRight", 162},
{"settings", 163},
{"info", 164},
{"return", 165},
{"guide", 166},
{"reboot", 167},
{"play", 170},
{"cursorOk", 171},
{"record", 172},
{"menu", 173},
{"topMenu", 174}
};
}
}
}