Import persistent notification (part 4) (#63901)
This commit is contained in:
parent
4b6e196606
commit
a672dc3437
10 changed files with 58 additions and 35 deletions
|
@ -5,6 +5,7 @@ from requests.exceptions import ConnectTimeout, HTTPError
|
|||
from skybellpy import Skybell
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components import persistent_notification
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION,
|
||||
CONF_PASSWORD,
|
||||
|
@ -61,7 +62,8 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||
hass.data[DOMAIN] = skybell
|
||||
except (ConnectTimeout, HTTPError) as ex:
|
||||
_LOGGER.error("Unable to connect to Skybell service: %s", str(ex))
|
||||
hass.components.persistent_notification.create(
|
||||
persistent_notification.create(
|
||||
hass,
|
||||
"Error: {}<br />"
|
||||
"You will need to restart hass after fixing."
|
||||
"".format(ex),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue