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:
springstan 2020-04-08 18:47:38 +02:00 committed by GitHub
parent 7383e81609
commit 8d61893c39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 214 additions and 154 deletions

View file

@ -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