Skip to content

Commit

Permalink
Fix notify service name for converted accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerSelwyn committed Dec 22, 2022
1 parent 898067c commit cd6b14c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions custom_components/o365/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
CONF_ACCOUNT_NAME,
CONF_CONFIG_TYPE,
DOMAIN,
LEGACY_ACCOUNT_NAME,
PERM_MAIL_SEND,
PERM_MINIMUM_SEND,
)
Expand Down Expand Up @@ -67,9 +68,12 @@ def __init__(self, account, hass, config):
)
self._cleanup_files = []
self._hass = hass
if account_name := config.get(CONF_ACCOUNT_NAME, None):
account_name = f"_{account_name}"
self._account_name = account_name
self._account_name = config.get(CONF_ACCOUNT_NAME, None)
if self._account_name:
if self._account_name == LEGACY_ACCOUNT_NAME:
self._account_name = ""
else:
self._account_name = f"_{self._account_name}"

@property
def targets(self):
Expand Down

0 comments on commit cd6b14c

Please sign in to comment.