From 30fb3fc9819bbe1d6d62a8b64a408ede72676251 Mon Sep 17 00:00:00 2001 From: RogerSelwyn Date: Tue, 31 Oct 2023 12:51:51 +0000 Subject: [PATCH] fix: re-enable sensor creation --- custom_components/o365/setup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/custom_components/o365/setup.py b/custom_components/o365/setup.py index 206f003..337d120 100644 --- a/custom_components/o365/setup.py +++ b/custom_components/o365/setup.py @@ -77,15 +77,16 @@ def _load_platforms(hass, account_name, config, account_config): or len(account_config[CONF_QUERY_SENSORS]) > 0 or len(account_config[CONF_STATUS_SENSORS]) > 0 or len(account_config[CONF_CHAT_SENSORS]) > 0 - or ( - len(account_config[CONF_TODO_SENSORS]) > 0 - and account_config[CONF_TODO_SENSORS].get(CONF_ENABLED, False) - ) ): hass.async_create_task( - # discovery.async_load_platform( - # hass, "sensor", DOMAIN, {CONF_ACCOUNT_NAME: account_name}, config - # ) + discovery.async_load_platform( + hass, "sensor", DOMAIN, {CONF_ACCOUNT_NAME: account_name}, config + ) + ) + if len(account_config[CONF_TODO_SENSORS]) > 0 and account_config[ + CONF_TODO_SENSORS + ].get(CONF_ENABLED, False): + hass.async_create_task( discovery.async_load_platform( hass, "todo", DOMAIN, {CONF_ACCOUNT_NAME: account_name}, config )