-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Odd behavior when using EventStream #321
Comments
I've seen this behavior before when the EventStream API was just introduced. There was an error after each event. I had some code in the project to catch any exception and reconnect. But with a firmware upgrade this went away. |
I have checked on my Philips app and all bridges are up to date (1.67.1967054020). On that note, in case that is a problem, I have two bridges that I connect to at the same time. |
Can you run the console sample? It only shows the eventstream changes. It's a basic scenario that should be able to show multiple updates. |
Ah, I left out a detail in my original Ticket, sorry. The EventStream works for receiving every time, for as many messages as the bridge happens to send up until I use the attached Update once, after which it stops being able to receive |
Ok, I'll make a test scenario later this week to check it out. |
I've updated the HueApi.ConsoleSample, please check it out. |
I have finally gotten around to test your adaptions to the sample and it works as intended on my side. I'll revise my code and check for any differences in how the bridge is interacted with. |
Just to quickly give my solution in case any other developer runs into this: if (data.ExtensionData.TryGetValue("color", out var colorJson)
&& dimmingJson.Deserialize<Color>() is Color color) I am TryGetting colorJson. I am then deserializing dimmingJson. If your callback throws an uncaught exception it wil mess up the LocalHueClient. |
Hi,
first up thanks again for the quick response in yesterdays ticket ;)
Sadly I found another oddity today. I tried to rewrite my code away from polling light colors over to using the EventStream feature. While doing that I noticed some oddities. There are three scenarios:
System.ObjectDisposedException: Cannot access a disposed object. Object name: 'System.Net.Http.HttpClient'. at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request) at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken) at HueApi.BaseHueApi.HuePutRequestAsync[D](String url, D data)
Just in case I did something wrong here are my receiving and sending functions:
and for updating:
If you need any assistance please feel free to ask.
The text was updated successfully, but these errors were encountered: