Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions Package.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project>
<PropertyGroup>
<VersionPrefix>4.2.0</VersionPrefix>
<VersionPrefix>4.3.0</VersionPrefix>
<!-- <VersionSuffix>rc-3-1530995509343</VersionSuffix>-->

<Authors>Dmitry Andriyanov &lt;dima117a@gmail.com&gt;</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<Copyright>Thinking-Home.RU © 2023</Copyright>
<Copyright>Thinking-Home.RU © 2024</Copyright>

<PackageTags>thinking-home;core;noolite</PackageTags>
<PackageProjectUrl>https://github.com/thinking-home/noolite</PackageProjectUrl>
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
[![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.

## Установка

```
dotnet add package ThinkingHome.NooLite --version 4.1.0
dotnet add package ThinkingHome.NooLite --version 4.3.0
```

## Пример использования
Expand Down Expand Up @@ -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)

Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
<PropertyGroup>
<Description>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
</Description>
</PropertyGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<PackAsTool>true</PackAsTool>
<ToolCommandName>noolite</ToolCommandName>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.2" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ThinkingHome.NooLite\ThinkingHome.NooLite.csproj" />
Expand Down
14 changes: 6 additions & 8 deletions ThinkingHome.NooLite.DebugConsole/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -162,4 +160,4 @@ private static void AdapterOnReceiveData(object obj, ReceivedData result)
Console.WriteLine(result);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\ThinkingHome.NooLite\ThinkingHome.NooLite.csproj" />
Expand Down
10 changes: 5 additions & 5 deletions ThinkingHome.NooLite.Tests/ThinkingHome.NooLite.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FakeItEasy" Version="7.3.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="FakeItEasy" Version="8.3.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="xunit" Version="2.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
8 changes: 7 additions & 1 deletion ThinkingHome.NooLite.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=LocalConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=669e5282_002Dfb4b_002D4e90_002D91e7_002D07d269d04b60/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Protected, ProtectedInternal, Internal, Public, PrivateProtected" Description="Constant fields (not private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=a4f433b8_002Dabcd_002D4e55_002Da08f_002D82e78cef0f0c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Any" Description="Local constants"&gt;&lt;ElementKinds&gt;&lt;Kind Name="LOCAL_CONSTANT" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AA_BB" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
6 changes: 3 additions & 3 deletions ThinkingHome.NooLite/ThinkingHome.NooLite.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
<PropertyGroup>
<Description>.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
</Description>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Ports" Version="7.0.0" />
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"sdk": {
"version": "7.0.102"
"version": "8.0.401"
}
}