openhab / openhab-core

Core framework of openHAB
https://www.openhab.org/
Eclipse Public License 2.0
923 stars 424 forks source link

Considering CardDAV module #1189

Open clinique opened 4 years ago

clinique commented 4 years ago

Hello team, I'm considering to develop a CardDAV module. Based on a given directory (that can be static or dynamic through a WebDAV mount), one would be able to browse all cards. Expected functionalities :

I started designing it as a binding, but I've got strong feeling it's not a binding. When thinking of it, it's more close to the still v1 CALDAV service, or a module like Ephemeris.

I faced a terrible time trying to integrate Sardine (webdav client) to it. So for the moment, I let this apart, but I also saw that CALDAV was making use of Sardine. Shouldn't webdav be handled at core level ?

Your thoughts ?

kaikreuzer commented 4 years ago

Hi @clinique, Interesting topic and a good question on how it best fits in... I agree that it sounds very similar to Ephemeris. In that case we decided to include it in the core, while already feeling slightly bad about it as it comes with an external library and all that became a mandatory part of the core runtime. I somehow think we should not do the same for Cards and Cals, but I don't immediately have a good suggestion.

Maybe let us define the use cases, where we would see that functionality to blend in. You mention rules, yes. If this is the only place, we could think about doing a bundle that adds an additional scope in the new rule engine (assuming that this will soon be the default rule engine). For the CalDAV stuff, we would probably also add trigger modules for the rule engine - or maybe directly feed complete rules from the calender. Again, both could be done as optional bundles for the rule engine.

Wrt Sardine, yeah, that's probably not much fun. I am not in the details, though: Are CardDAV and CalDAV using WebDAV underneath? I so far thought that those are independent protocols.

clinique commented 4 years ago

@kaikreuzer : yes, CardDAV and CalDAV are both laying on WebDAV, witch is a layer over http(s). Currently, I browse a folder of vcf files (mounted as a webdav folder) than enables sync with mobile phones...(centralized in Nextcloud on my side).

My understanding is that maybe we should defined a webdav transport layer (using sardine lib), that could be used by CalDAV, and optionally by a vCard io module.

kaikreuzer commented 4 years ago

Good to know, thanks. Yes, we could definitely create a io.transport.webdav bundle, which could then be a shared dependency for the CalDAV and CardDAV features.