File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
custom_components/calendar_event Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -56,15 +56,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
5656
5757 entity_registry = er .async_get (hass )
5858
59- # try:
60- # entity_id = er.async_validate_entity_id( # noqa: F841
61- # entity_registry, entry.options[CONF_CALENDAR_ENTITY_ID]
62-
63- if (
64- calendar_entity := entity_registry .entities .get_entry (
65- entry .options [CONF_CALENDAR_ENTITY_ID ]
59+ try :
60+ _ = er .async_validate_entity_id (
61+ entity_registry , entry .options [CONF_CALENDAR_ENTITY_ID ]
6662 )
67- ) is None :
63+ except vol . Invalid :
6864 async_create_issue (
6965 hass ,
7066 DOMAIN ,
@@ -97,13 +93,7 @@ def set_source_entity_id_or_uuid(source_entity_id: str) -> None:
9793 )
9894
9995 async def source_entity_removed () -> None :
100- # The source entity has been removed.
101- LOGGER .error (
102- "Failed to setup calendar_event for unknown entity %s" ,
103- entry .options [CONF_CALENDAR_ENTITY_ID ],
104- )
105-
106- # Create a repair issue for the removed calendar entity
96+ # The source entity has been removed, create a repair issue for the removed calendar entity.
10797 async_create_issue (
10898 hass ,
10999 DOMAIN ,
You can’t perform that action at this time.
0 commit comments