ginomessmer / magic-home-dotnet

A reverse engineered library for Magic Home enabled smart light devices for .NET Core

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A reverse engineered library for Magic Home enabled smart light devices for .NET Core

License:MIT License


Languages

Language:C# 100.0%