mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Changes for Travis bot. Unused variable 'on_ready' will likely remain reported
This commit is contained in:
parent
a444df3fde
commit
887b53b794
@ -27,6 +27,7 @@ def get_service(hass, config, discovery_info=None):
|
|||||||
token = config.get(CONF_TOKEN)
|
token = config.get(CONF_TOKEN)
|
||||||
return DiscordNotificationService(hass, token)
|
return DiscordNotificationService(hass, token)
|
||||||
|
|
||||||
|
|
||||||
class DiscordNotificationService(BaseNotificationService):
|
class DiscordNotificationService(BaseNotificationService):
|
||||||
"""Implement the notification service for Discord."""
|
"""Implement the notification service for Discord."""
|
||||||
|
|
||||||
@ -44,10 +45,10 @@ class DiscordNotificationService(BaseNotificationService):
|
|||||||
@discord_bot.event
|
@discord_bot.event
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def on_ready():
|
def on_ready():
|
||||||
|
"""sends the messages when the bot is ready"""
|
||||||
for channelid in kwargs[ATTR_TARGET]:
|
for channelid in kwargs[ATTR_TARGET]:
|
||||||
channel = discord.Object(id=channelid)
|
channel = discord.Object(id=channelid)
|
||||||
yield from discord_bot.send_message(channel, message)
|
yield from discord_bot.send_message(channel, message)
|
||||||
yield from discord_bot.logout()
|
yield from discord_bot.logout()
|
||||||
|
|
||||||
yield from discord_bot.start(self.token)
|
yield from discord_bot.start(self.token)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user