-
-
Notifications
You must be signed in to change notification settings - Fork 31k
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
Change naming of MQTT entities to correspond with HA guidelines #95159
Merged
Conversation
This file contains 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
home-assistant
bot
added
cla-signed
core
has-tests
integration: mqtt
new-feature
labels
Jun 24, 2023
Hey there @emontnemery, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
jbouwh
changed the title
Set use device_name over default name set on MQTT entities
Use device_name over default name set on MQTT entities
Jun 24, 2023
jbouwh
changed the title
Use device_name over default name set on MQTT entities
Use device_name over default name on MQTT entities
Jun 24, 2023
8 tasks
jbouwh
force-pushed
the
mqtt-default-entity-name
branch
from
June 27, 2023 13:18
4a6b0f1
to
499c3d2
Compare
emontnemery
reviewed
Jun 28, 2023
jbouwh
changed the title
Use device_name over default name on MQTT entities
Use device_name over default name on MQTT entities or rename after device_class
Jun 28, 2023
jbouwh
commented
Jun 30, 2023
jbouwh
commented
Jun 30, 2023
jbouwh
force-pushed
the
mqtt-default-entity-name
branch
from
June 30, 2023 22:45
57aa0b7
to
87f2d7a
Compare
jbouwh
commented
Jul 3, 2023
jbouwh
force-pushed
the
mqtt-default-entity-name
branch
from
July 20, 2023 11:29
762f8d9
to
974a63e
Compare
emontnemery
requested changes
Jul 21, 2023
jbouwh
changed the title
Change naming of MQTT entities to better correspond with HA guidelines
Change naming of MQTT entities to correspond with HA guidelines
Jul 21, 2023
5 tasks
emontnemery
approved these changes
Jul 21, 2023
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 @jbouwh 👍
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
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
The way MQTT entities are named and how device configuration can be shared between discovered entities has changed
Sharing of device configuration
Discovered MQTT entities can share device configuration, meaning one entity can include the full device configuration and other entities can link to that device by only setting mandatory fields.
The mandatory fields were previously limited to at least one of
connection
andidentifiers
, but has now been extended to at least one ofconnection
andidentifiers
as well as thename
.Naming of MQTT entities
Naming of MQTT entities has been changed to be aligned with the entity naming guidelines:
has_entity_name
entity will be set toTrue
on all MQTT entitiesfriendly_name
attribute prefixed with the device namebinary_sensor
,button
,number
andsensor
entities will now be named by their device class instead of being named "MQTT binary sensor" etc.None
to mark it as the main feature of a deviceProposed change
Change naming of MQTT entities to better correspond with the current guidelines in https://developers.home-assistant.io/docs/core/entity/#entity-naming
Always set the
has_entity_name
attribute on MQTT entities toTrue
.If a
device_class
is set and the entityname
is not set, it follows the device class name.The changed behavior for the generation the default
entity_id
is documented in the linked docs PR.The
name
and in MQTT entity can now also explicitly be set toNone
(ornull
in a JSON discovery payload).This will avoid inherit the device name as friendly name.
Link blog post PR: home-assistant/developers.home-assistant#1851
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
.To help with the load of incoming pull requests: