diff --git a/custom_components/presence_simulation/__init__.py b/custom_components/presence_simulation/__init__.py index 8bedbf4..acd7107 100644 --- a/custom_components/presence_simulation/__init__.py +++ b/custom_components/presence_simulation/__init__.py @@ -111,8 +111,7 @@ async def async_expand_entities(entities): #to make it asyncable, not sure it is needed await asyncio.sleep(0) if hass.states.get(entity) is None: - _LOGGER.error("Error when trying to identify entity %s, it seems it doesn't exist", entity) - raise Exception("Entity is not known by HA, see log for more details") + _LOGGER.error("Error when trying to identify entity %s, it seems it doesn't exist. Continuing without this entity", entity) else: if 'entity_id' in hass.states.get(entity).attributes: #get the list of the associated entities @@ -179,6 +178,12 @@ async def handle_presence_simulation(call, restart=False, entities_after_restart entity.internal_turn_off() return + if len(expanded_entities) == 0: + _LOGGER.error("Error during identifing entities, no valid entities has been found") + running = False + entity.internal_turn_off() + return + if not restart: #set attribute on the switch try: diff --git a/custom_components/presence_simulation/manifest.json b/custom_components/presence_simulation/manifest.json index 5b0223b..4187a41 100644 --- a/custom_components/presence_simulation/manifest.json +++ b/custom_components/presence_simulation/manifest.json @@ -5,7 +5,7 @@ "issue_tracker": "https://github.com/slashback100/presence_simulation/issues", "dependencies": ["history", "recorder", "scene"], "config_flow": true, - "version": "1.17", + "version": "1.18", "codeowners": [ "@slashback100" ],