Persistent notification import (#8507)
* Rewrite persistent notification creation * Update components.is_on to use auto loading * Fix two hass parameters
This commit is contained in:
1 parent
f6c3832e90
commit
d0275c8075
16 files changed
+70
-101
No files matched your search
@@ -110,11 +110,10 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
api.update()
|
||||
|
||||
if not api.data:
|
||||
import homeassistant.loader as loader
|
||||
loader.get_component('persistent_notification').create(
|
||||
hass, 'Error: Failed to set up QNAP sensor.<br />'
|
||||
'Check the logs for additional information. '
|
||||
'You will need to restart hass after fixing.',
|
||||
hass.components.persistent_notification.create(
|
||||
'Error: Failed to set up QNAP sensor.<br />'
|
||||
'Check the logs for additional information. '
|
||||
'You will need to restart hass after fixing.',
|
||||
title=NOTIFICATION_TITLE,
|
||||
notification_id=NOTIFICATION_ID)
|
||||
return False
|
||||
|
||||
Reference in new issue
Block a user