Skip to content
Snippets Groups Projects
Commit 585214f3 authored by Fabian Affolter's avatar Fabian Affolter Committed by Pascal Vizeli
Browse files

Upgrade Mastodon.py to 1.5.0 (#27598)

parent 5e794087
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@
"name": "Mastodon",
"documentation": "https://www.home-assistant.io/integrations/mastodon",
"requirements": [
"Mastodon.py==1.4.6"
"Mastodon.py==1.5.0"
],
"dependencies": [],
"codeowners": [
......
"""Mastodon platform for notify component."""
import logging
from mastodon import Mastodon
from mastodon.Mastodon import MastodonAPIError, MastodonUnauthorizedError
import voluptuous as vol
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
from homeassistant.const import CONF_ACCESS_TOKEN
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import PLATFORM_SCHEMA, BaseNotificationService
_LOGGER = logging.getLogger(__name__)
CONF_BASE_URL = "base_url"
......@@ -28,9 +29,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
def get_service(hass, config, discovery_info=None):
"""Get the Mastodon notification service."""
from mastodon import Mastodon
from mastodon.Mastodon import MastodonUnauthorizedError
client_id = config.get(CONF_CLIENT_ID)
client_secret = config.get(CONF_CLIENT_SECRET)
access_token = config.get(CONF_ACCESS_TOKEN)
......@@ -60,8 +58,6 @@ class MastodonNotificationService(BaseNotificationService):
def send_message(self, message="", **kwargs):
"""Send a message to a user."""
from mastodon.Mastodon import MastodonAPIError
try:
self._api.toot(message)
except MastodonAPIError:
......
......@@ -38,7 +38,7 @@ Adafruit-SHT31==1.0.2
HAP-python==2.6.0
# homeassistant.components.mastodon
Mastodon.py==1.4.6
Mastodon.py==1.5.0
# homeassistant.components.orangepi_gpio
OPi.GPIO==0.3.6
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment