From 14869483ca671403258a1d792fd555859b3fd226 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 27 Apr 2021 23:24:11 -1000 Subject: [PATCH] Fix scrape sensor auth with httpx (#49806) --- homeassistant/components/scrape/sensor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/scrape/sensor.py b/homeassistant/components/scrape/sensor.py index 3bf070a7d79..921ab29f714 100644 --- a/homeassistant/components/scrape/sensor.py +++ b/homeassistant/components/scrape/sensor.py @@ -2,7 +2,7 @@ import logging from bs4 import BeautifulSoup -from requests.auth import HTTPBasicAuth, HTTPDigestAuth +import httpx import voluptuous as vol from homeassistant.components.rest.data import RestData @@ -72,9 +72,9 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info= if username and password: if config.get(CONF_AUTHENTICATION) == HTTP_DIGEST_AUTHENTICATION: - auth = HTTPDigestAuth(username, password) + auth = httpx.DigestAuth(username, password) else: - auth = HTTPBasicAuth(username, password) + auth = (username, password) else: auth = None rest = RestData(hass, method, resource, auth, headers, None, payload, verify_ssl)