Fix errors if rest source becomes unavailable (#24986)

* Fix errors if rest source becomes unavailable

* Remove exclamation mark
pull/24998/head
Robert Dunmire III 2019-07-06 13:33:37 -04:00 committed by Pascal Vizeli
parent 412910ca65
commit 003ca655ee
1 changed files with 3 additions and 0 deletions

View File

@ -109,6 +109,9 @@ class ScrapeSensor(Entity):
def update(self):
"""Get the latest data from the source and updates the state."""
self.rest.update()
if self.rest.data is None:
_LOGGER.error("Unable to retrieve data")
return
from bs4 import BeautifulSoup