Update C2nRthsController to use IHasCresnetBranches Interface

Inprogress #297
This commit is contained in:
Trevor Payne
2020-07-02 15:36:59 -05:00
parent bfe87ae090
commit 4360dcdca9
3 changed files with 4 additions and 10 deletions

View File

@@ -118,12 +118,12 @@ namespace PepperDash.Essentials.Core.CrestronIO
Debug.Console(0, "Device {0} is a valid cresnet master - creating new C2nRths", parentKey);
return new C2nRths(cresnetId, Global.ControlSystem);
}
var cresnetBridge = DeviceManager.GetDeviceForKey(parentKey) as ICresnetBridge;
var cresnetBridge = DeviceManager.GetDeviceForKey(parentKey) as IHasCresnetBranches;
if (cresnetBridge != null)
{
Debug.Console(0, "Device {0} is a valid cresnet master - creating new C2nRths", parentKey);
return new C2nRths(cresnetId, cresnetBridge.Branches[branchId]);
return new C2nRths(cresnetId, cresnetBridge.CresnetBranches[branchId]);
}
Debug.Console(0, "Device {0} is not a valid cresnet master", parentKey);
return null;