Add mastodon.update_profile action to Mastodon integration#167444
Conversation
|
Hey there @fabaff, @andrew-codechimp, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
This pull request adds a new mastodon.update_profile service action to the Mastodon integration, allowing users to update their profile information including display name, bio, profile pictures, and additional profile fields.
Changes:
- Added the
update_profileservice implementation with support for updating display name, bio, avatar, header, locked status, bot flag, discoverable status, profile fields, and attribution domains - Added YAML anchor/alias refactoring for the
config_entry_idfield to reduce duplication across service definitions - Added service strings and translations for the new action and profile fields selector
- Added service icon for the new action
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
homeassistant/components/mastodon/services.py |
Added _async_update_profile service handler and _resolve_media helper function for media resolution |
homeassistant/components/mastodon/services.yaml |
Added update_profile service schema definition and refactored config_entry_id field as YAML anchor |
homeassistant/components/mastodon/strings.json |
Added translations for the new service, profile fields selector, and field descriptions |
homeassistant/components/mastodon/icons.json |
Added icon definition for the new update_profile service |
| get_account: | ||
| fields: | ||
| config_entry_id: | ||
| config_entry_id: &config_entry_id |
There was a problem hiding this comment.
Not familiar with this syntax but all others you've changed are using *config_entry_id
There was a problem hiding this comment.
This is anchor to which all others are referencing
| SERVICE_UPDATE_PROFILE, | ||
| _async_update_profile, | ||
| schema=SERVICE_UPDATE_PROFILE_SCHEMA, | ||
| supports_response=SupportsResponse.ONLY, |
There was a problem hiding this comment.
Are we expecting a response on this?
There was a problem hiding this comment.
The APIs response is the updated Account data
There was a problem hiding this comment.
ok, could be useful.
I wonder if we should trigger a coordinator refresh on success, otherwise the entities will be out of date and they have a fairly long poll period.
Proposed change
Adds an action to update profile information and pictures
Type of change
Additional information
mastodon.update_profileaction in Mastodon integration home-assistant.io#44511Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: