Allow scrape sensor to retry setting up platform if initial setup fails (#19498)
parent
30841ef4da
commit
3a3d488de3
|
@ -17,6 +17,7 @@ from homeassistant.const import (
|
|||
CONF_PASSWORD, CONF_AUTHENTICATION, HTTP_BASIC_AUTHENTICATION,
|
||||
HTTP_DIGEST_AUTHENTICATION)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = ['beautifulsoup4==4.6.3']
|
||||
|
@ -73,8 +74,7 @@ def setup_platform(hass, config, add_entities, discovery_info=None):
|
|||
rest.update()
|
||||
|
||||
if rest.data is None:
|
||||
_LOGGER.error("Unable to fetch data from %s", resource)
|
||||
return False
|
||||
raise PlatformNotReady
|
||||
|
||||
add_entities([
|
||||
ScrapeSensor(rest, name, select, attr, value_template, unit)], True)
|
||||
|
|
Loading…
Reference in New Issue