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

Bump bring-api to 0.5.4 #111654

Merged
merged 3 commits into from
Mar 4, 2024
Merged

Bump bring-api to 0.5.4 #111654

merged 3 commits into from
Mar 4, 2024

Conversation

tr4nt0r
Copy link
Contributor

@tr4nt0r tr4nt0r commented Feb 27, 2024

Proposed change

Version 0.5.3 adds a new method that allows it to interact with the Bring API in the same way as the mobile apps and therefore it is now possible to use the uuid of items as unique identifiers (API Endpoints used by the webApp did not expose the item uuid). This allows it do add multiple items with the same name but different descriptions (specifications), an issue that a user tried to fix in this PR:

Additionally the bring-api is now packaged with translation tables. The translation tables that are used by the webApp and were downloaded in the bring-api library before, but are outdated and differ slightly from the translation tables used in the mobile apps.

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

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

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.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @miaucl, mind taking a look at this pull request as it has been labeled with an integration (bring) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of bring can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign bring Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

@Jhonattan-Souza
Copy link

Hi @tr4nt0r , will this solve the issue that my items inside home assistant shows a german name for items, and inside my app is my mother language pt-br ?

@miaucl
Copy link
Contributor

miaucl commented Feb 28, 2024

Hi @tr4nt0r , will this solve the issue that my items inside home assistant shows a german name for items, and inside my app is my mother language pt-br ?

Have a look here: home-assistant/home-assistant.io#31655

Copy link
Contributor

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Please fix the mypy issues

@home-assistant home-assistant bot marked this pull request as draft February 28, 2024 10:19
@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.

@tr4nt0r
Copy link
Contributor Author

tr4nt0r commented Feb 28, 2024

Please fix the mypy issues

will do, already on it 👍🏽

@tr4nt0r tr4nt0r changed the title Bump bring-api to 0.5.2 Bump bring-api to 0.5.3 Feb 28, 2024
@tr4nt0r tr4nt0r marked this pull request as ready for review February 28, 2024 12:32
@home-assistant home-assistant bot requested a review from edenhaus February 28, 2024 12:32
@edenhaus
Copy link
Contributor

Additionally the bring-api is now packaged with translation tables. The translation tables that are used by the webApp and were downloaded in the bring-api library before, are outdated and differ slightly from the translation tables used in the mobile apps.

Is this a breaking change for the users?

Copy link
Contributor

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Your library is doing IO inside an async function, which will block the event loop.
Please run IO code in the executor and not in the event loop.

Code: miaucl/bring-api@0.4.1...0.5.3#diff-7e622e3310

@home-assistant home-assistant bot marked this pull request as draft February 28, 2024 13:08
@tr4nt0r
Copy link
Contributor Author

tr4nt0r commented Feb 28, 2024

Additionally the bring-api is now packaged with translation tables. The translation tables that are used by the webApp and were downloaded in the bring-api library before, are outdated and differ slightly from the translation tables used in the mobile apps.

Is this a breaking change for the users?

This is a follow-up to this issue:
#110571

But as #111149 hasn't been shipped to the user either, i would definitely say no.

@miaucl
Copy link
Contributor

miaucl commented Feb 28, 2024

Your library is doing IO inside an async function, which will block the event loop. Please run IO code in the executor and not in the event loop.

Code: miaucl/bring-api@0.4.1...0.5.3#diff-7e622e3310

@edenhaus Please explain, what do you mean with IO? Api exchange is performed using aiohttp and should be non-blocking.

@tr4nt0r
Copy link
Contributor Author

tr4nt0r commented Feb 28, 2024

Your library is doing IO inside an async function, which will block the event loop. Please run IO code in the executor and not in the event loop.

Code: miaucl/bring-api@0.4.1...0.5.3#diff-7e622e3310

@edenhaus Sorry, I'm pretty new to python development. I rewrote the IO part to be executed with run_in_executor. Hope that is what you meant:
miaucl/bring-api@main...run_in_executor

@edenhaus
Copy link
Contributor

File operations are also blocking and the link points to a location, where the localization file is open and read.

@tr4nt0r No problem :) I'm here to review and we can solve the issues together :)
Everyone is new to something :)

@tr4nt0r
Copy link
Contributor Author

tr4nt0r commented Feb 28, 2024

File operations are also blocking and the link points to a location, where the localization file is open and read.

@tr4nt0r No problem :) I'm here to review and we can solve the issues together :) Everyone is new to something :)

Ooooh, the file handler hast to be closed 🤦‍♂️

@edenhaus
Copy link
Contributor

miaucl/bring-api@main...run_in_executor

The changes looks good. Please bump the api to a version, where the fix included. Afterwards please click "ready to review"

@tr4nt0r
Copy link
Contributor Author

tr4nt0r commented Feb 28, 2024

File operations are also blocking and the link points to a location, where the localization file is open and read.
@tr4nt0r No problem :) I'm here to review and we can solve the issues together :) Everyone is new to something :)

Ooooh, the file handler hast to be closed 🤦‍♂️

no, sorry, it doesn't have to, the with-statement does it already :D

@tr4nt0r tr4nt0r changed the title Bump bring-api to 0.5.3 Bump bring-api to 0.5.4 Feb 28, 2024
@tr4nt0r tr4nt0r marked this pull request as ready for review February 28, 2024 18:01
@home-assistant home-assistant bot requested a review from edenhaus February 28, 2024 18:01
Copy link
Contributor

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Thanks @tr4nt0r 👍

@edenhaus edenhaus merged commit 34d25cf into home-assistant:dev Mar 4, 2024
53 checks passed
@edenhaus edenhaus added this to the 2024.3.0 milestone Mar 4, 2024
balloob pushed a commit that referenced this pull request Mar 4, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 5, 2024
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.

5 participants