Reduce the scope of the google calendar track deprecation (#72575)

pull/72824/head
Allen Porter 2022-05-27 02:52:24 -07:00 committed by Paulus Schoutsen
parent 0d03b85029
commit a35edc6751
2 changed files with 5 additions and 1 deletions

View File

@ -117,7 +117,6 @@ CONFIG_SCHEMA = vol.Schema(
_SINGLE_CALSEARCH_CONFIG = vol.All(
cv.deprecated(CONF_MAX_RESULTS),
cv.deprecated(CONF_TRACK),
vol.Schema(
{
vol.Required(CONF_NAME): cv.string,

View File

@ -93,6 +93,11 @@ def _async_setup_entities(
num_entities = len(disc_info[CONF_ENTITIES])
for data in disc_info[CONF_ENTITIES]:
entity_enabled = data.get(CONF_TRACK, True)
if not entity_enabled:
_LOGGER.warning(
"The 'track' option in google_calendars.yaml has been deprecated. The setting "
"has been imported to the UI, and should now be removed from google_calendars.yaml"
)
entity_name = data[CONF_DEVICE_ID]
entity_id = generate_entity_id(ENTITY_ID_FORMAT, entity_name, hass=hass)
calendar_id = disc_info[CONF_CAL_ID]