Add scrape sensor name to logs (#38020)

pull/38028/head
Ryan 2020-07-20 14:07:36 -07:00 committed by GitHub
parent 19870ea867
commit 59063a7d61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ class ScrapeSensor(Entity):
"""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")
_LOGGER.error("Unable to retrieve data for %s", self.name)
return
raw_data = BeautifulSoup(self.rest.data, "html.parser")
@ -139,7 +139,7 @@ class ScrapeSensor(Entity):
value = tag.text
_LOGGER.debug(value)
except IndexError:
_LOGGER.error("Unable to extract data from HTML")
_LOGGER.error("Unable to extract data from HTML for %s", self.name)
return
if self._value_template is not None: