Fix scrape sensor auth with httpx (#49806)
This commit is contained in:
parent
dcb5b9f8b5
commit
14869483ca
1 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue