feat: move MC into Essentials

In order to solve some dependency issues that keep cropping up, MC
should be moved back into the Essentials repo and loaded automatically
on startup. This will allow for all plugins that use the MC Messengers
library to use the same version without fear of overwriting a dll due to
loading of plugin libraries.
This commit is contained in:
Andrew Welker
2025-03-24 22:28:27 -05:00
parent 3d91723ab0
commit f6fdc14059
89 changed files with 15625 additions and 7 deletions

View File

@@ -261,6 +261,7 @@ namespace PepperDash.Essentials
_ = new DeviceFactory();
_ = new ProcessorExtensionDeviceFactory();
_ = new MobileControl.MobileControlFactory();
Debug.LogMessage(LogEventLevel.Information, "Starting Essentials load from configuration");
@@ -469,26 +470,34 @@ namespace PepperDash.Essentials
/// Reads all rooms from config and adds them to DeviceManager
/// </summary>
public void LoadRooms()
{
{
if (ConfigReader.ConfigObject.Rooms == null)
{
Debug.LogMessage(LogEventLevel.Information, "Notice: Configuration contains no rooms - Is this intentional? This may be a valid configuration.");
return;
}
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
{
var room = Core.DeviceFactory.GetDevice(roomConfig);
DeviceManager.AddDevice(room);
if (room is ICustomMobileControl)
try
{
continue;
var room = Core.DeviceFactory.GetDevice(roomConfig);
DeviceManager.AddDevice(room);
if (room is ICustomMobileControl)
{
continue;
}
} catch (Exception ex)
{
Debug.LogMessage(ex, "Exception loading room {roomKey}:{roomType}", null, roomConfig.Key, roomConfig.Type);
continue;
}
}
Debug.LogMessage(LogEventLevel.Information, "All Rooms Loaded.");
}
/// <summary>