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

masterVolume() returns OFF because events are not filtered by regex Condition #14

Open
tuxBurner opened this issue Feb 29, 2020 · 0 comments
Assignees

Comments

@tuxBurner
Copy link
Contributor

When i try to get masterVolume() from my denon i always get the value OFF.

The reason for this is that my denon returns for some reason:

Event{asciiValue='SVOFF'}
Event{asciiValue='SVOFF'}
Event{asciiValue='MV53'}

when requesting: MV

My suggestion is to filter the events before picking the first one in io.theves.denon4j.DenonReceiver#send(java.lang.String, java.lang.String)

return send(command, Condition.regex(regex)) .stream() .filter(event -> event.asciiValue().matches(regex)) .findFirst().orElseThrow(() -> new TimeoutException( format("No response received after %s milliseconds. Receiver may be too busy to respond.", RECV_TIMEOUT) ));

tuxBurner added a commit to tuxBurner/denon4j that referenced this issue Feb 29, 2020
@stheves stheves self-assigned this Feb 29, 2020
stheves added a commit that referenced this issue Feb 29, 2020
#14 filter events on the regex before returning
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