Skip to content
This repository has been archived by the owner on Dec 11, 2022. It is now read-only.

hansmbakker/broadlink-dotnet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Broadlink.Net

.Net library for Broadlink devices.

Ported from https://github.com/mjg59/python-broadlink/.

NOT MAINTAINED

This project is not maintained anymore. Feel free to fork and improve it.

Currently only supports RM devices (tested with RM3 Mini Blackbean).

Usage

var client = new Client();
var discoveredDevices = await client.DiscoverAsync();
        
if (discoveredDevices.Any())
{
    var deviceToUse = discoveredDevices.FirstOrDefault();
    if(deviceToUse != null)
    {
        // cast to RMDevice to use RM specific commands
        var rmDevice = deviceToUse as RMDevice;
        
        // authorize before calling further methods
        await rmDevice.AuthorizeAsync();
        
        // get the temperature as a float
        var temp = await rmDevice.GetTemperatureAsync();
        
        // enter learning mode
        await rmDevice.EnterLearningModeAsync();
        
        // give the user 3 seconds to push a remote button and read the data from it
        await Task.Delay(3000);
        var data = await rmDevice.ReadLearningDataAsync();
        
        // send a remote control command that was learned before
        await rmDevice.SendRemoteCommandAsync(data);
    }
}

Releases

No releases published

Packages

No packages published

Languages