1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

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
79 changed files with 214 additions and 154 deletions

View File

@@ -12,6 +12,7 @@ from homeassistant.const import (
CONF_RECIPIENT,
CONF_USERNAME,
CONTENT_TYPE_JSON,
HTTP_OK,
)
import homeassistant.helpers.config_validation as cv
@@ -87,7 +88,7 @@ class ClicksendNotificationService(BaseNotificationService):
timeout=TIMEOUT,
)
if resp.status_code == 200:
if resp.status_code == HTTP_OK:
return
obj = json.loads(resp.text)
response_msg = obj["response_msg"]
@@ -107,7 +108,7 @@ def _authenticate(config):
timeout=TIMEOUT,
)
if resp.status_code != 200:
if resp.status_code != HTTP_OK:
return False
return True