From 9f99a53a1753f621114a8cd2f5db84455f0aa3cd Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Sep 2019 00:58:06 +0200 Subject: [PATCH 1/2] Upgrade sendgrid to 6.1.0 --- homeassistant/components/sendgrid/manifest.json | 2 +- homeassistant/components/sendgrid/notify.py | 4 ++-- requirements_all.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/sendgrid/manifest.json b/homeassistant/components/sendgrid/manifest.json index eb006f408bcbd8..1ffbe69888f329 100644 --- a/homeassistant/components/sendgrid/manifest.json +++ b/homeassistant/components/sendgrid/manifest.json @@ -3,7 +3,7 @@ "name": "Sendgrid", "documentation": "https://www.home-assistant.io/components/sendgrid", "requirements": [ - "sendgrid==6.0.5" + "sendgrid==6.1.0" ], "dependencies": [], "codeowners": [] diff --git a/homeassistant/components/sendgrid/notify.py b/homeassistant/components/sendgrid/notify.py index ac334587b89035..f10d09da5638b2 100644 --- a/homeassistant/components/sendgrid/notify.py +++ b/homeassistant/components/sendgrid/notify.py @@ -11,6 +11,8 @@ ) import homeassistant.helpers.config_validation as cv +from sendgrid import SendGridAPIClient + from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT, @@ -45,8 +47,6 @@ class SendgridNotificationService(BaseNotificationService): def __init__(self, config): """Initialize the service.""" - from sendgrid import SendGridAPIClient - self.api_key = config[CONF_API_KEY] self.sender = config[CONF_SENDER] self.sender_name = config[CONF_SENDER_NAME] diff --git a/requirements_all.txt b/requirements_all.txt index a17c201a9528d6..e88a9bfc771afb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1720,7 +1720,7 @@ schiene==0.23 scsgate==0.1.0 # homeassistant.components.sendgrid -sendgrid==6.0.5 +sendgrid==6.1.0 # homeassistant.components.sensehat sense-hat==2.2.0 From 4ddb9a3a36ad317a8a71b9f54ef22bb40fe1003a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 22 Sep 2019 10:51:44 +0200 Subject: [PATCH 2/2] Move import (could to be a Black issue) --- homeassistant/components/sendgrid/notify.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sendgrid/notify.py b/homeassistant/components/sendgrid/notify.py index f10d09da5638b2..f16758a53559c2 100644 --- a/homeassistant/components/sendgrid/notify.py +++ b/homeassistant/components/sendgrid/notify.py @@ -3,6 +3,8 @@ import voluptuous as vol +from sendgrid import SendGridAPIClient + from homeassistant.const import ( CONF_API_KEY, CONF_RECIPIENT, @@ -11,8 +13,6 @@ ) import homeassistant.helpers.config_validation as cv -from sendgrid import SendGridAPIClient - from homeassistant.components.notify import ( ATTR_TITLE, ATTR_TITLE_DEFAULT,