Skip to content

Add user picture to fyta #140934

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 26, 2025
Merged

Conversation

dontinelli
Copy link
Contributor

@dontinelli dontinelli commented Mar 19, 2025

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!)
  • 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

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • 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:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • 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:

Copy link
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@home-assistant home-assistant bot marked this pull request as draft March 25, 2025 09:52
@home-assistant
Copy link

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

Learn more about our pull request process.

@dontinelli
Copy link
Contributor Author

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.

@joostlek
Copy link
Member

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

@dontinelli
Copy link
Contributor Author

dontinelli commented Mar 25, 2025

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 dontinelli marked this pull request as ready for review March 26, 2025 13:40
@home-assistant home-assistant bot requested a review from joostlek March 26, 2025 13:40
@Schalex01
Copy link
Contributor

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!

dontinelli and others added 2 commits May 10, 2025 10:32
…nt images (#12)

* Refactor FYTA integration to provide both default and user plant images as separate entities

* Refactor FYTA tests by removing unused CONF_USER_IMAGE option and related test cases

* Update FytaPlantImageEntity to set entity name based on image type

* Refactor FYTA image tests to accommodate separate plant and user image entities, updating assertions and snapshots accordingly.

* Enhance FYTA image handling by introducing FytaImageEntityDescription for better separation of plant and user images, and update image URL retrieval logic. Additionally, add localized strings for image entities in strings.json.

* Correct typo

* Update FYTA image snapshots to reflect changes in translation keys for plant and user images.

* Update homeassistant/components/fyta/image.py

* Update homeassistant/components/fyta/image.py

---------

Co-authored-by: dontinelli <[email protected]>
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Schalex01

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft May 12, 2025 18:52
Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Schalex01

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot dismissed stale reviews from themself May 12, 2025 19:18

Stale

Copy link

@home-assistant home-assistant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Schalex01

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@home-assistant home-assistant bot marked this pull request as draft May 12, 2025 19:20
@dontinelli dontinelli marked this pull request as ready for review May 12, 2025 19:25
@home-assistant home-assistant bot dismissed their stale review May 12, 2025 19:25

Stale

@home-assistant home-assistant bot marked this pull request as draft May 22, 2025 12:49
@dontinelli dontinelli marked this pull request as ready for review May 22, 2025 18:29
@home-assistant home-assistant bot requested a review from joostlek May 22, 2025 18:30
@joostlek joostlek merged commit 14cd00a into home-assistant:dev May 26, 2025
34 checks passed
@dontinelli
Copy link
Contributor Author

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

@dontinelli dontinelli deleted the dontinelli-plant-picture branch May 26, 2025 14:02
@Schalex01
Copy link
Contributor

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

@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom image not shown in Home Assistant
3 participants