Add and use HTTP_FORBIDDEN constant (#33839)
This commit is contained in:
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")
|
||||
Reference in new issue
Block a user