Prefer HTTPStatus over int in HA view JSON functions (#56504)

* Prefer HTTPStatus over int in HA view JSON functions

* Update zwave tests to not expect a fixed typo
This commit is contained in:
Ville Skyttä 2021-09-22 21:59:52 +03:00 committed by GitHub
parent 39aaa383b3
commit d8d34fdd3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 191 additions and 190 deletions

View file

@ -1,6 +1,7 @@
"""Config flow to configure Logi Circle component."""
import asyncio
from collections import OrderedDict
from http import HTTPStatus
import async_timeout
from logi_circle import LogiCircle
@ -14,7 +15,6 @@ from homeassistant.const import (
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
CONF_SENSORS,
HTTP_BAD_REQUEST,
)
from homeassistant.core import callback
@ -201,5 +201,6 @@ class LogiCircleAuthCallbackView(HomeAssistantView):
)
return self.json_message("Authorisation code saved")
return self.json_message(
"Authorisation code missing from query string", status_code=HTTP_BAD_REQUEST
"Authorisation code missing from query string",
status_code=HTTPStatus.BAD_REQUEST,
)