An open-source Crestron SimplSharp Pro framework for Crestron control systems
To use this test library in your project, follow these steps:
-
Install the package via NuGet. You can use the following command in the Package Manager Console:
dotnet add [<PROJECT>] package UXAV.AVnet.Core
-
Import the library classes in your code file(s):
using UXAV.AVnet.Core.Models; using UXAV.AVnet.Core.Models.Diagnostics; using UXAV.Logging;
-
Create a class that inherits from SystemBase:
public class MySystem : SystemBase { public MySystem(CrestronControlSystem controlSystem) : base(controlSystem) { // create all your instance logic here and any instances of rooms, devices or } protected override void AppShouldRunUpgradeScripts() { // called when the program starts with a new version number } protected override void OnProgramStatusEventHandler(eProgramStatusEventType eventType) { if (eventType == eProgramStatusEventType.Stopping) { // anything you need to save, disconnect or stop... the program is stopping } } protected override IEnumerable<DiagnosticMessage> GenerateDiagnosticMessages() { return new DiagnosticMessage[] { // add any diagnostic messages here, // this is called for when the system needs to update the // status of stuff or the dashboard app requests it }; } protected override void SystemShouldAddItemsToInitialize(Action<IInitializable> addItem) { addItem(myDeviceWithInitialization); addItem(myOtherDeviceWithInitialization); } protected override void WebScriptingHandlersShouldRegister() { // any web scripting handlers for API's can and should register here (see docs) } }
-
Load and Initialize your main instance of system
public class ControlSystem : CrestronControlSystem { private readonly SystemBase _mySystem; public ControlSystem() { try { // create your instance of MySystem _mySystem = new MySystem(this); } catch (Exception e) { Logger.Error(e); } } public override void InitializeSystem() { try { // start the initializing of MySystem _mySystem?.Initialize(); } catch (Exception e) { Logger.Error(e); } } }
GitHub Repository: AVnetCore
NuGet Package: UXAV.AVnet.Core
- UXAV.Logging
- Crestron.SimpleSharp.SDK.ProgramLibrary
- Crestron.SimplSharp.SDK.ProgramLibrary
- Cronos
- CsvHelper
- Figgle
- Microsoft.AspNet.WebApi.Client
- Microsoft.CSharp
- MimeTypes
- Newtonsoft.Json
- Newtonsoft.Json.Schema
- System.IO.Compression
- System.Net.Http
- System.Reflection.MetadataLoadContext
- System.Runtime.Serialization.Json
- UXAV.Logging
- WebSocketSharp-netstandard
- Reconfigured workspace to new style SDK format and added support for .NET 6.0
- MidnightNotifier removed completely, use a CronJob
Documentation can be viewed in GitHub Pages
Contributions are welcome! If you would like to contribute to this project, please follow these guidelines:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Submit a pull request to the main repository.
Please ensure that your code follows the project's coding conventions and includes appropriate tests.
- For feature branches use the name
feature/feature-name
- Version numbers are checked against existing tags and fail CI on match
Thank you for your interest in contributing to this project!
This project is licensed under the MIT License.