Trying to make bridge base happy with DDVC01

This commit is contained in:
Heath Volmer
2018-02-01 15:41:36 -07:00
parent 56c418580c
commit 952e7f4083
6 changed files with 46 additions and 7 deletions

View File

@@ -84,6 +84,10 @@ namespace PepperDash.Essentials.Room.Config
return rm;
}
else if (typeName == "ddvc01Bridge")
{
return new Device(Key, Name); // placeholder device that does nothing.
}
return null;
}

View File

@@ -44,7 +44,7 @@ namespace PepperDash.Essentials
string SystemUuid;
public List<CotijaEssentialsHuddleSpaceRoomBridge> CotijaRooms { get; private set; }
public List<CotijaBridgeBase> CotijaRooms { get; private set; }
long ButtonHeartbeatInterval = 1000;
@@ -60,7 +60,7 @@ namespace PepperDash.Essentials
Config = config;
Debug.Console(0, this, "Mobile UI controller initializing for server:{0}", config.ServerUrl);
CotijaRooms = new List<CotijaEssentialsHuddleSpaceRoomBridge>();
CotijaRooms = new List<CotijaBridgeBase>();
//CrestronConsole.AddNewConsoleCommand(s => RegisterSystemToServer(),
// "CotiInitializeHttpClient", "Initializes a new HTTP client connection to a specified URL", ConsoleAccessLevelEnum.AccessOperator);

View File

@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials
{
/// <summary>
///
/// </summary>
public abstract class CotijaBridgeBase
{
public CotijaSystemController Parent { get; private set; }
public CotijaBridgeBase(CotijaSystemController parent)
{
Parent = parent;
}
}
}

View File

@@ -16,7 +16,7 @@ using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials.Room.Cotija
{
public class CotijaDdvc01RoomBridge : Device, IDelayedConfiguration
public class CotijaDdvc01RoomBridge : CotijaBridgeBase, IDelayedConfiguration
{
public class BoolJoin
{
@@ -122,6 +122,12 @@ namespace PepperDash.Essentials.Room.Cotija
public bool ConfigIsLoaded { get; private set; }
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
/// <param name="ipId"></param>
public CotijaDdvc01RoomBridge(string key, string name, uint ipId)
: base(key, name)
{
@@ -156,6 +162,9 @@ namespace PepperDash.Essentials.Room.Cotija
SetupFunctions();
SetupFeedbacks();
EISC.SigChange += EISC_SigChange;
// load config if it's already there
if (EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
LoadConfigValues();
return base.CustomActivate();
}
@@ -243,6 +252,7 @@ namespace PepperDash.Essentials.Room.Cotija
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
}
/// <summary>
@@ -329,6 +339,7 @@ namespace PepperDash.Essentials.Room.Cotija
co.SourceLists.Add("default", newSl);
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
ConfigIsLoaded = true;

View File

@@ -10,15 +10,18 @@ using PepperDash.Essentials.Room.Cotija;
namespace PepperDash.Essentials
{
public class CotijaEssentialsHuddleSpaceRoomBridge
public class CotijaEssentialsHuddleSpaceRoomBridge : CotijaBridgeBase
{
CotijaSystemController Parent;
public EssentialsHuddleSpaceRoom Room { get; private set; }
public CotijaEssentialsHuddleSpaceRoomBridge(CotijaSystemController parent, EssentialsHuddleSpaceRoom room)
/// <summary>
///
/// </summary>
/// <param name="parent"></param>
/// <param name="room"></param>
public CotijaEssentialsHuddleSpaceRoomBridge(CotijaSystemController parent, EssentialsHuddleSpaceRoom room):base(parent)
{
Parent = parent;
Room = room;
// we add actions to the messaging system with a path, and a related action. Custom action