Important
Remember to update DB_PASSWORD= and POSTGRES_PASSWORD= in .env
Components are .dll files that implements the IComponent interface from the Orchestrator.
- Step To create a new component start out by creating a C# class library.
mkdir MyComponent
cd MyComponent
dotnet new classlib -n MyComponent- Step Your component needs to know about the IComponent interface from Orchestrator.Core add a project reference (Update the path accordingly, the path below assumes you created your component in components/):
dotnet add reference ../orchestrator/Orchestrator.Core/Orchestrator.Core.csproj- Step Implement IComponent in your component
using Orchestrator.Core;
public class MyComponent : IComponent
{
public string ComponentType => "Mixer";
public string Protocol => "MQTT";
public string Host => "localhost";
public ushort Port => 1234;
public List<CommandDefinition> SupportedCommands => new()
{
new CommandDefinition { Name = "mix", Parameters = new() { "speed", "duration" } },
new CommandDefinition { Name = "stop", Parameters = new() }
};
}- Step Build the component as a .dll
dotnet build -c ReleaseThe build dll will be in bin/Release/net9.0/MyComponent.dll
- Step Drop your component into components/