mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Adjust scrape coordinator logging (#81299)
This commit is contained in:
parent
dd092d86d4
commit
283f8585b8
@ -33,4 +33,6 @@ class ScrapeCoordinator(DataUpdateCoordinator[BeautifulSoup]):
|
|||||||
await self._rest.async_update()
|
await self._rest.async_update()
|
||||||
if (data := self._rest.data) is None:
|
if (data := self._rest.data) is None:
|
||||||
raise UpdateFailed("REST data is not available")
|
raise UpdateFailed("REST data is not available")
|
||||||
return await self.hass.async_add_executor_job(BeautifulSoup, data, "lxml")
|
soup = await self.hass.async_add_executor_job(BeautifulSoup, data, "lxml")
|
||||||
|
_LOGGER.debug("Raw beautiful soup: %s", soup)
|
||||||
|
return soup
|
||||||
|
@ -170,7 +170,6 @@ class ScrapeSensor(CoordinatorEntity[ScrapeCoordinator], TemplateSensor):
|
|||||||
def _extract_value(self) -> Any:
|
def _extract_value(self) -> Any:
|
||||||
"""Parse the html extraction in the executor."""
|
"""Parse the html extraction in the executor."""
|
||||||
raw_data = self.coordinator.data
|
raw_data = self.coordinator.data
|
||||||
_LOGGER.debug("Raw beautiful soup: %s", raw_data)
|
|
||||||
try:
|
try:
|
||||||
if self._attr is not None:
|
if self._attr is not None:
|
||||||
value = raw_data.select(self._select)[self._index][self._attr]
|
value = raw_data.select(self._select)[self._index][self._attr]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user