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

[rest] Added new Audio API #1020

Merged
merged 3 commits into from Sep 15, 2019
Merged

[rest] Added new Audio API #1020

merged 3 commits into from Sep 15, 2019

Conversation

lolodomo
Copy link
Contributor

@lolodomo lolodomo commented Sep 1, 2019

Signed-off-by: Laurent Garnier lg.hc@free.fr

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much. The code looks pretty good. Two minor comments.

Should we add a feature for it too? Like we did for the voice REST API?

<feature name="openhab-core-io-rest-voice" version="${project.version}">
<feature>openhab-core-base</feature>
<bundle>mvn:org.openhab.core.bundles/org.openhab.core.io.rest.voice/${project.version}</bundle>
</feature>

if (source != null) {
return Response.ok(AudioMapper.map(source, locale)).build();
} else {
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "source not found");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "source not found");
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "Source not found");

if (sink != null) {
return Response.ok(AudioMapper.map(sink, locale)).build();
} else {
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "sink not found");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "sink not found");
return JSONResponse.createErrorResponse(Status.NOT_FOUND, "Sink not found");

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Laurent Garnier <lg.hc@free.fr>
@lolodomo
Copy link
Contributor Author

I added the feature stuff.

Copy link
Contributor

@cweitkamp cweitkamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

A small unit test would be very nice 😉.

@cweitkamp cweitkamp added rebuild Triggers the Jenkins PR build enhancement An enhancement or new feature of the Core and removed rebuild Triggers the Jenkins PR build labels Sep 14, 2019
@cweitkamp cweitkamp merged commit cf4b752 into openhab:master Sep 15, 2019
@cweitkamp cweitkamp added this to the 2.5 milestone Sep 15, 2019
@lolodomo lolodomo deleted the rest_audio branch September 15, 2019 07:21
@cweitkamp cweitkamp changed the title New Audio REST API [rest] Added new Audio API Dec 3, 2019
Rosi2143 pushed a commit to Rosi2143/openhab-core that referenced this pull request Dec 26, 2020
* Update eclipse.md

Fix a few typos and improve readability.
Signed-off-by: Matthew Skinner (Skinah) <matt@pcmus.com>

* Added newline

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
* New Audio REST API

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
GitOrigin-RevId: cf4b752
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core REST/SSE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants