Conversation
@teichsta , could you please assign this to me for review? |
} else if (type == CalDavType.DISABLE) { | ||
// ok | ||
} else { | ||
logger.warn("unhandled type: " + type); |
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.
logging: Please use slf4j parametrization instead of string concatenation
i've invited you to the openHAB organisation which is the prerequisite … |
Thank you, invitation accepted. |
Thanks for review. Sorry for simple mistakes (Eclipse is not my default IDE) |
You're welcome. Honestly, I had to re-train myself too as I am a IntelliJ user in my day job :) |
Could you add a README.md with a one-line reason why you have to use specific library versions? I am sure this will be an unexpected thing for others too. Maybe you could even use the README templates as they are used in OH2, then you would already be well prepared for migration :) |
I am IntelliJ user as well. |
No, you don't have to. OH1 bindings will work just fine with OH2 as well. Only if you want to use features of the new APIs such as discovery, you might want to think about a migration. Otherwise, just maintain the OH1 binding and all is fine :-) |
Yes i know that they are working. But OH2 Bindings have another namespace and the README template contains Things, Discovery etc., therefore i didn't used the OH2 template. |
Right, so for OH1 bindings there is no need (yet) to add a README.md - the documentation is expected on the wiki (which we might move to a README.md in the future, but that will then be done for all at once). |
@querdenker2k : I am not so sure about the binding name for "caldavPersonal". You mention that is is meant to simulate presence detection. Do you think it would be possible to split this PR into two parts, one with the io and command part, and another with the "personal" part? The first part looks good to me (still need to compile and run a few tests on my OH2 instance) but I'm not really comfortable with the other part. On the other hand, I am well aware that finding good names is one of the hardest problems in computing 😄 |
No you can use caldavCommand for presence simulation. I currently use it to regulate my heaters. This binding is just interested in the event description. |
continue; | ||
} | ||
|
||
final List<EventUtils.EventContent> parseContent = EventUtils.parseContent(calDavEvent, item); |
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.
Could you please put this for loop immediately after the "try"? To avoid using "continue" in loops?
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.
I change it, but my intention to do it this is way is: I would like to see that the item could not be found in the registry and because of this it has to be skipped. If the try-catch is around of a big block it is not directly visible. But nevertheless i change it.
|
||
public CalDavConfig(List<String> calendar, Type type, int eventNr, | ||
Value value) { | ||
super(); |
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.
CalDavConfig just "implements" BindingConfig. Do we need a super() here?
Actually ok then, leave the readme.txt files in the source. If @kai thinks it necessary to remove them this can be done in a big commit over all addons at once. |
Maybe you can help me. I have just problems with eclipse and osgi. Every time i have to reload the osgi runtime (in preferences). But now with the current trunk i got this exception for every bundle. What is going wrong? osgi> osgi> !SESSION 2015-11-19 18:39:22.612 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.8.0_66
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=de_DE
Framework arguments: -application
Command-line arguments: -application -data C:\Users\Robert\Java-Workspace\openhab\openhab-querdenker2k/../runtime-org.openhab.runtime.product.product -dev file:C:/Users/Robert/Java-Workspace/openhab/openhab-querdenker2k/.metadata/.plugins/org.eclipse.pde.core/openHAB Runtime/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog -console
!ENTRY org.openhab.binding.caldav-command 4 0 2015-11-19 18:39:25.961
!MESSAGE FrameworkEvent ERROR
!STACK 0
org.osgi.framework.BundleException: The activator org.openhab.binding.caldav_command.internal.CalDavActivator for bundle org.openhab.binding.caldav-command is invalid
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:172)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: java.lang.ClassNotFoundException: org.openhab.binding.caldav_command.internal.CalDavActivator
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:165)
... 12 more
Root exception:
java.lang.ClassNotFoundException: org.openhab.binding.caldav_command.internal.CalDavActivator
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:165)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
18:39:25.965 [DEBUG] [.b.http.internal.HttpActivator:34 ] - HTTP binding has been started. |
sorry, maybe @kaikreuzer can help with the OSGI stuff, I am only a stupid Java hacker 😄 |
No idea, looks as if the class file cannot be found. Did you already try a "clean project" to make it recompile? |
Ok, all changes are done. I will test it for a few days and the commit it. |
@querdenker2k , this branch is showing conflicts again, very possibly because of commits to bundles/binding/pom.xml that got merged in the meantime. Could you please update the PR? Just fixing the conflict and pushing to this branch should be enough. |
I have pulled and merged, but git wants to add all changes from the remote head as well? Is this fine? |
You should have run "git rebase" instead of "pull" and "merge". If this turns out to be too much work, you can just run:
The pull request should be automatically updated. |
but with this commands its not getting the changes from the remote head |
o.k., maybe a
Honestly, I don't have a good idea, so if you don't have pushed anything from your merge yet, maybe just throw the clone away, get a fresh copy from github, and try again to rebase? |
Another minor nitpick: Would you mind to call all your logger objects
Especially your internal classes have a few logger objects which are called LOG (which is not really correct from a Java style point of view). |
All the time in every project i wrote LOG like this, but you're right, the coding style says log. thx. All changes are done actually. |
@querdenker2k , your branch is by now totally confused because git is sometimes evil 😈 The source of your own files look o.k. to me. Would you mind to create a fresh branch + PR and add only your own files to it? And close this PR? After that, I would be happy to merge your branch so we have caldav support in 1.8.0 after all your good work 😄 |
ok, this is the new pr, i hope that fits. |
PR for caldav-binding in one commit