Use HTTP_BAD_REQUEST constant (#33797)

This commit is contained in:
springstan authored and GitHub committed 2020-04-09 21:43:42 +02:00
1 parent d510384c0d
commit 4c38e6cfa5
24 files changed
+111 -61

No files matched your search

+2 -2
View File
@@ -12,7 +12,7 @@ from homeassistant.components.http import (
CONF_SSL_CERTIFICATE,
DEFAULT_SERVER_HOST,
)
from homeassistant.const import HTTP_OK, SERVER_PORT
from homeassistant.const import HTTP_BAD_REQUEST, HTTP_OK, SERVER_PORT
from .const import X_HASSIO
@@ -167,7 +167,7 @@ class HassIO:
headers={X_HASSIO: os.environ.get("HASSIO_TOKEN", "")},
)
if request.status not in (HTTP_OK, 400):
if request.status not in (HTTP_OK, HTTP_BAD_REQUEST):
_LOGGER.error("%s return code %d.", command, request.status)
raise HassioAPIError()