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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user