From 7027f994be502806cdfc780057bb47b4f3f11bfc Mon Sep 17 00:00:00 2001 From: Dmitry Andriyanov Date: Sat, 24 Aug 2024 00:33:01 +0300 Subject: [PATCH 1/2] dotnet8 --- .github/workflows/dotnet.yml | 4 ++-- Package.xml | 4 ++-- README.md | 2 +- .../ThinkingHome.NooLite.Console.csproj | 4 ++-- ThinkingHome.NooLite.DebugConsole/Program.cs | 14 ++++++-------- .../ThinkingHome.NooLite.DebugConsole.csproj | 2 +- .../ThinkingHome.NooLite.Tests.csproj | 10 +++++----- ThinkingHome.NooLite.sln.DotSettings | 8 +++++++- ThinkingHome.NooLite/ThinkingHome.NooLite.csproj | 4 ++-- global.json | 2 +- 10 files changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index f643ba4..69f0c2e 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,8 +16,8 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v2 with: - dotnet-version: 7.0.x + dotnet-version: 8.0.x - name: Restore dependencies run: dotnet restore - name: Test - run: dotnet test ./ThinkingHome.NooLite.Tests --no-restore --verbosity normal -c Release -f net7.0 + run: dotnet test ./ThinkingHome.NooLite.Tests --no-restore --verbosity normal -c Release -f net8.0 diff --git a/Package.xml b/Package.xml index 8608705..906e0aa 100644 --- a/Package.xml +++ b/Package.xml @@ -1,11 +1,11 @@ - 4.2.0 + 4.3.0 Dmitry Andriyanov <dima117a@gmail.com> en-US - Thinking-Home.RU © 2023 + Thinking-Home.RU © 2024 thinking-home;core;noolite https://github.com/thinking-home/noolite diff --git a/README.md b/README.md index e29968e..6672afc 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ## Установка ``` -dotnet add package ThinkingHome.NooLite --version 4.1.0 +dotnet add package ThinkingHome.NooLite --version 4.3.0 ``` ## Пример использования diff --git a/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj b/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj index ed4292b..6aa0084 100755 --- a/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj +++ b/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj @@ -11,10 +11,10 @@ http://www.noo.com.by Exe true noolite - net7.0 + net8.0 - + diff --git a/ThinkingHome.NooLite.DebugConsole/Program.cs b/ThinkingHome.NooLite.DebugConsole/Program.cs index e15ddd8..2fb321c 100644 --- a/ThinkingHome.NooLite.DebugConsole/Program.cs +++ b/ThinkingHome.NooLite.DebugConsole/Program.cs @@ -17,7 +17,7 @@ static void Main(string[] args) // return; //using (var adapter = new MTRFXXAdapter("/dev/tty.usbserial-AI04XT35")) using var adapter = new MTRFXXAdapter("/dev/tty.usbserial-AL00HDFI"); - + adapter.Connect += AdapterOnConnect; adapter.Disconnect += AdapterOnDisconnect; @@ -45,13 +45,13 @@ static void Main(string[] args) Console.WriteLine("exit service mode"); adapter.ExitServiceMode(); Thread.Sleep(100); - - + + // Console.WriteLine("bind"); // Console.ReadKey(); // // adapter.Bind(2); - + Console.WriteLine("on"); adapter.OnF(13); Thread.Sleep(1500); @@ -72,12 +72,10 @@ static void Main(string[] args) Thread.Sleep(500); Console.WriteLine("done"); - return; - for (byte ch = 0; ch < 64; ch++) { Console.WriteLine($@"clear: {ch}"); - + // adapter.ClearChannel(ch); // adapter.Unbind(ch); // adapter.UnbindF(ch); @@ -162,4 +160,4 @@ private static void AdapterOnReceiveData(object obj, ReceivedData result) Console.WriteLine(result); } } -} +} \ No newline at end of file diff --git a/ThinkingHome.NooLite.DebugConsole/ThinkingHome.NooLite.DebugConsole.csproj b/ThinkingHome.NooLite.DebugConsole/ThinkingHome.NooLite.DebugConsole.csproj index a5da9da..0f7e1aa 100755 --- a/ThinkingHome.NooLite.DebugConsole/ThinkingHome.NooLite.DebugConsole.csproj +++ b/ThinkingHome.NooLite.DebugConsole/ThinkingHome.NooLite.DebugConsole.csproj @@ -1,7 +1,7 @@  Exe - net7.0 + net8.0 diff --git a/ThinkingHome.NooLite.Tests/ThinkingHome.NooLite.Tests.csproj b/ThinkingHome.NooLite.Tests/ThinkingHome.NooLite.Tests.csproj index 8bf2abd..683bffd 100755 --- a/ThinkingHome.NooLite.Tests/ThinkingHome.NooLite.Tests.csproj +++ b/ThinkingHome.NooLite.Tests/ThinkingHome.NooLite.Tests.csproj @@ -1,13 +1,13 @@  - net7.0 + net8.0 false - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ThinkingHome.NooLite.sln.DotSettings b/ThinkingHome.NooLite.sln.DotSettings index f00258c..8e5732c 100644 --- a/ThinkingHome.NooLite.sln.DotSettings +++ b/ThinkingHome.NooLite.sln.DotSettings @@ -3,4 +3,10 @@ <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /> <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> \ No newline at end of file + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /></Policy> + <Policy><Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"><ElementKinds><Kind Name="FIELD" /><Kind Name="READONLY_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"><ElementKinds><Kind Name="CONSTANT_FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /></Policy> + <Policy><Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local constants"><ElementKinds><Kind Name="LOCAL_CONSTANT" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /></Policy> + <Policy><Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"><ElementKinds><Kind Name="FIELD" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></Policy> + True \ No newline at end of file diff --git a/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj b/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj index adf4f91..eb60bc5 100755 --- a/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj +++ b/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj @@ -7,10 +7,10 @@ http://www.noo.com.by - net7.0 + net8.0 true - + diff --git a/global.json b/global.json index 9b92080..36d37e6 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "7.0.102" + "version": "8.0.401" } } From 3ca700e091d1ac9e2a3653c89028b515b19c7c64 Mon Sep 17 00:00:00 2001 From: Dmitry Andriyanov Date: Wed, 4 Sep 2024 21:58:40 +0300 Subject: [PATCH 2/2] readme --- README.md | 10 +++++++++- .../ThinkingHome.NooLite.Console.csproj | 2 +- ThinkingHome.NooLite/ThinkingHome.NooLite.csproj | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6672afc..4876583 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![Build & Tests](https://github.com/thinking-home/noolite/actions/workflows/dotnet.yml/badge.svg)](https://github.com/thinking-home/noolite/actions/workflows/dotnet.yml) [![NuGet Pre Release](https://img.shields.io/nuget/vpre/ThinkingHome.NooLite.svg)](https://www.nuget.org/packages/ThinkingHome.NooLite) -Библиотека [ThinkingHome.NooLite](https://www.nuget.org/packages/ThinkingHome.NooLite) предоставляет API для управления устройствами [nooLite](https://www.noo.com.by/sistema-noolite.html) (включая nooLite-F) на платформе .NET Core. Поддерживается работа с адаптером [MTRF-64-USB](https://www.noo.com.by/mtrf-64-usb.html). Поддерживаются операционные системы Windows, MacOS, Linux. +Библиотека [ThinkingHome.NooLite](https://www.nuget.org/packages/ThinkingHome.NooLite) предоставляет API для управления устройствами [nooLite](https://noo.by/produkcia/sistema-noolite.html) (включая nooLite-F) на платформе .NET Core. Поддерживается работа с адаптером [MTRF-64-USB](https://noo.by/adapter-mtrf-64-usb-a.html). Поддерживаются операционные системы Windows, MacOS, Linux. ## Установка @@ -235,3 +235,11 @@ $ noolite set-brightness --help $ noolite on /dev/tty.usbserial-AL00HDFI 13 -f ``` +## Дополнительно + +Примеры использования API адаптера MTRF-64-USB с сайта производителя: + +1. [Привязка устройства к адаптеру](https://noo.by/uroki/s-urok-1-privyazka-ustrojstva-noolite-f-k-adapteru-mtrf-64-usb.html) +2. [Чтение ответа от устройства](https://noo.by/uroki/s-urok-2-chtenie-otveta-ot-ustrojstva.html) +3. [Отправка команды на установку яркости по ID устройства](https://noo.by/uroki/s-urok-3-otpravka-komandy-na-ustanovku-yarkosti-po-id-ustrojstva.html) + diff --git a/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj b/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj index 6aa0084..57300a6 100755 --- a/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj +++ b/ThinkingHome.NooLite.Console/ThinkingHome.NooLite.Console.csproj @@ -3,7 +3,7 @@ Command line interface for the wireless control of appliances using the nooLite system (including nooLite-F mode). Adapter MTRF-64-USB is supported. -http://www.noo.com.by +https://noo.by/produkcia/sistema-noolite.html diff --git a/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj b/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj index eb60bc5..da99994 100755 --- a/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj +++ b/ThinkingHome.NooLite/ThinkingHome.NooLite.csproj @@ -3,7 +3,7 @@ .NET Core API for the wireless control of appliances using the nooLite system (including nooLite-F mode). Adapter MTRF-64-USB is supported. -http://www.noo.com.by +https://noo.by/produkcia/sistema-noolite.html