Prevent partial custom component overlays#21070
Merged
Merged
Conversation
pvizeli
approved these changes
Feb 21, 2019
thibmaek
added a commit
to thibmaek/home-assistant
that referenced
this pull request
Feb 21, 2019
* upstream/dev: (948 commits) Prevent partial custom component overlays (home-assistant#21070) Alarm trigger support for Point (home-assistant#21207) Upgrade opensensemap-api to 0.1.4 (home-assistant#21240) Remove constraint from regex (home-assistant#21239) Updated frontend to 20190220.0 Support OpenWRT 18.06 in luci device tracker (home-assistant#21236) Bump zigpy (home-assistant#21203) Fix bug in ZHA and tweak non sensor channel logic (home-assistant#21234) Don't dispatch to components when there are no channels for ZHA sensors (home-assistant#21223) Add zone and reps for Xiaomi vacuum (home-assistant#19777) Fix an Ambient PWS exception when location info is missing (home-assistant#21220) Add self to integration sensor and utility_meter (home-assistant#21226) Prevent invalid context from crashing (home-assistant#21231) Update pyhomematic to 0.1.56 (home-assistant#21227) Fix the build (home-assistant#21229) Updated frontend to 20190219.0 Add yeelight flow action support (home-assistant#21195) Refactor ZHA listeners into channels (home-assistant#21196) Fix Homematic IP Cloud configuration (home-assistant#21202) Push pyads to 3.0.7 (home-assistant#21216) ...
9 tasks
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This will force platforms to be resolved based off the component path, if it exists.
Today, if you want, you can override the Hue light platform, but not the other parts of the Hue integration. If a future update evolves the Hue component, removing or changing internal methods that the custom platform relied upon, the custom platform will start failing (like this report).
To avoid this, we're going to no longer allow custom components to be partial overlays (just a platform). Instead, if you want to override a built-in platform, you will need to override the whole component.
This is enforced by first resolving the platform as a component, and if it exists, limiting the lookup path to the component path.
Example: if I look up the
huecomponent, and it is provided by a custom component, then all platform lookups will also be looked up in the custom component dir. The same works the other way around, if a user would only try to overridehue/light.pybut nothue/__init__.py, the custom platform will be ignored.Breaking change: Custom platforms that override a built-in platform that has a component, should now also include the component in the
custom_components/folder. So if you want to overridehue/light.pywith a custom version, you will also need to provide/copy overhue/__init__.py.Related issue (if applicable): fixes home-assistant/architecture#141
Checklist:
tox. Your PR cannot be merged unless tests passIf the code does not interact with devices: