ThinkingHome.NooLite 4.0.0-rc-1

This is a prerelease version of ThinkingHome.NooLite.
There is a newer version of this package available.
See the version list below for details.
dotnet add package ThinkingHome.NooLite --version 4.0.0-rc-1
NuGet\Install-Package ThinkingHome.NooLite -Version 4.0.0-rc-1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ThinkingHome.NooLite" Version="4.0.0-rc-1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ThinkingHome.NooLite --version 4.0.0-rc-1
#r "nuget: ThinkingHome.NooLite, 4.0.0-rc-1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ThinkingHome.NooLite as a Cake Addin
#addin nuget:?package=ThinkingHome.NooLite&version=4.0.0-rc-1&prerelease

// Install ThinkingHome.NooLite as a Cake Tool
#tool nuget:?package=ThinkingHome.NooLite&version=4.0.0-rc-1&prerelease

ThinkingHome.NooLite NuGet Pre Release

Библиотека ThinkingHome.NooLite предоставляет API для управления устройствами nooLite (включая nooLite-F) на платформе .NET Core. Поддерживается работа с адаптером MTRF-64-USB. Поддерживаются операционные системы Windows, MacOS, Linux.

Установка

Package Manager

Install-Package ThinkingHome.NooLite -Version 4.0.0-beta1

.NET CLI

dotnet add package ThinkingHome.NooLite --version 4.0.0-beta1

Пример использования

using ThinkingHome.NooLite;

...

static void Main(string[] args)
{
    // параметр конструктора - имя COM порта адаптера
    // при использовании в Windows имя будет похоже на "COM4"
    using (var adapter = new MTRFXXAdapter("/dev/tty.usbserial-AL00HDFI"))
    {
        // добавляем действия при подключени к адаптеру и при отключении  
        adapter.Connect += AdapterOnConnect;
        adapter.Disconnect += AdapterOnDisconnect;

        // добавляем обработчик входящих команд
        adapter.ReceiveData += AdapterOnReceiveData;
        
        // обработка ошибок
        adapter.Error += AdapterOnError;
    
        // открываем соединение
        adapter.Open();
    
        // досрочный выход из сервисного режима
        adapter.ExitServiceMode();
    
        // включение света в 13 канале (nooLite-F)
        adapter.OnF(13);
    }
}

private static void AdapterOnConnect(object obj)
{
    Console.WriteLine("connect");
}

private static void AdapterOnDisconnect(object obj)
{
    Console.WriteLine("disconnect");
}

private static void AdapterOnReceiveData(object obj, ReceivedData result)
{
    Console.WriteLine(result);
}

private static void AdapterOnError(object obj, Exception ex)
{
    Console.WriteLine(ex.Message);
}

API

Управление нагрузкой

Перечисленные ниже методы управляют нагрузкой в стандартном режиме nooLite (без шифрования и обратной связи). Для каждого метода доступен аналогичный метод с суффиксом F, который отправляет ту же команду в режиме nooLite-F.

Включить:

void On(byte channel)

Выключить:

void Off(byte channel)

Переключить в противоположное состояние:

void Switch(byte channel)

Включить на время (interval - промежуток времени в пятисекундных интервалах):

void TemporarySwitchOn(byte channel, UInt16 interval)

Установить уровень яркости:

void SetBrightness(byte channel, byte brightness)

Запомнить сценарий освещения:

void SavePreset(byte channel)

Применить сценарий освещения:

void LoadPreset(byte channel)

Установить цвет светодиодной RGB ленты:

void SetLedColor(byte channel, byte valueR, byte valueG, byte valueB)

Изменить цвет светодиодной RGB ленты на следующий:

void ChangeLedColor(byte channel)

Изменить режим светодиодной RGB ленты:

void ChangeLedColorMode(byte channel)

Изменить скорость смены цветов светодиодной RGB ленты:

void ChangeLedColorSpeed(byte channel)

Привязка и отвязка

Привязать силовой блок:

void Bind(byte channel)

Отвязать силовой блок:

void Unbind(byte channel)

Перейти в режим привязки для привязки передающего устройства (датчика или пульта):

void BindStart(byte channel)

Выйти из режима привязки:

void BindStop()

Очистить привязанные передающие устройства в заданном канале:

void ClearChannel(byte channel)

Очистить привязанные передающие устройства во всех каналах:

void ClearAllChannels()

Выйти из сервисного режима:

void ExitServiceMode()
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ThinkingHome.NooLite:

Package Downloads
ThinkingHome.Plugins.NooLite

ThinkingHome plugin which provide API for wireless control of appliances using the nooLite system.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
4.2.0 670 1/28/2023
4.1.0 815 5/14/2022
4.0.1 915 11/21/2020
4.0.0 770 11/19/2020
4.0.0-rc-3-1530995509343 1,183 7/7/2018
4.0.0-rc-2 1,411 10/1/2017
4.0.0-rc-1 1,166 9/26/2017
4.0.0-beta2 1,227 9/23/2017
4.0.0-beta1 1,205 9/19/2017