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

@ -8,7 +8,7 @@ import async_timeout
import voluptuous as vol
from homeassistant.components.scene import Scene
from homeassistant.const import CONF_PLATFORM, CONF_TIMEOUT, CONF_TOKEN
from homeassistant.const import CONF_PLATFORM, CONF_TIMEOUT, CONF_TOKEN, HTTP_OK
from homeassistant.helpers.aiohttp_client import async_get_clientsession
import homeassistant.helpers.config_validation as cv
@ -44,7 +44,7 @@ async def async_setup_platform(hass, config, async_add_entities, discovery_info=
return False
status = scenes_resp.status
if status == 200:
if status == HTTP_OK:
data = await scenes_resp.json()
devices = []
for scene in data: