Replace pymailgun with pymailgunner (#7436)
* mailgun: Replace pymailgun with pymailgunner * Fix imports
This commit is contained in:
parent
7e539a3cb2
commit
cc0299d046
2 changed files with 7 additions and 9 deletions
|
@ -17,9 +17,7 @@ import homeassistant.helpers.config_validation as cv
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
REQUIREMENTS = ['https://github.com/pschmitt/pymailgun/'
|
||||
'archive/1.3.zip#'
|
||||
'pymailgun==1.3']
|
||||
REQUIREMENTS = ['pymailgunner==1.4']
|
||||
|
||||
# Images to attach to notification
|
||||
ATTR_IMAGES = 'images'
|
||||
|
@ -65,7 +63,7 @@ class MailgunNotificationService(BaseNotificationService):
|
|||
|
||||
def initialize_client(self):
|
||||
"""Initialize the connection to Mailgun."""
|
||||
from pymailgun import Client
|
||||
from pymailgunner import Client
|
||||
self._client = Client(self._token, self._domain, self._sandbox)
|
||||
_LOGGER.debug("Mailgun domain: %s", self._client.domain)
|
||||
self._domain = self._client.domain
|
||||
|
@ -74,7 +72,7 @@ class MailgunNotificationService(BaseNotificationService):
|
|||
|
||||
def connection_is_valid(self):
|
||||
"""Check whether the provided credentials are valid."""
|
||||
from pymailgun import (MailgunCredentialsError, MailgunDomainError)
|
||||
from pymailgunner import (MailgunCredentialsError, MailgunDomainError)
|
||||
try:
|
||||
self.initialize_client()
|
||||
except MailgunCredentialsError:
|
||||
|
@ -87,7 +85,7 @@ class MailgunNotificationService(BaseNotificationService):
|
|||
|
||||
def send_message(self, message="", **kwargs):
|
||||
"""Send a mail to the recipient."""
|
||||
from pymailgun import MailgunError
|
||||
from pymailgunner import MailgunError
|
||||
subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
|
||||
data = kwargs.get(ATTR_DATA)
|
||||
files = data.get(ATTR_IMAGES) if data else None
|
||||
|
|
|
@ -300,9 +300,6 @@ https://github.com/molobrakos/python-pocketcasts/archive/9f61ff00c77c7c98ffa0af9
|
|||
# homeassistant.components.switch.anel_pwrctrl
|
||||
https://github.com/mweinelt/anel-pwrctrl/archive/ed26e8830e28a2bfa4260a9002db23ce3e7e63d7.zip#anel_pwrctrl==0.0.1
|
||||
|
||||
# homeassistant.components.notify.mailgun
|
||||
https://github.com/pschmitt/pymailgun/archive/1.3.zip#pymailgun==1.3
|
||||
|
||||
# homeassistant.components.switch.edimax
|
||||
https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1
|
||||
|
||||
|
@ -590,6 +587,9 @@ pylitejet==0.1
|
|||
# homeassistant.components.sensor.loopenergy
|
||||
pyloopenergy==0.0.17
|
||||
|
||||
# homeassistant.components.notify.mailgun
|
||||
pymailgunner==1.4
|
||||
|
||||
# homeassistant.components.mochad
|
||||
pymochad==0.1.1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue