Skip to content
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

Add support for update entity's update_percentage state attribute #22453

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

emontnemery
Copy link
Collaborator

@emontnemery emontnemery commented Oct 21, 2024

Proposed change

Add support for update entity's update_percentage state attribute

Backend PR: home-assistant/core#128877

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

piitaya
piitaya previously approved these changes Oct 21, 2024
Copy link
Member

@piitaya piitaya left a comment

Choose a reason for hiding this comment

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

Do we need to have backward compatibility or not? Entities that are not migrated yet to the new format will not have percentage.
I'm ok with that but I wanted to be sure. Otherwise, the PR is ok for me.

@emontnemery
Copy link
Collaborator Author

emontnemery commented Oct 21, 2024

@piitaya there's no need for backwards compatibility in frontend to my understanding, the linked core update integration PR makes sure that:

  • Thein_progress state attribute is True if the update entity's in_progress property is True, or a number
  • The update_percentage state attribute is a number if the update entity's in_progress property is a number, otherwise it's None / null

latest_version: string | null;
release_summary: string | null;
release_url: string | null;
skipped_version: string | null;
title: string | null;
update_percentage: number | null;
Copy link
Member

@bramkragten bramkragten Oct 21, 2024

Choose a reason for hiding this comment

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

Will this attribute always be around, even when not updating or not supported?

Copy link
Collaborator Author

@emontnemery emontnemery Oct 21, 2024

Choose a reason for hiding this comment

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

Yes, that's how it's implemented in the core PR. If that's changed during the review of the core PR, this PR needs to be updated I think?

@bramkragten
Copy link
Member

What is missing here is a change to the update screen in the voice assistant wizard, I'll add that tomorrow

@frenck frenck added backend merged The backend PR for this frontend PR has been merged and removed wait for backend labels Oct 21, 2024
@piitaya piitaya removed the Backend Change Required Requires a Backend Core Code Change label Oct 23, 2024
@piitaya piitaya merged commit f1ab24d into dev Oct 23, 2024
15 checks passed
@piitaya piitaya deleted the update_progress_percentage branch October 23, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend merged The backend PR for this frontend PR has been merged cla-signed hacktoberfest
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants