Move manual configuration of MQTT fan and light to the integration key#71676
Merged
emontnemery merged 31 commits intoMay 19, 2022
Merged
Conversation
|
Hey there @emontnemery, mind taking a look at this pull request as it has been labeled with an integration ( |
emontnemery
reviewed
May 11, 2022
386bf37 to
41963ef
Compare
emontnemery
reviewed
May 11, 2022
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
emontnemery
reviewed
May 16, 2022
emontnemery
reviewed
May 16, 2022
emontnemery
reviewed
May 17, 2022
22 tasks
emontnemery
approved these changes
May 18, 2022
Contributor
emontnemery
left a comment
There was a problem hiding this comment.
I think this is a good change, I'd like a 2nd opinion though just in case I miss something.
emontnemery
reviewed
May 19, 2022
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
MartinHjelmare
approved these changes
May 19, 2022
Member
|
We'll have time to move all platforms before beta cut next week? |
Contributor
Author
Sure. As soon as this is merged i'll submit PR's for all remaining platforms. There are already prepared :-) |
Member
|
Oh, merged. Alright that's good too I guess 😞 |
This was referenced May 19, 2022
0bmay
pushed a commit
to 0bmay/home-assistant-core
that referenced
this pull request
May 19, 2022
home-assistant#71676) * Processing yaml config through entry setup * Setup all platforms * Update homeassistant/components/mqtt/__init__.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * adjust mock_mqtt - reference config from cache * Fix test config entry override * Add tests yaml setup * additional tests * Introduce PLATFORM_SCHEMA_MODERN * recover temporary MQTT_BASE_PLATFORM_SCHEMA * Allow extra key in light base schema, restore test * Fix test for exception on platform key * One deprecation message per platform * Remove deprecation checks from modern schema * Update homeassistant/components/mqtt/fan.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/mqtt/fan.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/mqtt/light/__init__.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/mqtt/light/__init__.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/mqtt/light/schema_json.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/mqtt/light/schema_template.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Update homeassistant/components/mqtt/mixins.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * rename validate_modern_schema * Do not fail platform if a single config is broken * Update homeassistant/components/mqtt/__init__.py Co-authored-by: Erik Montnemery <erik@montnemery.com> * Fix tests on asserting log * Update log. Make helper transparant, remove patch * Perform parallel processing * Update tests/components/mqtt/test_init.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Apply suggestions from code review Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update homeassistant/components/mqtt/mixins.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * black * Fix tests and add #new_format anchor Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Erik Montnemery <erik@montnemery.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Breaking change
Defining manually configured MQTT entities directly under the respective platform keys (e.g.
fan,light) is deprecated and support will be removed in Home Assistant Core 2022.9.Manually configured MQTT entities should now be defined under the
mqttkey inconfiguration.yamlinstead of under the platform key.As an example, this is now deprecated:
The configuration needs to updated to this format:
Proposed change
Setup MQTT yaml configured entities through config entry setup.
The PR will deprecate setting up MQTT entities using the following form:
New manual configured MQTT entities need to be setup in the following form:
The platform schema will stay the same, but the
platformconfiguration item should not be configured.The current PR (PoC) implements the platforms:
lightfanA single test
test_setup_manual_entity_from_yamlis added for each platform. A helperhelp_test_setup_manual_entity_from_yamlis added to make it easy to add a tests for the additional platform.TODO (in follow-up PRs):
The background for this PR is that the MQTT integration itself is setup via a config entry, with entities setup via discovery.
MQTT entities can also be setup through
configuration.yamlthough, and those entities are not aware of the MQTT config entry and thus are not removed if the MQTT config entry is disabled or removed.Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: