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
|
@ -13,6 +13,7 @@ from homeassistant.const import (
|
|||
CONF_API_KEY,
|
||||
CONF_ID,
|
||||
CONF_NAME,
|
||||
HTTP_OK,
|
||||
TIME_MINUTES,
|
||||
)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
@ -112,7 +113,7 @@ class WashingtonStateTravelTimeSensor(WashingtonStateTransportSensor):
|
|||
}
|
||||
|
||||
response = requests.get(RESOURCE, params, timeout=10)
|
||||
if response.status_code != 200:
|
||||
if response.status_code != HTTP_OK:
|
||||
_LOGGER.warning("Invalid response from WSDOT API")
|
||||
else:
|
||||
self._data = response.json()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue