Add Calendar API endpoint to get events (#14702)

* Add Calendar API endpoint to get events

* Set default event color

* Fix PR comments

* Fix PR comments

* Fix PR comments

* Remote local.py file

* Use iso 8601

* Fix lint

* Fix PR comments

* Fix PR comments

* Add Support for todoist and demo calendar

* Todoist events are allday events

* Add calendar demo api endpoint test

* Register only one api endpoint for calendar

* Rename demo calendar
This commit is contained in:
Thibault Cohen authored and Paulus Schoutsen committed 2018-06-15 11:16:31 -04:00
1 parent 1128104281
commit 3cd4cb741c
8 files changed
+202 -34

No files matched your search

+7 -6
View File
@@ -27,6 +27,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
def setUp(self):
"""Setup things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.hass.http = Mock()
# Set our timezone to CST/Regina so we can check calculations
# This keeps UTC-6 all year round
@@ -99,7 +100,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
'start_time': '{} 00:00:00'.format(event['start']['date']),
'end_time': '{} 00:00:00'.format(event['end']['date']),
'location': event['location'],
'description': event['description']
'description': event['description'],
})
@patch('homeassistant.components.calendar.google.GoogleCalendarData')
@@ -160,7 +161,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
(one_hour_from_now + dt_util.dt.timedelta(minutes=60))
.strftime(DATE_STR_FORMAT),
'location': '',
'description': ''
'description': '',
})
@patch('homeassistant.components.calendar.google.GoogleCalendarData')
@@ -222,7 +223,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
(middle_of_event + dt_util.dt.timedelta(minutes=60))
.strftime(DATE_STR_FORMAT),
'location': '',
'description': ''
'description': '',
})
@patch('homeassistant.components.calendar.google.GoogleCalendarData')
@@ -285,7 +286,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
(middle_of_event + dt_util.dt.timedelta(minutes=60))
.strftime(DATE_STR_FORMAT),
'location': '',
'description': ''
'description': '',
})
@pytest.mark.skip
@@ -352,7 +353,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
'start_time': '{} 06:00:00'.format(event['start']['date']),
'end_time': '{} 06:00:00'.format(event['end']['date']),
'location': event['location'],
'description': event['description']
'description': event['description'],
})
@patch('homeassistant.components.calendar.google.GoogleCalendarData')
@@ -419,7 +420,7 @@ class TestComponentsGoogleCalendar(unittest.TestCase):
'start_time': '{} 00:00:00'.format(event['start']['date']),
'end_time': '{} 00:00:00'.format(event['end']['date']),
'location': event['location'],
'description': event['description']
'description': event['description'],
})
@MockDependency("httplib2")