Skip to content
Merged
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
10 changes: 3 additions & 7 deletions homeassistant/components/sensor/qnap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
CONF_HOST, CONF_USERNAME, CONF_PASSWORD, CONF_PORT, CONF_SSL, ATTR_NAME,
CONF_VERIFY_SSL, CONF_TIMEOUT, CONF_MONITORED_CONDITIONS, TEMP_CELSIUS)
from homeassistant.util import Throttle
from homeassistant.exceptions import PlatformNotReady
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['qnapstats==0.2.7']
Expand Down Expand Up @@ -107,14 +108,9 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
api = QNAPStatsAPI(config)
api.update()

# QNAP is not available
if not api.data:
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
raise PlatformNotReady

sensors = []

Expand Down