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 label support #69996

Closed
wants to merge 2 commits into from
Closed

Add label support #69996

wants to merge 2 commits into from

Conversation

frenck
Copy link
Member

@frenck frenck commented Apr 13, 2022

Proposed change

⚠️ Work in progress... and pretty much in POC state right now.


This PR adds label support to Home Assistant. Labels are similar to Areas.

Areas allow one to categorize devices and data points into physical locations matching your Home. Labels provide the non-physical categorization.

An item can only be in a single area at the time (as it can be in one physical location at the time); With labels, however, multiple can be assigned. Areas can be suggested by the integration/device, labels cannot. Areas have cards and physical room representations in terms of cards on Dashboards (room cards for example), labels have not as they have a different meaning.

Inspiration, at this point, comes from GitHub Labels:

CleanShot 2022-04-13 at 20 09 38

And from Material Design chips:

CleanShot 2022-04-13 at 20 15 03

CleanShot 2022-04-13 at 20 12 19

PS: The name "labels" is chosen instead of "tags". This is prevent naming conflicts/confusion with the existing "tags".

CleanShot 2023-11-04 at 17 47 29@2x

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

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

@probot-home-assistant

This comment was marked as resolved.

@Kane610
Copy link
Member

Kane610 commented Apr 13, 2022

You're on 🔥 !

@fjufju

This comment was marked as off-topic.

@frenck

This comment was marked as resolved.

@Mariusthvdb

This comment was marked as resolved.

@frenck

This comment was marked as resolved.

@frenck frenck force-pushed the frenck-2022-0869 branch from 6b7be04 to e2078f4 Compare April 16, 2022 18:54
@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the stale label May 16, 2022
@frenck

This comment was marked as outdated.

@github-actions github-actions bot removed the stale label May 16, 2022
@frenck frenck force-pushed the frenck-2022-0869 branch from 16c2352 to 5959029 Compare July 7, 2022 15:33
homeassistant/components/config/label_registry.py Outdated Show resolved Hide resolved
homeassistant/components/config/label_registry.py Outdated Show resolved Hide resolved
homeassistant/const.py Outdated Show resolved Hide resolved
Comment on lines +1036 to +1235
vol.Optional(ATTR_LABEL_ID): vol.Any(
ENTITY_MATCH_NONE, vol.All(ensure_list, [vol.Any(dynamic_template, str)])
),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, this will be awesome! 🚀 🎉

homeassistant/helpers/device_registry.py Outdated Show resolved Hide resolved
homeassistant/helpers/label_registry.py Outdated Show resolved Hide resolved
homeassistant/helpers/label_registry.py Outdated Show resolved Hide resolved
homeassistant/helpers/label_registry.py Show resolved Hide resolved
homeassistant/helpers/service.py Outdated Show resolved Hide resolved
tests/common.py Outdated Show resolved Hide resolved
@emontnemery

This comment was marked as resolved.

@frenck

This comment was marked as outdated.

@frenck

This comment was marked as resolved.

@frenck frenck force-pushed the frenck-2022-0869 branch 2 times, most recently from d7c42a7 to b2f0cdd Compare September 17, 2022 10:56
@Misiu Misiu mentioned this pull request Nov 28, 2022
@bendavis78

This comment was marked as off-topic.

@roger-

This comment was marked as off-topic.

@frenck frenck force-pushed the frenck-2022-0869 branch 2 times, most recently from 04eb18b to e3b5548 Compare May 25, 2023 06:05
@johntdyer

This comment was marked as off-topic.

@johntdyer
Copy link
Contributor

@frenck any plans to pick this PR up after summer ? Not that I am qualified but if there is any scut work I can do to help facilitate it I would be more then happy to volunteer

@frenck
Copy link
Member Author

frenck commented Jul 15, 2023

@johntdyer There is nothing to pick up on on this PR. The ball is currently in the part of the UX team.

../Frenck

@github-actions

This comment was marked as resolved.

@github-actions github-actions bot added the stale label Oct 13, 2023
@frenck frenck added no-stale and removed stale labels Nov 1, 2023
@frenck
Copy link
Member Author

frenck commented Nov 3, 2023

Squashed all commits, to make it easier to get this thing rebased onto the latest dev

@t3hk0d3

This comment was marked as off-topic.

Add label support to device registry

Add label support to entity registry

Add support for calling services by labels

Rebase fixes, test fixes, linter fixes, catch up

Ran black

Update test snapshosts

Update snapshots for renault

Register API

Fix entity registry tests

Set up registry in bootstrap

Add labels to partial dict

Add support to Syrupy for test snapshotting

Adjust more tests

Adjust version in comment

Update snapshots

Add template methods
@masi

This comment was marked as off-topic.

@bendikrb

This comment was marked as resolved.

@masi

This comment was marked as resolved.

@frenck
Copy link
Member Author

frenck commented Feb 16, 2024

Closing this one, splitting it up in multiple smaller PRs

@frenck frenck closed this Feb 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 17, 2024
@frenck frenck deleted the frenck-2022-0869 branch December 24, 2024 08:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Status: Cancelled
Development

Successfully merging this pull request may close these issues.