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 area id to entity registry #42221

Merged
merged 11 commits into from
Oct 24, 2020
Merged

Conversation

Kane610
Copy link
Member

@Kane610 Kane610 commented Oct 22, 2020

Breaking change

Proposed change

Support adding area id to entity entries. Update service helper support and search integration to find entities in area.

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)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

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

@Kane610
Copy link
Member Author

Kane610 commented Oct 22, 2020

@balloob @bramkragten should we expose the device area id per entity as well or should that be a frontend thing?

@MartinHjelmare MartinHjelmare changed the title Rough draft Rough draft: Add area id to entity registry Oct 22, 2020
@Kane610 Kane610 marked this pull request as ready for review October 22, 2020 20:40
@Kane610 Kane610 changed the title Rough draft: Add area id to entity registry Add area id to entity registry Oct 22, 2020
Copy link
Member

@balloob balloob left a comment

Choose a reason for hiding this comment

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

🎉 Looking good.

@bramkragten do you think that this is good to go? We can always extend APIs later if we need to.

@bramkragten
Copy link
Member

Yes, I think this will work

Copy link
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

We should avoid using the word entity for entity entries in the entity registry.

homeassistant/helpers/entity_registry.py Outdated Show resolved Hide resolved
homeassistant/components/search/__init__.py Outdated Show resolved Hide resolved
@balloob
Copy link
Member

balloob commented Oct 24, 2020

Can be merged once Martin's comments addressed! 🎉

Kane610 and others added 2 commits October 24, 2020 16:24
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@Kane610
Copy link
Member Author

Kane610 commented Oct 24, 2020

Thanks everyone 🎉

homeassistant/helpers/service.py Outdated Show resolved Hide resolved
homeassistant/helpers/service.py Outdated Show resolved Hide resolved
homeassistant/helpers/service.py Outdated Show resolved Hide resolved
homeassistant/helpers/service.py Outdated Show resolved Hide resolved
homeassistant/helpers/service.py Outdated Show resolved Hide resolved
@balloob balloob merged commit e06c800 into home-assistant:dev Oct 24, 2020
@Kane610
Copy link
Member Author

Kane610 commented Oct 24, 2020

thanks @MartinHjelmare

@Kane610 Kane610 deleted the areas_entity_support branch October 24, 2020 21:00
@SukramJ SukramJ mentioned this pull request Oct 25, 2020
21 tasks
rajlaud pushed a commit to rajlaud/home-assistant that referenced this pull request Oct 28, 2020
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
@Fruchuxs
Copy link

If I request the state of an entity, the API didn't exposed the area id.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Mar 10, 2021
@Kane610
Copy link
Member Author

Kane610 commented Mar 11, 2021

The Entity registry is not part of the state machine.

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.

6 participants