diff --git a/ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/README.md b/ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/README.md new file mode 100644 index 0000000..54f0c0b --- /dev/null +++ b/ThreeByte.LinkLib/ThreeByte.LinkLib.NetBooter/README.md @@ -0,0 +1,188 @@ +# πŸ”‹ ThreeByte.LinkLib.NetBooter + +**Client library for controlling Synaccess NetBooter networked power controllers β€” toggle outlets, poll state, and monitor power remotely.** + +[![NuGet](https://img.shields.io/nuget/v/ThreeByte.LinkLib.NetBooter?color=blue&logo=nuget)](https://www.nuget.org/packages/ThreeByte.LinkLib.NetBooter) +![.NET](https://img.shields.io/badge/.NET-10.0%20%7C%20Standard%202.0%20%7C%20Standard%202.1-purple?logo=dotnet) + +--- + +## ✨ Features + +| Feature | Description | +|---------|-------------| +| πŸ”‹ **Outlet Control** | Turn individual power outlets on and off programmatically | +| πŸ“Š **State Polling** | Query all outlet states in a single call | +| πŸ”” **Property Change Notifications** | Implements `INotifyPropertyChanged` for UI data binding | +| 🌐 **HTTP-Based** | Communicates via the NetBooter's built-in web API | +| ⚠️ **Error Events** | Event-driven error reporting | + +--- + +## πŸ“¦ Installation + +``` +dotnet add package ThreeByte.LinkLib.NetBooter +``` + +or via the NuGet Package Manager: + +``` +Install-Package ThreeByte.LinkLib.NetBooter +``` + +--- + +## πŸš€ Quick Start + +```csharp +using ThreeByte.LinkLib.NetBooter; + +// Connect to a NetBooter device +var netBooter = new NetBooterLink("192.168.1.10"); + +// Subscribe to errors +netBooter.ErrorOccurred += (s, ex) => + Console.WriteLine($"Error: {ex.Message}"); + +// Turn on outlet 1 +netBooter.Power(outlet: 1, state: true); + +// Turn off outlet 3 +netBooter.Power(outlet: 3, state: false); + +// Poll all outlet states from the device +netBooter.PollState(); + +// Check individual outlet states +bool outlet1 = netBooter[1]; // true = ON +bool outlet2 = netBooter[2]; // false = OFF +Console.WriteLine($"Outlet 1: {(outlet1 ? "ON" : "OFF")}"); +Console.WriteLine($"Outlet 2: {(outlet2 ? "ON" : "OFF")}"); +``` + +### WPF / MVVM Data Binding + +`NetBooterLink` implements `INotifyPropertyChanged`, making it easy to bind to UI: + +```xml + + + + +