From 59063a7d61a28decec67bdffbddac23beacc7fef Mon Sep 17 00:00:00 2001 From: Ryan <2199132+rsnodgrass@users.noreply.github.com> Date: Mon, 20 Jul 2020 14:07:36 -0700 Subject: [PATCH] Add scrape sensor name to logs (#38020) --- homeassistant/components/scrape/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/scrape/sensor.py b/homeassistant/components/scrape/sensor.py index 4119f7e4c6b..3d25e4a34ae 100644 --- a/homeassistant/components/scrape/sensor.py +++ b/homeassistant/components/scrape/sensor.py @@ -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: