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

[enigma2] Initial Contribution #7514

Merged
merged 2 commits into from
May 25, 2020
Merged

[enigma2] Initial Contribution #7514

merged 2 commits into from
May 25, 2020

Conversation

gdolfen
Copy link

@gdolfen gdolfen commented May 1, 2020

This is a PR for adding support of enigma2 set top boxes like a dreambox or a vu+.
It is tested on a vu+ solo2 device. For more details see the readme: https://github.com/gdolfen/openhab-addons/blob/enigma2/bundles/org.openhab.binding.enigma2/README.md

There ist a snapshot build available here for testing: https://openhab.jfrog.io/openhab/libs-pullrequest-local/org/openhab/addons/bundles/org.openhab.binding.enigma2/2.5.5-SNAPSHOT/

Because this ist my first PR to openhab please be so kind and let me know if there is something missing.

I opened a discussion here: https://community.openhab.org/t/new-enigma2-binding/97887

@gdolfen gdolfen requested a review from a team as a code owner May 1, 2020 17:55
@TravisBuddy
Copy link

Travis tests have failed

Hey @gdolfen,
please read the following log in order to understand the failure reason. There might also be some helpful tips along the way.
It will be awesome if you fix what is wrong and commit the changes.

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@gdolfen gdolfen changed the title Added Enigma2 [enigma2] Initial Contribution May 1, 2020
@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister cpmeister added new binding If someone has started to work on a binding. For a new binding PR. oh1 migration Relates to migrating an openHAB 1 addon to openHAB 2 labels May 1, 2020
@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

5 similar comments
@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Copy link
Contributor

@t2000 t2000 left a comment

Choose a reason for hiding this comment

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

Hello Guido,

thank you VERY much for porting the enigma2 binding to openHAB 2!

First of all, thank you for writing test cases! This is always handy if others start to edit your code later on so they notice when stuff breaks. :)

I left some minor comments in the code, but in general the quality of the binding looks pretty well already!

I do have a VUplus Uno4k and can do some tests with it if you like, after you have included my small comments from above.

Regards,

Stefan

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@gdolfen
Copy link
Author

gdolfen commented May 5, 2020

Hello Stefan,

thank you for your feedback. I tried to fix all of your findings, but two of them I don't understand (see conversion below). Can you please give me some more hints?

It would be nice of you, if you can make some tests with your VUplus Uno4k.
I hope this binding will also fit to your belongings.

I'm just developing an enhancement for supporting sending questions and resolving answers. Should I commit this into this PR, or in a second one, if it is ready?

Best regards,
Guido

Copy link
Contributor

@t2000 t2000 left a comment

Choose a reason for hiding this comment

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

Thanks, looks much better already.

I edited my 2 comments from yesterday that were messed up by github because I forgot to add the code ticks.

And I added 3 more comments. Please have a look.

I will give the binding a try later today probably.

Regarding your question:

I'm just developing an enhancement for supporting sending questions and resolving answers. Should I commit this into this PR, or in a second one, if it is ready?

I am not sure what you mean by questions and resolving answers? Is that a feature of the receiver? What does it do?

If you have the code ready for review, feel free to put it in now. if it takes time to develop and debug I would suggest to leave it out and get this PR in a shape so it can be merged.

Copy link
Contributor

@t2000 t2000 left a comment

Choose a reason for hiding this comment

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

I just tested it with my VUuno4k receiver and its basically working.

As I had the binding running in my IDE i guess i was missing the mdsn bundles so auto discovery didn't work for me. However, this pointed me to the missing defaults in the configuration of the thing that I have just commented.

I only tested the controls via PaperUI though. But I think if they are working, the thingactions should also work if they work with your receiver.

One thing that would be nice for a version 2: Some kind of subscription mechanism to the receiver so we do not have to poll and get the information delayed, I don't know if this is possible though.

@t2000
Copy link
Contributor

t2000 commented May 6, 2020

Spoken too early... I though you had the "strange characters filtered out already, but I get:

Caused by: java.net.URISyntaxException: Illegal character in query at index 231: http://vuuno4k/web/epgservice?sRef=4097:0:19:2873:425:1:C00000:0:0:0:rtsp%3a//192.168.178.254%3a554/?freq=242&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,261,553,554,555,556,558,1641,1651,1652,1653:hr-fernsehen HD
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3111)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at java.net.URI.create(URI.java:850)
	... 20 common frames omitted
21:12:07.028 [thingHandler-18] WARN  o.o.b.enigma2.handler.Enigma2Handler:96 - Error on refreshing enigma2:device:663aba0e
java.lang.IllegalArgumentException: Illegal character in query at index 231: http://vuuno4k/web/epgservice?sRef=4097:0:19:2873:425:1:C00000:0:0:0:rtsp%3a//192.168.178.254%3a554/?freq=242&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,261,553,554,555,556,558,1641,1651,1652,1653:hr-fernsehen HD
	at java.net.URI.create(URI.java:852)
	at org.eclipse.jetty.client.HttpClient.newRequest(HttpClient.java:442)
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrlAndGetReponse(HttpUtil.java:212)
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:156)
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:131)
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:109)
	at org.eclipse.smarthome.io.net.http.HttpUtil.executeUrl(HttpUtil.java:90)
	at org.openhab.binding.enigma2.internal.Enigma2HttpClient.get(Enigma2HttpClient.java:36)
	at org.openhab.binding.enigma2.internal.Enigma2Client.transmit(Enigma2Client.java:134)
	at org.openhab.binding.enigma2.internal.Enigma2Client.lambda$3(Enigma2Client.java:124)
	at java.util.Optional.ifPresent(Optional.java:159)
	at org.openhab.binding.enigma2.internal.Enigma2Client.refreshEpg(Enigma2Client.java:123)
	at org.openhab.binding.enigma2.internal.Enigma2Client.refresh(Enigma2Client.java:86)
	at org.openhab.binding.enigma2.handler.Enigma2Handler.refresh(Enigma2Handler.java:82)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.URISyntaxException: Illegal character in query at index 231: http://vuuno4k/web/epgservice?sRef=4097:0:19:2873:425:1:C00000:0:0:0:rtsp%3a//192.168.178.254%3a554/?freq=242&bw=8&msys=dvbc&mtype=256qam&sr=6900&specinv=0&pids=0,16,17,18,20,261,553,554,555,556,558,1641,1651,1652,1653:hr-fernsehen HD
	at java.net.URI$Parser.fail(URI.java:2848)
	at java.net.URI$Parser.checkChars(URI.java:3021)
	at java.net.URI$Parser.parseHierarchical(URI.java:3111)
	at java.net.URI$Parser.parse(URI.java:3053)
	at java.net.URI.<init>(URI.java:588)
	at java.net.URI.create(URI.java:850)
	... 20 common frames omitted

You should definitely catch these exceptions. For now it looks to me as if the Thing is going into "OFFLINE with configuration error".

And if the Thing goes OFFLINE with configuration error, we should ALWAYS provide a message to the user so he knows how to fix it without digging into debug logs (in my case i dont see a message so a user would not know what to do).

@gdolfen
Copy link
Author

gdolfen commented May 7, 2020

I now catch the IllegalArgumentException in the trasmit-Method. And I think the reason of this exception is because I dindn't URL-encode the id of the current channel.
Please try again when the build is done. But there might be another problem. Your channel id looks very strange: the url should only look like this: http://vuuno4k/web/epgservice?sRef=4097:0:19:2873:425:1:C00000:0:0:0:. But there is much more behind it. So if it doesn't work please send me the result of "http://vuuno4k/web/getallservices"

Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

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

These should be the final changes

@gdolfen
Copy link
Author

gdolfen commented May 13, 2020

@cpmeister:
I fixed the last two findings

Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

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

I just noticed that you didn't include an update to the CODEOWNERS file in the PR. Please add yourself to it.
Also you need to update the bom/openhab-addons/pom.xml

@gdolfen
Copy link
Author

gdolfen commented May 13, 2020

@cpmeister:
I updated CODEOWNERS and bom/openhab-addons/pom.xml

Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

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

Everything looks good now, thanks for all of your work! But before this can be merged, another addons maintainer needs to take a look at it so please sit tight until they come around.

@gdolfen
Copy link
Author

gdolfen commented May 13, 2020

@cpmeister: Thank you for your approval.

@cpmeister cpmeister added the cre Coordinated Review Effort label May 13, 2020
Copy link
Member

@martinvw martinvw left a comment

Choose a reason for hiding this comment

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

@gdolfen,

Thanks again for your contribution and your patience I added some remarks, let me know when you have any questions.

Martin

@martinvw martinvw self-assigned this May 22, 2020
@gdolfen
Copy link
Author

gdolfen commented May 22, 2020

@martinvw
Thank you for your remaks. I have noticed that the version changed from 2.5.5-SNAPSHOT to 2.5.6-SNAPSHOT. Do I have to do a rebase?

Signed-off-by: gdolfen <gdolfen@web.de>
- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
@martinvw
Copy link
Member

@martinvw
Thank you for your remaks. I have noticed that the version changed from 2.5.5-SNAPSHOT to 2.5.6-SNAPSHOT. Do I have to do a rebase?

You should at least change the version in your pom.xml, but rebasing would be the best

Copy link
Member

@martinvw martinvw left a comment

Choose a reason for hiding this comment

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

Thanks for you rapid feedback!

If you can rebase and update the version number and the build is done we should be ready for a merge, thanks for your hard work!

@gdolfen
Copy link
Author

gdolfen commented May 22, 2020

@martinvw
Thank you for your approval. The rebase is done.

There are many pending builds because of an error receiving files from the apache repository:
Failed to transfer file http://repository.apache.org/snapshots/org/eclipse/platform/org.eclipse.core.runtime/maven-metadata.xml with status code 503
It seems to be down

@TravisBuddy
Copy link

Travis tests were successful

Hey @gdolfen,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister cpmeister merged commit f485114 into openhab:2.5.x May 25, 2020
@cpmeister cpmeister removed the cre Coordinated Review Effort label May 25, 2020
@cpmeister cpmeister added this to the 2.5.6 milestone May 25, 2020
@gdolfen gdolfen deleted the enigma2 branch May 25, 2020 15:12
bodiroga pushed a commit to bodiroga/openhab-addons that referenced this pull request May 26, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this pull request Jun 8, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this pull request Jul 14, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
Signed-off-by: CSchlipp <christian@schlipp.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
* [enigma2] Initial contribution openhab#7514

- Fixed review finding

Signed-off-by: gdolfen <gdolfen@web.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR. oh1 migration Relates to migrating an openHAB 1 addon to openHAB 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants