From 46df91ff4591c208bfe700de1730c016add5c4eb Mon Sep 17 00:00:00 2001 From: maxlaverse Date: Fri, 22 Dec 2017 14:08:34 +0100 Subject: [PATCH] Fix allday events in custom_calendars (#11272) --- homeassistant/components/calendar/caldav.py | 3 +-- tests/components/calendar/test_caldav.py | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/calendar/caldav.py b/homeassistant/components/calendar/caldav.py index f1cc0f12bd8..36894dcab61 100644 --- a/homeassistant/components/calendar/caldav.py +++ b/homeassistant/components/calendar/caldav.py @@ -25,7 +25,6 @@ CONF_DEVICE_ID = 'device_id' CONF_CALENDARS = 'calendars' CONF_CUSTOM_CALENDARS = 'custom_calendars' CONF_CALENDAR = 'calendar' -CONF_ALL_DAY = 'all_day' CONF_SEARCH = 'search' PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ @@ -89,7 +88,7 @@ def setup_platform(hass, config, add_devices, disc_info=None): WebDavCalendarEventDevice(hass, device_data, calendar, - cust_calendar.get(CONF_ALL_DAY), + True, cust_calendar.get(CONF_SEARCH)) ) diff --git a/tests/components/calendar/test_caldav.py b/tests/components/calendar/test_caldav.py index 8a44f96fe87..7234d40c410 100644 --- a/tests/components/calendar/test_caldav.py +++ b/tests/components/calendar/test_caldav.py @@ -121,8 +121,10 @@ class TestComponentsWebDavCalendar(unittest.TestCase): assert len(devices) == 2 assert devices[0].name == "First" assert devices[0].dev_id == "First" + self.assertFalse(devices[0].data.include_all_day) assert devices[1].name == "Second" assert devices[1].dev_id == "Second" + self.assertFalse(devices[1].data.include_all_day) caldav.setup_platform(self.hass, { @@ -167,6 +169,7 @@ class TestComponentsWebDavCalendar(unittest.TestCase): assert len(devices) == 1 assert devices[0].name == "HomeOffice" assert devices[0].dev_id == "Second HomeOffice" + self.assertTrue(devices[0].data.include_all_day) caldav.setup_platform(self.hass, {