Style fixes
parent
3b3f5fe6fe
commit
98b4c27211
|
@ -20,10 +20,10 @@ _LOGGER = logging.getLogger(__name__)
|
|||
def get_service(hass, config):
|
||||
""" Get the mail notification service. """
|
||||
|
||||
if not validate_config(
|
||||
{DOMAIN: config},
|
||||
{DOMAIN: ['server', 'port', 'sender', 'username', 'password',
|
||||
'recipient']}, _LOGGER):
|
||||
if not validate_config({DOMAIN: config},
|
||||
{DOMAIN: ['server', 'port', 'sender', 'username',
|
||||
'password', 'recipient']},
|
||||
_LOGGER):
|
||||
return None
|
||||
|
||||
smtp_server = config['server']
|
||||
|
|
|
@ -50,6 +50,7 @@ class XmppNotificationService(BaseNotificationService):
|
|||
|
||||
|
||||
def send_message(sender, password, recipient, message):
|
||||
""" Send a message over XMPP. """
|
||||
import sleekxmpp
|
||||
|
||||
class SendNotificationBot(sleekxmpp.ClientXMPP):
|
||||
|
@ -78,4 +79,4 @@ def send_message(sender, password, recipient, message):
|
|||
"""" Disconnect from the server if credentials are invalid. """
|
||||
self.disconnect()
|
||||
|
||||
SendNotificationBot(sender, password, recipient, message)
|
||||
SendNotificationBot()
|
||||
|
|
Loading…
Reference in New Issue