Rewrite calendar component (#24950)
* Correct google calendar test name * Rewrite calendar component * Save component in hass.data. * Rename device_state_attributes to state_attributes. * Remove offset attribute from base state_attributes. * Extract offset helpers to calendar component. * Clean imports. * Remove stale constants. * Remove name and add async_get_events. * Add normalize_event helper function. Copied from #21495. * Add event property to base entity. * Use event property for calendar state. * Ensure event start and end. * Remove entity init. * Add comment about event data class. * Temporary keep old start and end datetime format. * Convert demo calendar * Convert google calendar * Convert google calendar. * Clean up google component. * Keep offset feature by using offset helpers. * Convert caldav calendar * Clean up caldav calendar. * Update caldav cal on addition. * Bring back offset to caldav calendar. * Copy caldav event on update. * Convert todoist calendar
This commit is contained in:
1 parent
c6af8811fb
commit
177f5a35ae
7 files changed
+272
-248
No files matched your search
@@ -17,6 +17,7 @@ import homeassistant.util.dt as dt_util
|
||||
|
||||
from tests.common import async_mock_service
|
||||
|
||||
|
||||
GOOGLE_CONFIG = {
|
||||
CONF_CLIENT_ID: 'client_id',
|
||||
CONF_CLIENT_SECRET: 'client_secret',
|
||||
@@ -304,7 +305,7 @@ async def test_all_day_offset_event(hass, mock_next_event):
|
||||
}
|
||||
|
||||
|
||||
async def test_update_false(hass, google_service):
|
||||
async def test_update_error(hass, google_service):
|
||||
"""Test that the calendar handles a server error."""
|
||||
google_service.return_value.get = Mock(
|
||||
side_effect=httplib2.ServerNotFoundError("unit test"))
|
||||
|
||||
Reference in new issue
Block a user