From 0877ea07b348bdd4f9eac7cd4cd381cc8b4121bc Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 3 Nov 2017 10:12:45 -0700 Subject: [PATCH] Fix formatting invalid config text (#10319) --- homeassistant/config.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/homeassistant/config.py b/homeassistant/config.py index 89289378c76..c4c96804fca 100644 --- a/homeassistant/config.py +++ b/homeassistant/config.py @@ -677,9 +677,18 @@ def async_notify_setup_error(hass, component, link=False): errors = hass.data[DATA_PERSISTENT_ERRORS] = {} errors[component] = errors.get(component) or link - _lst = [HA_COMPONENT_URL.format(name.replace('_', '-'), name) - if link else name for name, link in errors.items()] - message = ('The following components and platforms could not be set up:\n' - '* ' + '\n* '.join(list(_lst)) + '\nPlease check your config') + + message = 'The following components and platforms could not be set up:\n\n' + + for name, link in errors.items(): + if link: + part = HA_COMPONENT_URL.format(name.replace('_', '-'), name) + else: + part = name + + message += ' - {}\n'.format(part) + + message += '\nPlease check your config.' + persistent_notification.async_create( hass, message, 'Invalid config', 'invalid_config')