|
|
@@ -40,7 +40,12 @@ def get_cached() -> tuple[dict | None, bool]:
|
|
|
|
|
|
async def caldav_checks(calendar_name: str = DEFAULT_CALENDAR_NAME) -> tuple[HealthResult, HealthResult]:
|
|
|
"""Open one CalDAV connection and run both the connection and calendar-exists checks."""
|
|
|
- cal = Calendar(calendar_name)
|
|
|
+ from room_cal._utils import get_config
|
|
|
+ cfg = get_config()
|
|
|
+ if cfg.store.active != 'caldav':
|
|
|
+ return HealthResult(ok=True), HealthResult(ok=True)
|
|
|
+ cal_cfg = cfg.store.caldav
|
|
|
+ cal = Calendar(calendar_name, url=cal_cfg.url, username=cal_cfg.username, password=cal_cfg.password)
|
|
|
try:
|
|
|
async with await cal._client() as client:
|
|
|
conn = HealthResult(ok=True)
|