diff --git a/homeassistant/components/clickatell/notify.py b/homeassistant/components/clickatell/notify.py index 09096f44b74..fdefb25aef4 100644 --- a/homeassistant/components/clickatell/notify.py +++ b/homeassistant/components/clickatell/notify.py @@ -1,11 +1,12 @@ """Clickatell platform for notify component.""" +from http import HTTPStatus import logging import requests import voluptuous as vol from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService -from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT, HTTP_ACCEPTED, HTTP_OK +from homeassistant.const import CONF_API_KEY, CONF_RECIPIENT import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) @@ -37,5 +38,5 @@ class ClickatellNotificationService(BaseNotificationService): data = {"apiKey": self.api_key, "to": self.recipient, "content": message} resp = requests.get(BASE_API_URL, params=data, timeout=5) - if (resp.status_code != HTTP_OK) or (resp.status_code != HTTP_ACCEPTED): + if resp.status_code not in (HTTPStatus.OK, HTTPStatus.ACCEPTED): _LOGGER.error("Error %s : %s", resp.status_code, resp.text)