Skip to content

Commit

Permalink
Merge pull request #4 from svrooij/feature/async-suffix
Browse files Browse the repository at this point in the history
Async suffix was not used
  • Loading branch information
svrooij committed Dec 7, 2023
2 parents c990f25 + 7e9eef5 commit 75f9660
Show file tree
Hide file tree
Showing 49 changed files with 5,312 additions and 1,014 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ jobs:
- name: 👨‍🔧 Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
dotnet-version: |
6.x
8.x
- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"
Expand Down Expand Up @@ -75,7 +77,9 @@ jobs:
- name: 👨‍🔧 Setup .NET Core SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.x
dotnet-version: |
6.x
8.x
- name: 🔍 Enable problem matchers
run: echo "::add-matcher::.github/matchers/dotnet.json"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Always wanted to control sonos speakers right from your dotnet application? I've
Currently this library is not at version one, these are the planned features that need to be build before this can be called a version one.

- [X] All sonos services generated from service discovery
- [ ] Event subscriptions
- [ ] Dynamic metadata generation based on [these docs](https://svrooij.io/sonos-api-docs/metadata.html)
- [X] Event subscriptions
- [X] Dynamic metadata generation based on [these docs](https://svrooij.io/sonos-api-docs/metadata.html)
- [ ] SonosManager class that keeps track of speaker groups
- [ ] Device discovery, though it hardly works

Expand Down
14 changes: 4 additions & 10 deletions src/Sonos.Base.Events.Http/Sonos.Base.Events.Http.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
Expand Down Expand Up @@ -29,17 +29,11 @@
<ItemGroup>
<ProjectReference Include="..\Sonos.Base\Sonos.Base.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' ">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' ">
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0' ">
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
347 changes: 265 additions & 82 deletions src/Sonos.Base.Events.Http/packages.lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Sonos.Base/Internal/SonosWebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ internal SonosWebSocket(SonosServiceOptions serviceOptions)
{
this.webSocket = new ClientWebSocket();
this.options = serviceOptions;

webSocket.Options.AddSubProtocol(SubProtocol);
webSocket.Options.SetRequestHeader("X-Sonos-Api-Key", ApiKey);
#if NET6_0_OR_GREATER
webSocket.Options.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;
#else
throw new NotImplementedException("Sonos has a Self-Signed certificate for the websocket, and RemoteCertificateValidationCallback is unavailable on your platform");
#endif
webSocket.Options.AddSubProtocol(SubProtocol);
webSocket.Options.SetRequestHeader("X-Sonos-Api-Key", ApiKey);
}

internal Task ConnectAsync(CancellationToken cancellationToken)
Expand Down
Loading

0 comments on commit 75f9660

Please sign in to comment.