Skip to content
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

Retrieve state-, device- and zone status #5

Closed
MadMonkey87 opened this issue Jan 22, 2020 · 6 comments
Closed

Retrieve state-, device- and zone status #5

MadMonkey87 opened this issue Jan 22, 2020 · 6 comments

Comments

@MadMonkey87
Copy link

MadMonkey87 commented Jan 22, 2020

Hi,
I've seen that there are some private methods in the http client that allow to retrieve the mentioned values and it seems they work just fine. Is there any reason that they are not available as public methods?

@MadMonkey87 MadMonkey87 changed the title Retrieve state-, device and zone Retrieve state-, device- and zone status Jan 22, 2020
@i8beef
Copy link
Owner

i8beef commented Jan 22, 2020

It should publish updates for secondary zones as well, but only certain things like power, volume, mute, etc.

@MadMonkey87
Copy link
Author

Is there anything that speaks against to make the following methods public and therefore accessible:

  • I8Beef.Denon.HttpClient.GetDenonDeviceInfoAsync
  • I8Beef.Denon.HttpClient.GetDenonStatusAsync
  • I8Beef.Denon.HttpClient.GetDenonMainZoneStatusAsync
  • I8Beef.Denon.HttpClient.GetAllDenonSecondaryZonesStatusAsync
  • I8Beef.Denon.HttpClient.GetDenonSecondaryZonesStatusAsync

It would be really helpfull to be able to retrieve these details directly, or am I missing something?

@i8beef
Copy link
Owner

i8beef commented Jan 23, 2020

Yeah, that's not what this client is built for. It's built for real time eventing, not polling. The HttpClient is just exposed as an alternative to the TelnetClient as Denon receivers have a limitation on the number of telnet based clients that can be connected at once. Both are meant to expose the same functionality and interface. Using the HttpClient wouldn't even make sense for you as it stands if that's what you want here as the HttpClient inherently polls on an interval and emits events to be consumed.

I am NOT opposed to possibly splitting the current Client up to allow this though. Basically the existing Client would then USE a "stateless" http client in its implementation which you could use without the wrapper and such, which I COULD expose without changing the existing interfaces / expected usage of this library. The telnet client wouldn't have the same capability, and you could kind of "sneakily use" a type that SHOULD be "internal" if I exposed it as "public" instead... I can see how that could be useful to others that don't need the event based version.

@i8beef
Copy link
Owner

i8beef commented Jan 23, 2020

https://github.com/i8beef/Denon/tree/5-HttpClientAbstraction

That branch is sort of what I mean. There was some cleanup that I was holding back for another release anyway. You should be able to use the underlying DenonHttpClient in that branch instead and bypass any of the eventing the library normally assumes. Ill look at getting a release together for this soon.

@MadMonkey87
Copy link
Author

You're right not to mixing up real time events polling and stateless requests. The proposed client abstraction is exactly what I was taking about, thx!

@i8beef
Copy link
Owner

i8beef commented Jan 25, 2020

3.0.0.10 should be out momentarily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants