-
-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HADotNet stopped working after 0.118 update #13
Comments
Found this in the dev blog: api changes |
Actually I don't think the api changes are relevant. When I use curl to fetch the json, using the same uri and bearer, it works and I get a json string. When I deserialize that, using the classes in your project, it works. When I extend your library to include the restsharp error message, it gives this:
At a loss why it's saying that though. Any idea? |
Ended up extending your library to use a curl fallback in case restsharp fails, which works fine for now. |
I'm experiencing the same problem. |
I'm experiencing this as described above. @SamKr can you share your fork that works? |
Sure @PockyBum522, will do tomorrow. |
Here you go @PockyBum522 : HADotNet fork. Please read the readme for instructions. Let me know if it doesn't work for you. |
Thank you very much! I'll have a chance to test today. |
@SamKr What platform/OS are you running on? RestSharp may have issues on other platforms and that could be the cause. I can try bumping up RestSharp's dependency version to see if that resolves it. |
I'm using Windows, curl is available for windows: https://curl.se/windows/ |
Well sure, but not out of the box and not (easily?) as a NuGet dependency... so In any case, this looks like a bug with 0.118.x, I'll take a look and see if I can find out what changed. Worst case, I can enhance that error message - response codes of 0 indicate a network issue of some kind, for which there's an error message that should be printed out in those cases. |
Curl is a stand alone exe, so as long as I provide it along with the project's executable it's fine. And it's a backup method which is working fine for now. I tried bumping restsharp and looking what's happening, but didn't get much result. Hopefully you'll do better :) |
Why use Curl when you can use HttpClient? I don't understand. The REST API still works without any issues with HttpClient. Ahh, nvm, probably because there is an issue in RestSharp.. Which is able to use a fallback. |
The Curl solution doesn't work when performing Posts, any updates on a RestSharp solution? |
Can confirm a basic HttpClient is working just fine: var client = new HttpClient { BaseAddress = new Uri(""), Timeout = new TimeSpan(0, 0, 0, 0, -1) }; var request = new HttpRequestMessage(HttpMethod.Post, "/api/services/media_player/volume_up"); await client.SendAsync(request).ContinueWith(r => { |
Version 1.4.0 has just been pushed out to NuGet that addresses this. Closing this issue. |
I'm using the latest HDDotNet.Core (1.3.2) to connect to my HomeAssistant server, which I updated today to 0.118.
However, suddenly my code stopped at this point:
It's giving me this exception:
Visual Studio is on the latest version (16.8.1), and the project uses .NET Framework 4.8.
Any idea what's happening?
The text was updated successfully, but these errors were encountered: