Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Latest commit

 

History

History
50 lines (37 loc) · 1.43 KB

README.md

File metadata and controls

50 lines (37 loc) · 1.43 KB

Magic Home Light SDK for .NET

Build Status https://www.nuget.org/packages/MagicHome.NET

This unofficial library lets you control Magic Home enabled lights that are connected to the same local area network.

Requirements

  • .NET Standard 2.0 or above
  • Magic Home enabled smart home light device that runs on LEDENET

Features

  • Connect to lights in network
  • Read properties of light
  • Set various properties of light such as power state, color
  • Easy to use

Install

Get it from https://www.nuget.org/packages/MagicHome.NET or with your favorite CLI tool:

Install-Package MagicHome.NET
dotnet add package MagicHome.NET

Show me the code

var light = new Light();
await light.ConnectAsync("192.168.0.10");

Console.WriteLine(light.Color);

await light.TurnOnAsync();

await light.SetColorAsync(Color.Red);
await Task.Delay(500);

await light.SetColorAsync(255, 255, 255);
await Task.Delay(500);

await light.RestoreAsync();
light.Dispose();

Credit where credit is due

This project was heavily inspired by