SteveDinn
(Steve Dinn)
July 6, 2023, 8:16pm
1
There are a bunch of options in the Mastodon API (and supported by Mastodon.py) for posting to Mastodon, but currently the HomeAssistant integration only allows specification of the message text. It would be great if we could have access to set these other variables when we post to Mastodon. Many other notification providers allow the caller to set other properties in the “data” sub-object.
I would like to propose the following additional properties:
sensitive
: bool, defaulting to False. Specifies whether the body of the post should be hidden.
spoiler_text
: string, defaulting to None. Only relevant when sensitive
is set to True
. Specifies the text that appears above the hidden content.
visibility
: string, defaulting to None
. If unset, it means that it will use the user’s default setting. otherwise it must be one of the following:
direct
(post will be visible only to mentioned users)
private
(post will be visible only to followers)
unlisted
(post will be public but not appear on the public timeline)
public
(post will be public)
idempotency_key
: string, setting this to some unique value allows retries without danger of the toot being posted more than once.
language
: string, specify to override automatic language detection. Accepts all valid ISO 639-1 (2-letter) or for languages where that do not have one, ISO 639-3 (three letter) language codes.
Ogrinou
(Ogrinou)
July 12, 2023, 1:39pm
2
Thank you, Steve !
I was going to make this request also when I saw your contribution.
I would like also to send direct or private messages.
SteveDinn
(Steve Dinn)
July 12, 2023, 1:49pm
3
Turns out somebody else (They’re probably on here too, but I don’t know their handle) had the same thought as me at the same time that I did – only they did something about it. Go and support these two PRs (functionality and documentation) for this feature:
home-assistant:dev
← thejeffreystone:mastodon_updates
opened 05:47PM - 08 Jul 23 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
<!--
Describe the big picture of your changes here to communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Updated functionality of the Mastodon Integration. Changes allow notifications to include
media, target (public, private, unlisted, direct), media_warning to mark media as sensitive, and
content_warning that hides post content behind spoiler text.
Uses mastodon.py 1.8.1 - https://github.com/halcy/Mastodon.py/blob/1.8.1/CHANGELOG.rst#v181
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New integration (thank you!)
- [X] New feature (which adds functionality to an existing integration)
- [ ] Deprecation (breaking change to happen in the future)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [ ] Code quality improvements to existing code or addition of tests
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/28140
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] The code change is tested and works locally.
- [X] Local tests pass. **Your PR cannot be merged unless tests pass**
- [X] There is no commented out code in this PR.
- [X] I have followed the [development checklist][dev-checklist]
- [X] I have followed the [perfect PR recommendations][perfect-pr]
- [X] The code has been formatted using Black (`black --fast homeassistant tests`)
- [ ] Tests have been added to verify that the new code works.
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated for [www.home-assistant.io][docs-repository]
If the code communicates with devices, web services, or third-party tools:
- [X] The [manifest file][manifest-docs] has all fields filled out correctly.
Updated and included derived files by running: `python3 -m script.hassfest`.
- [X] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [X] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [X] Untested files have been added to `.coveragerc`.
<!--
This project is very active and we have a high turnover of pull requests.
Unfortunately, the number of incoming pull requests is higher than what our
reviewers can review and merge so there is a long backlog of pull requests
waiting for review. You can help here!
By reviewing another pull request, you will help raise the code quality of
that pull request and the final review will be faster. This way the general
pace of pull request reviews will go up and your wait time will go down.
When picking a pull request to review, try to choose one that hasn't yet
been reviewed.
Thanks for helping out!
-->
To help with the load of incoming pull requests:
- [ ] I have reviewed two other [open pull requests][prs] in this repository.
[prs]: https://github.com/home-assistant/core/pulls?q=is%3Aopen+is%3Apr+-author%3A%40me+-draft%3Atrue+-label%3Awaiting-for-upstream+sort%3Acreated-desc+review%3Anone+-status%3Afailure
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
home-assistant:next
← thejeffreystone:updated_mastodon
opened 09:14PM - 08 Jul 23 UTC
## Proposed change
<!--
Describe the big picture of your changes here to … communicate to the
maintainers why we should accept this pull request. If it fixes a bug
or resolves a feature request, be sure to link to that issue in the
additional information section.
-->
Updated the Mastodon documentation to include examples of new functionality being added.
## Type of change
<!--
What types of changes does your PR introduce to our documentation/website?
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR.
-->
- [ ] Spelling, grammar or other readability improvements (`current` branch).
- [ ] Adjusted missing or incorrect information in the current documentation (`current` branch).
- [ ] Added documentation for a new integration I'm adding to Home Assistant (`next` branch).
- [ ] I've opened up a PR to add logo's and icons in [Brands repository](https://github.com/home-assistant/brands).
- [X] Added documentation for a new feature I'm adding to Home Assistant (`next` branch).
- [ ] Removed stale or deprecated documentation.
## Additional information
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- Link to parent pull request in the codebase: https://github.com/home-assistant/core/pull/96163
- Link to parent pull request in the Brands repository:
- This PR fixes or closes issue: fixes #
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [X] This PR uses the correct branch, based on one of the following:
- I made a change to the existing documentation and used the `current` branch.
- I made a change that is related to an upcoming version of Home Assistant and used the `next` branch.
- [X] The documentation follows the Home Assistant documentation [standards].
[standards]: https://developers.home-assistant.io/docs/documenting/standards
2 Likes
This would be a great addition. What’s holding the PRs?
SteveDinn
(Steve Dinn)
February 29, 2024, 1:07am
5
No idea. It’s like he just abandoned them. Does anyone know his username on these forums?