Use HTTP_OK constant (#33798)
* Use http ok constant * Remove incorrect use * Run isort * Fix pylint by adding missing imports * Fix pylint by fixing one import
This commit is contained in:
parent
7383e81609
commit
8d61893c39
79 changed files with 214 additions and 154 deletions
|
@ -17,7 +17,7 @@ from homeassistant.components.image_processing import (
|
|||
from homeassistant.components.openalpr_local.image_processing import (
|
||||
ImageProcessingAlprEntity,
|
||||
)
|
||||
from homeassistant.const import CONF_API_KEY
|
||||
from homeassistant.const import CONF_API_KEY, HTTP_OK
|
||||
from homeassistant.core import split_entity_id
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -121,7 +121,7 @@ class OpenAlprCloudEntity(ImageProcessingAlprEntity):
|
|||
|
||||
data = await request.json()
|
||||
|
||||
if request.status != 200:
|
||||
if request.status != HTTP_OK:
|
||||
_LOGGER.error("Error %d -> %s.", request.status, data.get("error"))
|
||||
return
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue