feat: Enhance device testing and environment handling with new interfaces and fakes

This commit is contained in:
Neil Dorin 2026-04-08 13:21:15 -06:00
parent 24df4e7a03
commit 37961b9eac
11 changed files with 421 additions and 33 deletions

View file

@ -91,13 +91,18 @@ public class DebugWebsocketSink : ILogEventSink, IKeyed
if (!File.Exists(CertPath))
CreateCert();
CrestronEnvironment.ProgramStatusEventHandler += type =>
try
{
if (type == eProgramStatusEventType.Stopping)
CrestronEnvironment.ProgramStatusEventHandler += type =>
{
StopServer();
}
};
if (type == eProgramStatusEventType.Stopping)
StopServer();
};
}
catch
{
// CrestronEnvironment is not available in test / dev environments — safe to skip.
}
}
private static void CreateCert()