Skip to content

Remove lamps and groups from ha when removed from Hue#26881

Merged
balloob merged 5 commits into
devfrom
hue-improv
Sep 25, 2019
Merged

Remove lamps and groups from ha when removed from Hue#26881
balloob merged 5 commits into
devfrom
hue-improv

Conversation

@bramkragten
Copy link
Copy Markdown
Member

@bramkragten bramkragten commented Sep 24, 2019

Description:

This PR removes lamps and groups that are removed in Hue.

  • add tests.

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

Comment thread homeassistant/components/hue/light.py Outdated
Comment thread homeassistant/components/hue/light.py Outdated
Comment thread homeassistant/helpers/device_registry.py
Comment thread homeassistant/components/hue/light.py Outdated
Copy link
Copy Markdown
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.

ok with tests !

dev_registry.async_update_device(
device.id, remove_config_entry_id=config_entry.entry_id
)
if item_id in api:
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.

Is this code that needs to be generalized for sensors (in a future PR) ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, probably

@bramkragten
Copy link
Copy Markdown
Member Author

Why is lint failing on xiaomi_aqara? Have not touched that code. And black fails? Did run black...

@balloob
Copy link
Copy Markdown
Member

balloob commented Sep 25, 2019

Rebase

@balloob balloob merged commit b75639d into dev Sep 25, 2019
@delete-merged-branch delete-merged-branch Bot deleted the hue-improv branch September 25, 2019 21:00
@lock lock Bot locked and limited conversation to collaborators Sep 26, 2019
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.

3 participants