Add and use HTTP_FORBIDDEN constant (#33839)

This commit is contained in:
springstan authored and GitHub committed 2020-04-09 17:41:17 +02:00
1 parent 70ee9d7f26
commit bc26be3c11
15 files changed
+60 -37

No files matched your search

@@ -8,6 +8,7 @@ from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationSer
from homeassistant.const import (
CONF_ACCESS_TOKEN,
CONF_USERNAME,
HTTP_FORBIDDEN,
HTTP_INTERNAL_SERVER_ERROR,
)
import homeassistant.helpers.config_validation as cv
@@ -39,7 +40,7 @@ class FreeSMSNotificationService(BaseNotificationService):
_LOGGER.error("At least one parameter is missing")
elif resp.status_code == 402:
_LOGGER.error("Too much SMS send in a few time")
elif resp.status_code == 403:
elif resp.status_code == HTTP_FORBIDDEN:
_LOGGER.error("Wrong Username/Password")
elif resp.status_code == HTTP_INTERNAL_SERVER_ERROR:
_LOGGER.error("Server error, try later")