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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add unique IDs to automation/scenes #31150

Merged
merged 2 commits into from
Jan 27, 2020
Merged

Add unique IDs to automation/scenes #31150

merged 2 commits into from
Jan 27, 2020

Conversation

balloob
Copy link
Member

@balloob balloob commented Jan 25, 2020

Breaking change

Proposed change

Use the ID that the UI writes for scenes/automations /scripts to as the unique ID. Allows changing the entity ID.

When removed via the UI, remove also from entity registry.

I've removed scripts from this PR as it requires a more elaborate approach because of the way they are configured.

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

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (automation) you are listed as a codeowner for? Thanks!

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (homeassistant) you are listed as a codeowner for? Thanks!

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (script) you are listed as a codeowner for? Thanks!

@probot-home-assistant
Copy link

Hey there @home-assistant/core, mind taking a look at this pull request as its been labeled with a integration (config) you are listed as a codeowner for? Thanks!

@balloob balloob changed the title Add unique IDs to scripts/automation/scenes Add unique IDs to automation/scenes Jan 25, 2020
@MartinHjelmare
Copy link
Member

MartinHjelmare commented Jan 25, 2020

Not really related but this looks like a typo and possibly a bug:
https://github.com/home-assistant/home-assistant/blob/e4832ee4d05d7274b7faf64358894ee1e23ce373/homeassistant/components/scene/__init__.py#L64-L66

I was browsing the scene code and came across that.

@MartinHjelmare MartinHjelmare moved this from Needs review to Review in progress in Dev Jan 25, 2020
@balloob
Copy link
Member Author

balloob commented Jan 26, 2020

Fixed that. That config was never used, but I guess also never validated 馃し鈥嶁檪 Added a quick test to verify it all works.

Dev automation moved this from Review in progress to Reviewer approved Jan 26, 2020
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.

Looks good!

@balloob balloob merged commit 1f0f62d into dev Jan 27, 2020
Dev automation moved this from Reviewer approved to Done Jan 27, 2020
@delete-merged-branch delete-merged-branch bot deleted the unique-ids branch January 27, 2020 07:01
@lock lock bot locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants