core icon indicating copy to clipboard operation
core copied to clipboard

Add user picture to fyta

Open dontinelli opened this issue 9 months ago • 5 comments

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:

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 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.

To help with the load of incoming pull requests:

dontinelli avatar Mar 19 '25 14:03 dontinelli

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks :+1:

Learn more about our pull request process.

home-assistant[bot] avatar Mar 25 '25 09:03 home-assistant[bot]

I would either propose:

1. Show both

2. Show user picture or the premade picture

I 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.

dontinelli avatar Mar 25 '25 10:03 dontinelli

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

joostlek avatar Mar 25 '25 10:03 joostlek

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.

dontinelli avatar Mar 25 '25 11:03 dontinelli

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!

Schalex01 avatar May 08 '25 09:05 Schalex01

just in time for the beta cut-off, thank you @joostlek!

dontinelli avatar May 26 '25 14:05 dontinelli

Thank you @joostlek and @dontinelli for this amazing work on the FYTA Integration!

Schalex01 avatar May 26 '25 14:05 Schalex01