Skip to content

Make Store a generic class#74617

Merged
frenck merged 15 commits into
home-assistant:devfrom
epenet:make-store-generic
Jul 9, 2022
Merged

Make Store a generic class#74617
frenck merged 15 commits into
home-assistant:devfrom
epenet:make-store-generic

Conversation

@epenet
Copy link
Copy Markdown
Contributor

@epenet epenet commented Jul 7, 2022

Proposed change

Make Store a generic
As discussed with @MartinHjelmare in #74603 (comment)

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
  • The code has been formatted using Black (black --fast 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.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@epenet epenet requested a review from a team as a code owner July 7, 2022 12:23
@probot-home-assistant probot-home-assistant Bot added code-quality core small-pr PRs with less than 30 lines. labels Jul 7, 2022
@epenet epenet mentioned this pull request Jul 7, 2022
23 tasks
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Jul 7, 2022
Comment thread homeassistant/helpers/area_registry.py Outdated

if isinstance(data, dict):
for area in data["areas"]:
assert area["name"] is not None and area["id"] is not None
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe make a TypedDict for data?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

area["id"] could still be None so I'm not sure it would help a great deal in this case.

@MartinHjelmare
Copy link
Copy Markdown
Member

MartinHjelmare commented Jul 7, 2022

Are there more things to update than the 20 errors found by CI?

@epenet epenet force-pushed the make-store-generic branch from 36ab1cf to bd43bc5 Compare July 7, 2022 13:31
Comment thread homeassistant/helpers/storage.py Outdated
@epenet epenet requested review from Jc2k and bdraco as code owners July 7, 2022 13:54
@epenet epenet removed the small-pr PRs with less than 30 lines. label Jul 7, 2022
@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Jul 7, 2022

Are there more things to update than the 20 errors found by CI?

I think that's it. It looked daunting but I think it works... 👍

Comment thread homeassistant/auth/auth_store.py Outdated
@MartinHjelmare
Copy link
Copy Markdown
Member

Should we highlight this in a dev blog?

@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Jul 7, 2022

PR for dev blog: home-assistant/developers.home-assistant#1386

@epenet epenet changed the title Make Store a generic Make Store a generic class Jul 7, 2022
@epenet epenet force-pushed the make-store-generic branch from 5d3fd14 to 8b4cce6 Compare July 8, 2022 08:18
@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Jul 8, 2022

Rebased to pickup new integration: #74243

Copy link
Copy Markdown
Contributor

@allenporter allenporter left a comment

Choose a reason for hiding this comment

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

Looks good for nest. Thank you, this makes Store a lot more usable to me!

Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Nice!

@frenck frenck merged commit 16900dc into home-assistant:dev Jul 9, 2022
@epenet epenet deleted the make-store-generic branch July 9, 2022 20:36
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed code-quality core smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants