diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml index 202d435ea..38a16eab7 100644 --- a/.github/workflows/ci_build.yml +++ b/.github/workflows/ci_build.yml @@ -17,10 +17,10 @@ jobs: - name: πŸ“€ Checkout the repository uses: actions/checkout@main - - name: πŸ₯… Install .Net 6 + - name: πŸ₯… Install .Net 7 uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0.x" # SDK Version + dotnet-version: "7.0.x" # SDK Version - name: πŸ” Enable problem matchers run: echo "::add-matcher::.github/matchers/dotnet.json" @@ -30,10 +30,10 @@ jobs: - name: πŸ‘€ Test run: | - dotnet test src/HassModel/NetDaemon.HassModel.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover - dotnet test src/Extensions/NetDaemon.Extensions.Scheduling.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover - dotnet test src/Client/NetDaemon.HassClient.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=json /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover - dotnet test src/AppModel/NetDaemon.AppModel.Tests -v minimal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:MergeWith=${{github.workspace}}/codecover.json /p:CoverletOutput=${{github.workspace}}/codecover + dotnet test -v minimal '/p:CollectCoverage=true;CoverletOutputFormat=json;MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/HassModel/NetDaemon.HassModel.Tests + dotnet test -v minimal '/p:CollectCoverage=true;CoverletOutputFormat=json;MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/Extensions/NetDaemon.Extensions.Scheduling.Tests + dotnet test -v minimal '/p:CollectCoverage=true;CoverletOutputFormat=json;MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/Client/NetDaemon.HassClient.Tests + dotnet test -v minimal '/p:CollectCoverage=true;CoverletOutputFormat=lcov;MergeWith=${{github.workspace}}/codecover.json;CoverletOutput=${{github.workspace}}/codecover' src/AppModel/NetDaemon.AppModel.Tests - name: πŸ“¨ Publish coverage report to coveralls.io uses: coverallsapp/github-action@master diff --git a/.github/workflows/ci_integration_tests.yaml b/.github/workflows/ci_integration_tests.yaml index be3e0c55e..0c441f752 100644 --- a/.github/workflows/ci_integration_tests.yaml +++ b/.github/workflows/ci_integration_tests.yaml @@ -41,10 +41,10 @@ jobs: - name: πŸ“₯ Checkout the repository uses: actions/checkout@main - - name: πŸ₯… Install .Net 6 + - name: πŸ₯… Install .Net 7 uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0.x" # SDK Version + dotnet-version: "7.0.x" # SDK Version - name: πŸ› οΈ Build code run: dotnet build @@ -74,7 +74,7 @@ jobs: - name: Get Home Assistant log in failure if: ${{ failure() }} - run: docker logs ${{ steps.homeassistant.outputs.container_name }} + run: docker logs ${{ steps.homeassistant.outputs.containername }} - name: Discord failure notification if: ${{ github.event_name == 'schedule' && failure() }} diff --git a/.github/workflows/push_nuget_manual.yml b/.github/workflows/push_nuget_manual.yml index 1013e3192..74f6941a1 100644 --- a/.github/workflows/push_nuget_manual.yml +++ b/.github/workflows/push_nuget_manual.yml @@ -26,10 +26,10 @@ jobs: echo Current version: $latest echo "::set-output name=version::$latest" - - name: πŸ₯… Install .Net 6 + - name: πŸ₯… Install .Net 7 uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0.x" # SDK Version + dotnet-version: "7.0.x" # SDK Version - name: πŸ”– Set version number run: | diff --git a/.github/workflows/tags_nuget.yml b/.github/workflows/tags_nuget.yml index c6a2d0adb..66d9ae106 100644 --- a/.github/workflows/tags_nuget.yml +++ b/.github/workflows/tags_nuget.yml @@ -23,10 +23,10 @@ jobs: echo Current version: $latest echo "::set-output name=version::$latest" - - name: πŸ₯… Install .Net 6 + - name: πŸ₯… Install .Net 7 uses: actions/setup-dotnet@v1 with: - dotnet-version: "6.0.x" # SDK Version + dotnet-version: "7.0.x" # SDK Version - name: πŸ”– Set version number run: | diff --git a/Dockerfile b/Dockerfile index e6baf7337..d2e3b172c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN \ && rm -rf /var/cache/apk/* # Pre-build .NET NetDaemon core project -FROM mcr.microsoft.com/dotnet/sdk:6.0.100-bullseye-slim-amd64 as netbuilder +FROM mcr.microsoft.com/dotnet/sdk:7.0.100-bullseye-slim-amd64 as netbuilder ARG TARGETPLATFORM ARG BUILDPLATFORM @@ -28,7 +28,7 @@ COPY ./src /usr/src RUN dotnet publish /usr/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj -o "/daemon" # Final stage, create the runtime container -FROM ghcr.io/net-daemon/netdaemon_base +FROM ghcr.io/net-daemon/netdaemon_base7 # # Install S6 and the Admin site # COPY ./Docker/rootfs/etc/services.d/NetDaemonAdmin /etc/services.d/NetDaemonAdmin diff --git a/Dockerfile.AddOn b/Dockerfile.AddOn index da387c949..877e4b93c 100644 --- a/Dockerfile.AddOn +++ b/Dockerfile.AddOn @@ -1,6 +1,6 @@ # No admin support yet, we need to build the websocket API # Pre-build .NET NetDaemon core project -FROM mcr.microsoft.com/dotnet/sdk:6.0.100-bullseye-slim-amd64 as netbuilder +FROM mcr.microsoft.com/dotnet/sdk:7.0.100-bullseye-slim-amd64 as netbuilder ARG TARGETPLATFORM ARG BUILDPLATFORM @@ -14,7 +14,7 @@ COPY ./src /usr/src RUN dotnet publish /usr/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj -o "/daemon" # Final stage, create the runtime container -FROM ghcr.io/net-daemon/netdaemon_addonbase +FROM ghcr.io/net-daemon/netdaemon_addonbase7 # # Install S6 and the Admin site COPY ./Docker/rootfs/etc/services.d/NetDaemonAddOnApp /etc/services.d/NetDaemonAddOnApp diff --git a/global.json b/global.json new file mode 100644 index 000000000..36e1a9e95 --- /dev/null +++ b/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "7.0.0", + "rollForward": "latestMajor", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/src/AppModel/NetDaemon.AppModel.Tests/Config/ConfigTests.cs b/src/AppModel/NetDaemon.AppModel.Tests/Config/ConfigTests.cs index ebee0a097..ea9fbee26 100644 --- a/src/AppModel/NetDaemon.AppModel.Tests/Config/ConfigTests.cs +++ b/src/AppModel/NetDaemon.AppModel.Tests/Config/ConfigTests.cs @@ -1,3 +1,4 @@ +using System.Diagnostics.CodeAnalysis; using System.Reflection; using LocalApps; using Microsoft.Extensions.Configuration; @@ -19,7 +20,7 @@ public void TestAddJsonConfigGetsSettingsCorrectly() var settings = configRoot.GetSection("TestConfig").Get(); // CHECK - settings.AString + settings!.AString .Should() .Be("Hello test!"); } @@ -34,7 +35,7 @@ public void TestAddYamlConfigGetsSettingsCorrectly() var settings = configRoot.GetSection("TestConfig").Get(); // CHECK - settings.AString + settings!.AString .Should() .Be("Hello test!"); } @@ -185,4 +186,4 @@ internal class TestSettings public string AString { get; set; } = string.Empty; } -#endregion \ No newline at end of file +#endregion diff --git a/src/AppModel/NetDaemon.AppModel.Tests/NetDaemon.AppModel.Tests.csproj b/src/AppModel/NetDaemon.AppModel.Tests/NetDaemon.AppModel.Tests.csproj index be515c926..513baaa65 100644 --- a/src/AppModel/NetDaemon.AppModel.Tests/NetDaemon.AppModel.Tests.csproj +++ b/src/AppModel/NetDaemon.AppModel.Tests/NetDaemon.AppModel.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable false @@ -13,11 +13,11 @@ - - + + - - + + diff --git a/src/AppModel/NetDaemon.AppModel/Common/Extensions/IConfigurationBuilderExtensions.cs b/src/AppModel/NetDaemon.AppModel/Common/Extensions/IConfigurationBuilderExtensions.cs index 7449fc421..1bdf0a209 100644 --- a/src/AppModel/NetDaemon.AppModel/Common/Extensions/IConfigurationBuilderExtensions.cs +++ b/src/AppModel/NetDaemon.AppModel/Common/Extensions/IConfigurationBuilderExtensions.cs @@ -46,7 +46,7 @@ internal static IConfigurationBuilder AddYamlFile(this IConfigurationBuilder bui { if (provider == null && Path.IsPathRooted(filePath)) { - provider = new PhysicalFileProvider(Path.GetDirectoryName(filePath)); + provider = new PhysicalFileProvider(Path.GetDirectoryName(filePath)??""); filePath = Path.GetFileName(filePath); } @@ -60,4 +60,4 @@ internal static IConfigurationBuilder AddYamlFile(this IConfigurationBuilder bui builder.Add(source); return builder; } -} \ No newline at end of file +} diff --git a/src/AppModel/NetDaemon.AppModel/Internal/Config/AppConfig.cs b/src/AppModel/NetDaemon.AppModel/Internal/Config/AppConfig.cs index f1011d315..117a8688b 100644 --- a/src/AppModel/NetDaemon.AppModel/Internal/Config/AppConfig.cs +++ b/src/AppModel/NetDaemon.AppModel/Internal/Config/AppConfig.cs @@ -7,7 +7,7 @@ namespace NetDaemon.AppModel.Internal.Config; public AppConfig(IConfiguration config, IConfigurationBinding configBinder, ILogger> logger) { var type = typeof(T); - var section = config.GetSection(type.FullName); + var section = config.GetSection(type.FullName!); if (!section.Exists()) { diff --git a/src/AppModel/NetDaemon.AppModel/Internal/Config/ConfigurationBinding.cs b/src/AppModel/NetDaemon.AppModel/Internal/Config/ConfigurationBinding.cs index e07149ef3..957bfa7d2 100644 --- a/src/AppModel/NetDaemon.AppModel/Internal/Config/ConfigurationBinding.cs +++ b/src/AppModel/NetDaemon.AppModel/Internal/Config/ConfigurationBinding.cs @@ -14,7 +14,7 @@ internal interface IConfigurationBinding /// Class that allows binding strongly typed objects to configuration values. /// /// -/// This is a scaled down and modified version of .NET 6 implementation. +/// This is a scaled down and modified version of .NET 7 implementation. /// internal class ConfigurationBinding : IConfigurationBinding { diff --git a/src/AppModel/NetDaemon.AppModel/NetDaemon.AppModel.csproj b/src/AppModel/NetDaemon.AppModel/NetDaemon.AppModel.csproj index 7127bdffc..05ecd082a 100644 --- a/src/AppModel/NetDaemon.AppModel/NetDaemon.AppModel.csproj +++ b/src/AppModel/NetDaemon.AppModel/NetDaemon.AppModel.csproj @@ -1,6 +1,6 @@ - net6.0 + net7.0 enable enable JoySoftware.NetDaemon.AppModel @@ -20,16 +20,16 @@ - - - - - - - - + + + + + + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Client/NetDaemon.HassClient.Debug/NetDaemon.HassClient.Debug.csproj b/src/Client/NetDaemon.HassClient.Debug/NetDaemon.HassClient.Debug.csproj index bbfc398c7..d6af6add4 100644 --- a/src/Client/NetDaemon.HassClient.Debug/NetDaemon.HassClient.Debug.csproj +++ b/src/Client/NetDaemon.HassClient.Debug/NetDaemon.HassClient.Debug.csproj @@ -1,7 +1,7 @@ - + @@ -10,7 +10,7 @@ Exe - net6.0 + net7.0 enable enable @@ -27,13 +27,13 @@ - - - - - + + + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Client/NetDaemon.HassClient.Tests/ExtensionsTest/MqttEntityManagerTests/JsonNodeExtensionTests.cs b/src/Client/NetDaemon.HassClient.Tests/ExtensionsTest/MqttEntityManagerTests/JsonNodeExtensionTests.cs index e5a9261e0..d6f2f9536 100644 --- a/src/Client/NetDaemon.HassClient.Tests/ExtensionsTest/MqttEntityManagerTests/JsonNodeExtensionTests.cs +++ b/src/Client/NetDaemon.HassClient.Tests/ExtensionsTest/MqttEntityManagerTests/JsonNodeExtensionTests.cs @@ -56,11 +56,11 @@ public void CanAddComplexToSimple() j1.AddRange(J(o2)); var combined = JsonConvert.DeserializeObject(j1.ToJsonString()); - Assert.Equal("1", combined.a.ToString()); - Assert.Equal("2", combined.b.ToString()); - Assert.Equal("3", combined.c.ToString()); - Assert.Equal("8", combined.d.x.ToString()); - Assert.Equal("9", combined.d.y.ToString()); + Assert.Equal("1", combined?.a.ToString()); + Assert.Equal("2", combined?.b.ToString()); + Assert.Equal("3", combined?.c.ToString()); + Assert.Equal("8", combined?.d.x.ToString()); + Assert.Equal("9", combined?.d.y.ToString()); } [Fact] @@ -73,10 +73,10 @@ public void CanMergeSimpleIntoComplex() j1.AddRange(J(o2)); var combined = JsonConvert.DeserializeObject(j1.ToJsonString()); - Assert.Equal("3", combined.a.ToString()); - Assert.Equal("2", combined.b.ToString()); - Assert.Equal("8", combined.c.x.ToString()); - Assert.Equal("9", combined.c.y.ToString()); + Assert.Equal("3", combined?.a.ToString()); + Assert.Equal("2", combined?.b.ToString()); + Assert.Equal("8", combined?.c.x.ToString()); + Assert.Equal("9", combined?.c.y.ToString()); } [Fact] @@ -89,10 +89,10 @@ public void CanMergeComplexIntoSimple() j1.AddRange(J(o2)); var combined = JsonConvert.DeserializeObject(j1.ToJsonString()); - Assert.Equal("1", combined.a.ToString()); - Assert.Equal("2", combined.b.ToString()); - Assert.Equal("8", combined.c.x.ToString()); - Assert.Equal("9", combined.c.y.ToString()); + Assert.Equal("1", combined?.a.ToString()); + Assert.Equal("2", combined?.b.ToString()); + Assert.Equal("8", combined?.c.x.ToString()); + Assert.Equal("9", combined?.c.y.ToString()); } [Fact] @@ -105,11 +105,11 @@ public void CanMergeComplexIntoComplex() j1.AddRange(J(o2)); var combined = JsonConvert.DeserializeObject(j1.ToJsonString()); - Assert.Equal("1", combined.a.ToString()); - Assert.Equal("10", combined.b.q.ToString()); - Assert.Equal("11", combined.b.r.ToString()); - Assert.Equal("8", combined.c.x.ToString()); - Assert.Equal("9", combined.c.y.ToString()); + Assert.Equal("1", combined?.a.ToString()); + Assert.Equal("10", combined?.b.q.ToString()); + Assert.Equal("11", combined?.b.r.ToString()); + Assert.Equal("8", combined?.c.x.ToString()); + Assert.Equal("9", combined?.c.y.ToString()); } [Fact] @@ -141,15 +141,15 @@ public void CanMergeMultiLayerComplex() j1.AddRange(J(o2)); var combined = JsonConvert.DeserializeObject(j1.ToJsonString()); - Assert.Equal("1", combined.a.ToString()); - Assert.Equal("2", combined.b.ToString()); - Assert.Equal("3", combined.c.ToString()); - Assert.Equal("smith", combined.person.name.surname.ToString()); - Assert.Equal("john", combined.person.name.forename.ToString()); - Assert.Equal("11000", combined.person.age.quantity.ToString()); - Assert.Equal("days", combined.person.age.unit.ToString()); - Assert.Equal("numeric", combined.id.style.ToString()); - Assert.Equal("1234", combined.id.value.ToString()); + Assert.Equal("1", combined?.a.ToString()); + Assert.Equal("2", combined?.b.ToString()); + Assert.Equal("3", combined?.c.ToString()); + Assert.Equal("smith", combined?.person.name.surname.ToString()); + Assert.Equal("john", combined?.person.name.forename.ToString()); + Assert.Equal("11000", combined?.person.age.quantity.ToString()); + Assert.Equal("days", combined?.person.age.unit.ToString()); + Assert.Equal("numeric", combined?.id.style.ToString()); + Assert.Equal("1234", combined?.id.value.ToString()); } @@ -157,4 +157,4 @@ private static JsonObject J(dynamic o) { return JsonSerializer.SerializeToNode(o); } -} \ No newline at end of file +} diff --git a/src/Client/NetDaemon.HassClient.Tests/NetDaemon.HassClient.Tests.csproj b/src/Client/NetDaemon.HassClient.Tests/NetDaemon.HassClient.Tests.csproj index fb8d3b535..61e90e693 100644 --- a/src/Client/NetDaemon.HassClient.Tests/NetDaemon.HassClient.Tests.csproj +++ b/src/Client/NetDaemon.HassClient.Tests/NetDaemon.HassClient.Tests.csproj @@ -1,17 +1,17 @@ - net6.0 + net7.0 enable enable false - - + + - + diff --git a/src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj b/src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj index 3f08be12a..96990385a 100644 --- a/src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj +++ b/src/Client/NetDaemon.HassClient/NetDaemon.Client.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable JoySoftware.NetDaemon.Client @@ -20,12 +20,12 @@ - - - - + + + + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Extensions/NetDaemon.Extensions.Logging/NetDaemon.Extensions.Logging.csproj b/src/Extensions/NetDaemon.Extensions.Logging/NetDaemon.Extensions.Logging.csproj index 848cfaddd..9ef4b8b62 100644 --- a/src/Extensions/NetDaemon.Extensions.Logging/NetDaemon.Extensions.Logging.csproj +++ b/src/Extensions/NetDaemon.Extensions.Logging/NetDaemon.Extensions.Logging.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 10.0 enable NetDaemon @@ -21,8 +21,8 @@ - - + + diff --git a/src/Extensions/NetDaemon.Extensions.MqttEntityManager/NetDaemon.Extensions.MqttEntityManager.csproj b/src/Extensions/NetDaemon.Extensions.MqttEntityManager/NetDaemon.Extensions.MqttEntityManager.csproj index 04e71d98c..59e7bb494 100644 --- a/src/Extensions/NetDaemon.Extensions.MqttEntityManager/NetDaemon.Extensions.MqttEntityManager.csproj +++ b/src/Extensions/NetDaemon.Extensions.MqttEntityManager/NetDaemon.Extensions.MqttEntityManager.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable 10.0 @@ -23,12 +23,12 @@ - - - - - - + + + + + + diff --git a/src/Extensions/NetDaemon.Extensions.Scheduling.Tests/NetDaemon.Extensions.Scheduling.Tests.csproj b/src/Extensions/NetDaemon.Extensions.Scheduling.Tests/NetDaemon.Extensions.Scheduling.Tests.csproj index 3105af5df..c3f0d4aa3 100644 --- a/src/Extensions/NetDaemon.Extensions.Scheduling.Tests/NetDaemon.Extensions.Scheduling.Tests.csproj +++ b/src/Extensions/NetDaemon.Extensions.Scheduling.Tests/NetDaemon.Extensions.Scheduling.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 false @@ -16,7 +16,7 @@ all - + diff --git a/src/Extensions/NetDaemon.Extensions.Scheduling/NetDaemon.Extensions.Scheduling.csproj b/src/Extensions/NetDaemon.Extensions.Scheduling/NetDaemon.Extensions.Scheduling.csproj index fe10dea8a..81523b170 100644 --- a/src/Extensions/NetDaemon.Extensions.Scheduling/NetDaemon.Extensions.Scheduling.csproj +++ b/src/Extensions/NetDaemon.Extensions.Scheduling/NetDaemon.Extensions.Scheduling.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 10.0 enable NetDaemon.Extensions.Scheduler @@ -22,8 +22,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Extensions/NetDaemon.Extensions.Tts/NetDaemon.Extensions.Tts.csproj b/src/Extensions/NetDaemon.Extensions.Tts/NetDaemon.Extensions.Tts.csproj index d91219ec1..d97992dd4 100644 --- a/src/Extensions/NetDaemon.Extensions.Tts/NetDaemon.Extensions.Tts.csproj +++ b/src/Extensions/NetDaemon.Extensions.Tts/NetDaemon.Extensions.Tts.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 10.0 enable JoySoftware.NetDaemon.Extensions.Tts @@ -20,8 +20,8 @@ - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/HassModel/NetDaemon.HassModel.CodeGenerator/EntitiesGenerator.cs b/src/HassModel/NetDaemon.HassModel.CodeGenerator/EntitiesGenerator.cs index 260045b4e..f1512fb5c 100644 --- a/src/HassModel/NetDaemon.HassModel.CodeGenerator/EntitiesGenerator.cs +++ b/src/HassModel/NetDaemon.HassModel.CodeGenerator/EntitiesGenerator.cs @@ -1,9 +1,11 @@ -ο»Ώusing static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; +ο»Ώusing System.Diagnostics.CodeAnalysis; +using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; using Microsoft.CodeAnalysis.CSharp; using NetDaemon.Client.HomeAssistant.Model; namespace NetDaemon.HassModel.CodeGenerator; + internal static class EntitiesGenerator { public static IEnumerable Generate(CodeGenerationSettings codeGenerationSettings, IReadOnlyList entities) @@ -88,11 +90,11 @@ private static MemberDeclarationSyntax GenerateEntityProperty(HassState entity, var propertyCode = $@"{className} {entityName.ToNormalizedPascalCase((string)"E_")} => new(_{GetNames().VariableName}, ""{entity.EntityId}"");"; - var name = entity.AttributesAs()?.friendly_name; + var name = entity.AttributesAs()?.friendly_name; return ParseProperty(propertyCode).ToPublic().WithSummaryComment(name); } - record attributes(string friendly_name); + record Attributes(string friendly_name); private static bool IsNumeric(HassState entity) { @@ -135,4 +137,4 @@ private static TypeDeclarationSyntax GenerateEntityType(EntitySet entitySet) /// /// A list of entities private static IEnumerable GetDomainsFromEntities(IEnumerable entities) => entities.Select(EntityIdHelper.GetDomain).Distinct(); -} \ No newline at end of file +} diff --git a/src/HassModel/NetDaemon.HassModel.CodeGenerator/NetDaemon.HassModel.CodeGenerator.csproj b/src/HassModel/NetDaemon.HassModel.CodeGenerator/NetDaemon.HassModel.CodeGenerator.csproj index 285b67c92..4c832d5ec 100644 --- a/src/HassModel/NetDaemon.HassModel.CodeGenerator/NetDaemon.HassModel.CodeGenerator.csproj +++ b/src/HassModel/NetDaemon.HassModel.CodeGenerator/NetDaemon.HassModel.CodeGenerator.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable 10.0 Exe @@ -22,9 +22,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/HassModel/NetDaemon.HassModel.Integration/NetDaemon.HassModel.Integration.csproj b/src/HassModel/NetDaemon.HassModel.Integration/NetDaemon.HassModel.Integration.csproj index 52fe07235..e0971ddad 100644 --- a/src/HassModel/NetDaemon.HassModel.Integration/NetDaemon.HassModel.Integration.csproj +++ b/src/HassModel/NetDaemon.HassModel.Integration/NetDaemon.HassModel.Integration.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable NetDaemon.HassModel.Integration diff --git a/src/HassModel/NetDaemon.HassModel.Tests/NetDaemon.HassModel.Tests.csproj b/src/HassModel/NetDaemon.HassModel.Tests/NetDaemon.HassModel.Tests.csproj index c504c5de4..2d6436266 100644 --- a/src/HassModel/NetDaemon.HassModel.Tests/NetDaemon.HassModel.Tests.csproj +++ b/src/HassModel/NetDaemon.HassModel.Tests/NetDaemon.HassModel.Tests.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 false @@ -10,8 +10,8 @@ - - + + diff --git a/src/HassModel/NetDeamon.HassModel/NetDaemon.HassModel.csproj b/src/HassModel/NetDeamon.HassModel/NetDaemon.HassModel.csproj index 147b4b4e8..5c1ebdab4 100644 --- a/src/HassModel/NetDeamon.HassModel/NetDaemon.HassModel.csproj +++ b/src/HassModel/NetDeamon.HassModel/NetDaemon.HassModel.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable 10.0 NetDaemon.HassModel @@ -20,7 +20,7 @@ - + diff --git a/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj b/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj index b68d1b2f8..040240dfc 100644 --- a/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj +++ b/src/Host/NetDaemon.Host.Default/NetDaemon.Host.Default.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net7.0 10.0 enable false - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/Runtime/NetDaemon.Runtime.Tests/Integration/TestRuntime.cs b/src/Runtime/NetDaemon.Runtime.Tests/Integration/TestRuntime.cs index c68c10ebb..10d315d45 100644 --- a/src/Runtime/NetDaemon.Runtime.Tests/Integration/TestRuntime.cs +++ b/src/Runtime/NetDaemon.Runtime.Tests/Integration/TestRuntime.cs @@ -64,9 +64,11 @@ public async Task TestApplicationReactToNewEvents() EntityId = "binary_sensor.mypir", State = "on" }); + + await Task.Delay(100).ConfigureAwait(false); // stopping the host will also flush any event queues await host.StopAsync(timedCancellationSource.Token).ConfigureAwait(false); - + haRunner.ClientMock.ConnectionMock.Verify( n => n.SendCommandAsync(It.IsAny(), It.IsAny()), Times.Once); diff --git a/src/Runtime/NetDaemon.Runtime.Tests/NetDaemon.Runtime.Tests.csproj b/src/Runtime/NetDaemon.Runtime.Tests/NetDaemon.Runtime.Tests.csproj index 5369a5d1e..13a57f6a3 100644 --- a/src/Runtime/NetDaemon.Runtime.Tests/NetDaemon.Runtime.Tests.csproj +++ b/src/Runtime/NetDaemon.Runtime.Tests/NetDaemon.Runtime.Tests.csproj @@ -1,18 +1,18 @@ - net6.0 + net7.0 enable enable false - - + + - - + + diff --git a/src/Runtime/NetDaemon.Runtime/NetDaemon.Runtime.csproj b/src/Runtime/NetDaemon.Runtime/NetDaemon.Runtime.csproj index 78bf97f5b..3d9aa3c46 100644 --- a/src/Runtime/NetDaemon.Runtime/NetDaemon.Runtime.csproj +++ b/src/Runtime/NetDaemon.Runtime/NetDaemon.Runtime.csproj @@ -1,6 +1,6 @@ - net6.0 + net7.0 enable enable JoySoftware.NetDaemon.Runtime @@ -20,13 +20,13 @@ - - - - - - - + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/debug/DebugHost/DebugHost.csproj b/src/debug/DebugHost/DebugHost.csproj index 441e3ea00..8f4daa492 100644 --- a/src/debug/DebugHost/DebugHost.csproj +++ b/src/debug/DebugHost/DebugHost.csproj @@ -2,14 +2,14 @@ Exe - net6.0 + net7.0 10.0 enable false - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/src/debug/DebugWebHost/DebugWebHost.csproj b/src/debug/DebugWebHost/DebugWebHost.csproj index 3fef87e76..371f58aa2 100644 --- a/src/debug/DebugWebHost/DebugWebHost.csproj +++ b/src/debug/DebugWebHost/DebugWebHost.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable diff --git a/tests/Integration/NetDaemon.Tests.Integration/NetDaemon.Tests.Integration.csproj b/tests/Integration/NetDaemon.Tests.Integration/NetDaemon.Tests.Integration.csproj index 7151c422a..27d5249a0 100644 --- a/tests/Integration/NetDaemon.Tests.Integration/NetDaemon.Tests.Integration.csproj +++ b/tests/Integration/NetDaemon.Tests.Integration/NetDaemon.Tests.Integration.csproj @@ -1,36 +1,31 @@ - net6.0 + net7.0 enable false - - - - - + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - ..\..\..\..\..\Program Files\dotnet\shared\Microsoft.AspNetCore.App\6.0.0\Microsoft.Extensions.Hosting.Abstractions.dll - - - - - - + +