From 41ccbdeebbe4ed700aa582de3be05cbca25ce22c Mon Sep 17 00:00:00 2001 From: RogerSelwyn Date: Thu, 1 Dec 2022 17:47:01 +0000 Subject: [PATCH] Fix incorrect service name created after conversion --- custom_components/o365/notify.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/o365/notify.py b/custom_components/o365/notify.py index 4fa5e85..03cfd75 100644 --- a/custom_components/o365/notify.py +++ b/custom_components/o365/notify.py @@ -20,6 +20,7 @@ CONF_ACCOUNT_NAME, CONF_CONFIG_TYPE, DOMAIN, + LEGACY_ACCOUNT_NAME, PERM_MAIL_SEND, PERM_MINIMUM_SEND, ) @@ -61,7 +62,10 @@ def __init__(self, account, hass, config): ) self._cleanup_files = [] self._hass = hass - if account_name := config.get(CONF_ACCOUNT_NAME, None): + account_name = config.get(CONF_ACCOUNT_NAME, None) + if account_name == LEGACY_ACCOUNT_NAME: + account_name = "" + elif account_name: account_name = f"_{account_name}" self._account_name = account_name