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
@@ -8,7 +8,6 @@ import voluptuous as vol
|
||||
from voluptuous.error import Error as VoluptuousError
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.setup import setup_component
|
||||
from homeassistant.helpers import discovery
|
||||
from homeassistant.helpers.entity import generate_entity_id
|
||||
from homeassistant.helpers.event import track_time_change
|
||||
@@ -312,9 +311,6 @@ def do_setup(hass, hass_config, config):
|
||||
setup_services(hass, hass_config, track_new_found_calendars,
|
||||
calendar_service)
|
||||
|
||||
# Ensure component is loaded
|
||||
setup_component(hass, 'calendar', config)
|
||||
|
||||
for calendar in hass.data[DATA_INDEX].values():
|
||||
discovery.load_platform(hass, 'calendar', DOMAIN, calendar,
|
||||
hass_config)
|
||||
|
||||
Reference in new issue
Block a user