Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions custom_components/authenticated/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import homeassistant.helpers.config_validation as cv
import voluptuous as vol
import yaml
from homeassistant.components import persistent_notification
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.entity import Entity

Expand Down Expand Up @@ -459,7 +460,7 @@ def lookup(self):

def notify(self, hass):
"""Create persistant notification."""
notify = hass.components.persistent_notification.create
notify = persistent_notification.create
message = f"""
**IP Address:** {self.ip_address}
**Username:** {self.username}
Expand All @@ -479,4 +480,4 @@ def notify(self, hass):
if self.last_used_at is not None:
message += f"**Login time:** {self.last_used_at[:19].replace('T', ' ')}"

notify(message, title="New successful login", notification_id=self.ip_address)
notify(hass, message, title="New successful login", notification_id=self.ip_address)