Fix AWS Lambda breakage after #5824 (#5935)

Add an optional extended description…
This commit is contained in:
Robbie Trencheny 2017-02-13 00:27:50 -08:00 committed by Pascal Vizeli
parent 7b56fe2af6
commit feb2ebbc03

View File

@ -15,6 +15,7 @@ from homeassistant.const import (
from homeassistant.components.notify import (
ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService)
import homeassistant.helpers.config_validation as cv
from homeassistant.remote import JSONEncoder
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ["boto3==1.4.3"]
@ -38,7 +39,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def get_service(hass, config, discovery_info=None):
"""Get the AWS Lambda notification service."""
context_str = json.dumps({'hass': hass.config.as_dict(),
'custom': config[CONF_CONTEXT]})
'custom': config[CONF_CONTEXT]}, cls=JSONEncoder)
context_b64 = base64.b64encode(context_str.encode("utf-8"))
context = context_b64.decode("utf-8")