diff --git a/homeassistant/components/notify/facebook.py b/homeassistant/components/notify/facebook.py index 630d5453daf..2acabcf02c0 100644 --- a/homeassistant/components/notify/facebook.py +++ b/homeassistant/components/notify/facebook.py @@ -13,6 +13,7 @@ import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.components.notify import ( ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService) +from homeassistant.const import CONTENT_TYPE_JSON _LOGGER = logging.getLogger(__name__) @@ -42,7 +43,7 @@ class FacebookNotificationService(BaseNotificationService): targets = kwargs.get(ATTR_TARGET) if not targets: - _LOGGER.info("At least 1 target is required") + _LOGGER.error("At least 1 target is required") return for target in targets: @@ -53,7 +54,8 @@ class FacebookNotificationService(BaseNotificationService): import json resp = requests.post(BASE_URL, data=json.dumps(body), params=payload, - headers={'Content-Type': 'application/json'}) + headers={'Content-Type': CONTENT_TYPE_JSON}, + timeout=10) if resp.status_code != 200: obj = resp.json() error_message = obj['error']['message']