mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 13:57:10 +00:00
Style fixes
This commit is contained in:
parent
3b3f5fe6fe
commit
98b4c27211
@ -20,10 +20,10 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
def get_service(hass, config):
|
def get_service(hass, config):
|
||||||
""" Get the mail notification service. """
|
""" Get the mail notification service. """
|
||||||
|
|
||||||
if not validate_config(
|
if not validate_config({DOMAIN: config},
|
||||||
{DOMAIN: config},
|
{DOMAIN: ['server', 'port', 'sender', 'username',
|
||||||
{DOMAIN: ['server', 'port', 'sender', 'username', 'password',
|
'password', 'recipient']},
|
||||||
'recipient']}, _LOGGER):
|
_LOGGER):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
smtp_server = config['server']
|
smtp_server = config['server']
|
||||||
|
@ -50,6 +50,7 @@ class XmppNotificationService(BaseNotificationService):
|
|||||||
|
|
||||||
|
|
||||||
def send_message(sender, password, recipient, message):
|
def send_message(sender, password, recipient, message):
|
||||||
|
""" Send a message over XMPP. """
|
||||||
import sleekxmpp
|
import sleekxmpp
|
||||||
|
|
||||||
class SendNotificationBot(sleekxmpp.ClientXMPP):
|
class SendNotificationBot(sleekxmpp.ClientXMPP):
|
||||||
@ -78,4 +79,4 @@ def send_message(sender, password, recipient, message):
|
|||||||
"""" Disconnect from the server if credentials are invalid. """
|
"""" Disconnect from the server if credentials are invalid. """
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
||||||
SendNotificationBot(sender, password, recipient, message)
|
SendNotificationBot()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user