Fusion working again for Huddle room types

This commit is contained in:
Neil Dorin
2017-04-27 23:11:09 -06:00
parent d45c661ab3
commit 5a04a23e8c
11 changed files with 492 additions and 441 deletions

View File

@@ -57,6 +57,11 @@ namespace PepperDash.Essentials
//PortalSync = new PepperDashPortalSyncClient();
//Temp Cotija testing
//CotijaInterfaceController CotijaInterface = new CotijaInterfaceController("WebClient1");
//CotijaInterface.InitializeClient("http://192.168.1.105");
Debug.Console(0, "Starting Essentials load from configuration");
ConfigReader.LoadConfig2();
LoadDevices();
@@ -155,8 +160,17 @@ namespace PepperDash.Essentials
var room = roomConfig.GetRoomObject();
if (room != null)
{
if (room is EssentialsHuddleSpaceRoom)
{
Debug.Console(1, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController((EssentialsHuddleSpaceRoom)room, 0xf1));
}
else
{
Debug.Console(1, "Room is NOT EssentialsHuddleSpaceRoom, attempting to add to DeviceManager w/o Fusion");
DeviceManager.AddDevice(room);
//DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemController(room, 0xf1));
}
#warning Add Fusion connector to room factory?
}

View File

@@ -163,6 +163,7 @@
<Compile Include="UI Drivers\SingleSubpageModalAndBackDriver.cs" />
<Compile Include="UI Drivers\SmartObjectRoomsList.cs" />
<Compile Include="UI Drivers\UIBoolJoin.cs" />
<Compile Include="UI\CotijaInterfaceController.cs" />
<Compile Include="UI\DualDisplaySourceSRLController.cs" />
<Compile Include="UI\SubpageReferenceListActivityItem.cs" />
<Compile Include="UI\CrestronTouchpanelPropertiesConfig.cs" />

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro;
using Crestron.SimplSharp.Net.Http;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.PageManagers;
namespace PepperDash.Essentials
{
public class CotijaInterfaceController : Device
{
public CotijaInterfaceController(string key) : base(key)
{
CrestronConsole.AddNewConsoleCommand(InitializeClient, "InitializeHttpClient", "Initializes a new HTTP client connection to a specified URL", ConsoleAccessLevelEnum.AccessOperator);
}
public void InitializeClient(string url)
{
HttpClient webClient = new HttpClient();
webClient.Verbose = true;
HttpClientRequest request = new HttpClientRequest();
request.Url.Parse(url);
request.Header.AddHeader(new HttpHeader("accept", "text/event-stream"));
request.Header.SetHeaderValue("Expect", "");
webClient.DispatchAsync(request, (resp, err) =>
{
CrestronConsole.PrintLine(resp.ContentString);
});
}
}
}