-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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 suggested_area to MQTT discovery #47903
Add suggested_area to MQTT discovery #47903
Conversation
This adds suggested_area to MQTT discovery, so that the discovered devices could be automatically added to the proper area.
Hi @RadekHvizdos, It seems you haven't yet signed a CLA. Please do so here. Once you do that we will be able to review and accept this pull request. Thanks! |
Hey there @emontnemery, mind taking a look at this pull request as its been labeled with an integration ( |
I really like this PR - maybe this suggestion is for a different PR - but I notice that entities can also be assigned to areas. They default to the area of the device but they can also be specifically assigned to a differnt area. Is assigning entity areas something that could be supported via mqtt discovery as well? |
tests/components/mqtt/test_sensor.py
Outdated
@@ -582,6 +582,7 @@ async def test_entity_device_info_with_hub(hass, mqtt_mock): | |||
identifiers={("mqtt", "hub-id")}, | |||
manufacturer="manufacturer", | |||
model="hub", | |||
suggested_area="default_area", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested_area="default_area", |
Remove this. Instead, add it to DEFAULT_CONFIG_DEVICE_INFO_ID
and DEFAULT_CONFIG_DEVICE_INFO_MAC
, and update test helpers help_test_entity_device_info_with_identifier
+ help_test_entity_device_info_with_connection
to make sure it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, the tests were adjusted accordingly.
Changes made as per feedback from @emontnemery
@PeteBa No, that's not possible as there's no concept of |
Thanks, @RadekHvizdos for a solid 1st PR 👍 |
Proposed change
This adds suggested_area to MQTT discovery, so that the discovered devices could be automatically added to the proper area.
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: