Skip to content

Commit

Permalink
Revert "fix: replace deprecated hass.components usage (config_flow.py)"
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse authored Aug 4, 2024
1 parent 72ba93d commit b8f3723
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions custom_components/alexa_media/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from homeassistant.components.persistent_notification import (
async_create as async_create_persistent_notification,
async_dismiss as async_dismiss_persistent_notification,
create as create_persistent_notification,
)
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
Expand Down Expand Up @@ -1395,7 +1394,6 @@ async def test_login_status(hass, config_entry, login) -> bool:
api_calls: int = login.stats.get("api_calls")
message += f"Relogin required after {elaspsed_time} and {api_calls} api calls."
async_create_persistent_notification(
hass,
title="Alexa Media Reauthentication Required",
message=message,
notification_id=f"alexa_media_{slugify(login.email)}{slugify(login.url[7:])}",
Expand Down
7 changes: 1 addition & 6 deletions custom_components/alexa_media/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@
)
from homeassistant import config_entries
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.components.persistent_notification import (
async_create as async_create_persistent_notification,
async_dismiss as async_dismiss_persistent_notification,
create as create_persistent_notification,
)
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, CONF_SCAN_INTERVAL, CONF_URL
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult, UnknownFlow
Expand Down Expand Up @@ -638,7 +633,7 @@ async def _test_login(self):
"alexa_media_relogin_success",
event_data={"email": hide_email(email), "url": login.url},
)
async_dismiss_persistent_notification(
self.hass.components.persistent_notification.async_dismiss(
f"alexa_media_{slugify(email)}{slugify(login.url[7:])}"
)
if not self.hass.data[DATA_ALEXAMEDIA]["accounts"].get(
Expand Down

0 comments on commit b8f3723

Please sign in to comment.