Rest fixes (#61296)

This commit is contained in:
Paulus Schoutsen 2021-12-08 14:35:50 -08:00 committed by GitHub
parent af603d0427
commit 17cf53677c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 50 deletions

View file

@ -25,7 +25,6 @@ from homeassistant.const import (
)
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.template import Template
_LOGGER = logging.getLogger(__name__)
_ENDPOINT = "https://pvoutput.org/service/r2/getstatus.jsp"
@ -60,10 +59,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
method = "GET"
payload = auth = None
verify_ssl = DEFAULT_VERIFY_SSL
headers = {
"X-Pvoutput-Apikey": Template(api_key, hass),
"X-Pvoutput-SystemId": Template(system_id, hass),
}
headers = {"X-Pvoutput-Apikey": api_key, "X-Pvoutput-SystemId": system_id}
rest = RestData(hass, method, _ENDPOINT, auth, headers, None, payload, verify_ssl)
await rest.async_update()