Add user picture to fyta
Proposed change
Add possibility for user to change between user picture and generic plant picture as image for the plants.
PR closes an issue raised. In my view it is not a bugfix but a new feature, though.
Type of change
- [ ] 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
- This PR fixes or closes issue: fixes #139510
- This PR is related to issue:
- Link to documentation pull request: https://github.com/home-assistant/home-assistant.io/pull/38079
- Link to developer documentation pull request:
- Link to frontend pull request:
Checklist
- [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
- [x] I have followed the perfect PR recommendations
- [x] The code has been formatted using Ruff (
ruff format homeassistant tests) - [x] 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
If the code communicates with devices, web services, or third-party tools:
- [x] The manifest file 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 runningpython3 -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.
To help with the load of incoming pull requests:
- [ ] I have reviewed two other open pull requests in this repository.
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:
I would either propose:
1. Show both 2. Show user picture or the premade pictureI am curious how fyta does that in their app. Do they only show the user picture or the general picture, or do they show both?
In the app you only see one picture. The general picture is used, if the user did not make a user picture. According to my understanding it is not possible to change back from the user picture to the general picture in the app. You only can make a new user picture.
Me personally, I don't see a material benefit in showing both pictures. The picture is only used for identification/beautification and I don't think that there are users that need two pictures for this. On the other hand, I like the possibility for the user to choose, which picture to be shown. I - for example - found out that my user picture for one plant is much worse than the generic one. As I cannot change it back in the app, I would have to delete the plant and set it up from scratch (with loosing all the history). Therefore I would like to see the better picture at least in HA.
I kinda think that we shouldn't make it an option. Because in the future you will get a feature request to enable it for one plant, but disable for the other. Say your 1 plant is meh but the other 3 look good, and then it becomes a slippery slope. So I think we should stay consistent with the app
I don't agree. First, I don't think we should renounce on a feature because in the future a (perhaps excessive) feature request could come up. We may decide then how to handle such request (frankly, I don't see the slippery slope). Secondly, the user picture would be a regression for my personal use case. I know this is selfish, but I don't like putting effort in something that impairs my personal user experience. I then prefer the current state.
PS I see your point regarding consistency. On the other hand, why not make something better, if we can? We should not be limited by restrictions of the app.
I kinda think that we shouldn't make it an option. Because in the future you will get a feature request to enable it for one plant, but disable for the other. Say your 1 plant is meh but the other 3 look good, and then it becomes a slippery slope. So I think we should stay consistent with the app
If I may add a quick thought:
FYTA’s API already offers two images per plant—the generic stock photo and any user-taken photo. Could the integration simply surface both as separate entities and let users decide in their dashboards? That would avoid extra config switches while giving everyone full flexibility. Thanks for considering—and for all the great work on this PR!
just in time for the beta cut-off, thank you @joostlek!
Thank you @joostlek and @dontinelli for this amazing work on the FYTA Integration!