-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[telegram] Telegram Binding initial contribution #5677
Conversation
This pull request has been mentioned on openHAB Community. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with the bnd resolver may be that the libraries are not OSGi-libraries and require wrapping. I think that BND cannot do that on the fly. #5503 will help with this. This will work in KARAF because wrapping (as requested on the feature.xml) is available.
Adding optional
to bnd.importpackage
is wrong. You need these classes, they are not optional
but required. As a workaround you can add the libraries to the /lib
directory. But please do not commit these files.
The library is MIT licensed, I do not see any problem in using it. I didn't check why you use apache http client, can you add a note to this PR? It's easier to find in case someone wants to look it up.
I'm not using the apache http client, but the Telegram library does. I tried to rewrite it, but there were a lot of changes necessary and it would be a big effort to keep it up to date with the original library. |
Ok with me as well. Don‘t rewrite external libs. |
But then do I need this bnd importpackage at all? I found only very few bindings that have this. And some others also use an external library but don't have this bnd statement. Sorry, I accidentally removed it now. Shall I just remove the optional attribute? |
This is only for very special cases with embedded libraries. You don‘t need it. |
Is there anything missing from me here? |
bundles/org.openhab.extensionservice.marketplace.automation/pom.xml
Outdated
Show resolved
Hide resolved
@J-N-K There is still a "changes requested" review from you here - so yes, if you are satisfied, you should change it to an approval. |
Mhm. Is there any better way to remove "requests changes"? I only looked at the infrastructure part, not at the code. |
There is usually also a "dismiss review" button as an option. |
Travis tests were successfulHey @ZzetT, |
Why is lastMessageDate a String channel ? |
- converted lastMessageDate channel type from String to DateItem - exceptions are now reported to the logger as a warning - in case of a 401 error during getUpdates the thing will go offline because it usually means that the thing configuration (botToken) is wrong - fixed mixed tabs and spaces Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Travis tests were successfulHey @ZzetT, |
Thanks for the hint, I changed that now. From my side I would be ready to merge it to the master unless you guys want to have another look. Since the last review a few things have changed (library replacement). |
bundles/org.openhab.binding.telegram/src/main/feature/feature.xml
Outdated
Show resolved
Hide resolved
...openhab.binding.telegram/src/main/java/org/openhab/binding/telegram/bot/TelegramActions.java
Outdated
Show resolved
Hide resolved
...ab.binding.telegram/src/main/java/org/openhab/binding/telegram/internal/TelegramHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.telegram/src/main/resources/ESH-INF/thing/thing-types.xml
Show resolved
Hide resolved
- removed gson as a dependency/feature.xml - removed dead code comment - fixed thing labels - code style Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Travis tests were successfulHey @ZzetT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; @J-N-K You approved some time ago. If you're ok we can merge this binding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have 3 approvals and there was still a pending one from me - so let's get it merged! Thanks to everyone involved!!!
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com> Signed-off-by: Tim Roberts <timmarkroberts@gmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com>
Signed-off-by: Alexander Krasnogolowy <alexkrasno@hotmail.com> Signed-off-by: Hans-Reiner Hoffmann <hans-reiner.hoffmann@gmx.de>
This binding shall work as a replacement for the old OH1 Telegram Actions.
It supports not only sending messages, but also receiving them. The base for the implementation is the TelegramBot library.
User Belgadon (Jens) initially started the work on that binding which still used the old OH1 telegram actions for sending messages. I removed this dependency by using the new OH2 actions and "tried" to migrate it to the new build environement.
The development of that binding was discussed in that thread.
Although I still didn't completly manage to get it running with the latest build environemnt, I was told in the forum to create a PR anyway.
The problems that I still have are either OSGI errors when I click "Resolve" in the bnd demo app or
when I add:
then I get ClassNotFoundExceptions at runtime after adding a new Telegram thing.
One more thing to note here, IMHO it should not be necessary to also add a dependency to "telegrambots-meta" in the pom.xml (only telegrambots should be required), but if I remove that I get an error that this is missing.
Please note that the binding is using an apache client instead of a jetty client, but this issue was discussed already and agreed by @davidgraeff .
So, before continuing the work on more features, we need the approval that the library can be integrated into the OH2 environment and what needs to be configured to get it running again. Then, I hope that we can add a few more features in separate PRs for this binding.
Especially two things are currently missing compared to the old Telegram actions:
Currently, a beta version of that binding was released to several testers in the forum which however was only based on the old build environement.
Signed-off-by: Alexander Krasnogolowy alexkrasno@hotmail.com