Skip to content

Commit

Permalink
fix: use async_create for notification (#2380)
Browse files Browse the repository at this point in the history
closes #2382
  • Loading branch information
ChristophCaina authored Aug 2, 2024
1 parent 7224138 commit 48532e4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
)
import async_timeout
from homeassistant import util
from homeassistant.components.persistent_notification import async_creat
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
CONF_EMAIL,
Expand Down Expand Up @@ -1387,7 +1388,8 @@ async def test_login_status(hass, config_entry, login) -> bool:
elaspsed_time: str = str(datetime.now() - login.stats.get("login_timestamp"))
api_calls: int = login.stats.get("api_calls")
message += f"Relogin required after {elaspsed_time} and {api_calls} api calls."
hass.components.persistent_notification.async_create(
# hass.components.persistent_notification.async_create(
async_create(
title="Alexa Media Reauthentication Required",
message=message,
notification_id=f"alexa_media_{slugify(login.email)}{slugify(login.url[7:])}",
Expand Down

0 comments on commit 48532e4

Please sign in to comment.