Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
585214f3
Commit
585214f3
authored
5 years ago
by
Fabian Affolter
Committed by
Pascal Vizeli
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade Mastodon.py to 1.5.0 (#27598)
parent
5e794087
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
homeassistant/components/mastodon/manifest.json
+1
-1
1 addition, 1 deletion
homeassistant/components/mastodon/manifest.json
homeassistant/components/mastodon/notify.py
+3
-7
3 additions, 7 deletions
homeassistant/components/mastodon/notify.py
requirements_all.txt
+1
-1
1 addition, 1 deletion
requirements_all.txt
with
5 additions
and
9 deletions
homeassistant/components/mastodon/manifest.json
+
1
−
1
View file @
585214f3
...
...
@@ -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"
:
[
...
...
This diff is collapsed.
Click to expand it.
homeassistant/components/mastodon/notify.py
+
3
−
7
View file @
585214f3
"""
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
:
...
...
This diff is collapsed.
Click to expand it.
requirements_all.txt
+
1
−
1
View file @
585214f3
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment