mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Replace pymailgun with pymailgunner (#7436)
* mailgun: Replace pymailgun with pymailgunner * Fix imports
This commit is contained in:
parent
7e539a3cb2
commit
cc0299d046
@ -17,9 +17,7 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
REQUIREMENTS = ['https://github.com/pschmitt/pymailgun/'
|
REQUIREMENTS = ['pymailgunner==1.4']
|
||||||
'archive/1.3.zip#'
|
|
||||||
'pymailgun==1.3']
|
|
||||||
|
|
||||||
# Images to attach to notification
|
# Images to attach to notification
|
||||||
ATTR_IMAGES = 'images'
|
ATTR_IMAGES = 'images'
|
||||||
@ -65,7 +63,7 @@ class MailgunNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
def initialize_client(self):
|
def initialize_client(self):
|
||||||
"""Initialize the connection to Mailgun."""
|
"""Initialize the connection to Mailgun."""
|
||||||
from pymailgun import Client
|
from pymailgunner import Client
|
||||||
self._client = Client(self._token, self._domain, self._sandbox)
|
self._client = Client(self._token, self._domain, self._sandbox)
|
||||||
_LOGGER.debug("Mailgun domain: %s", self._client.domain)
|
_LOGGER.debug("Mailgun domain: %s", self._client.domain)
|
||||||
self._domain = self._client.domain
|
self._domain = self._client.domain
|
||||||
@ -74,7 +72,7 @@ class MailgunNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
def connection_is_valid(self):
|
def connection_is_valid(self):
|
||||||
"""Check whether the provided credentials are valid."""
|
"""Check whether the provided credentials are valid."""
|
||||||
from pymailgun import (MailgunCredentialsError, MailgunDomainError)
|
from pymailgunner import (MailgunCredentialsError, MailgunDomainError)
|
||||||
try:
|
try:
|
||||||
self.initialize_client()
|
self.initialize_client()
|
||||||
except MailgunCredentialsError:
|
except MailgunCredentialsError:
|
||||||
@ -87,7 +85,7 @@ class MailgunNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
def send_message(self, message="", **kwargs):
|
def send_message(self, message="", **kwargs):
|
||||||
"""Send a mail to the recipient."""
|
"""Send a mail to the recipient."""
|
||||||
from pymailgun import MailgunError
|
from pymailgunner import MailgunError
|
||||||
subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
|
subject = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
|
||||||
data = kwargs.get(ATTR_DATA)
|
data = kwargs.get(ATTR_DATA)
|
||||||
files = data.get(ATTR_IMAGES) if data else None
|
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
|
# homeassistant.components.switch.anel_pwrctrl
|
||||||
https://github.com/mweinelt/anel-pwrctrl/archive/ed26e8830e28a2bfa4260a9002db23ce3e7e63d7.zip#anel_pwrctrl==0.0.1
|
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
|
# homeassistant.components.switch.edimax
|
||||||
https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1
|
https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1
|
||||||
|
|
||||||
@ -590,6 +587,9 @@ pylitejet==0.1
|
|||||||
# homeassistant.components.sensor.loopenergy
|
# homeassistant.components.sensor.loopenergy
|
||||||
pyloopenergy==0.0.17
|
pyloopenergy==0.0.17
|
||||||
|
|
||||||
|
# homeassistant.components.notify.mailgun
|
||||||
|
pymailgunner==1.4
|
||||||
|
|
||||||
# homeassistant.components.mochad
|
# homeassistant.components.mochad
|
||||||
pymochad==0.1.1
|
pymochad==0.1.1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user