Default device name to config entry title#95547
Conversation
|
(first time reviewing core stuff, don't know all the details yet) In the previous PR you were questioning if devices should be allowed to have no name.
Not sure if these are viable options, but I think they sound more logical. In any way, wouldn't a log message be useful to let people know they are running an integration with a device without a name? (Same way like we now have with |
|
Removing this from the milestone as it needs updates to a lot of integrations. @joostlek entity platform is where an entity is added to the device registry. It seems like the right place to enforce defaults and it's already responsible for others too. |
| "default_name" not in processed_dev_info | ||
| and not processed_dev_info.get("name") | ||
| ): | ||
| processed_dev_info["name"] = self.config_entry.title |
There was a problem hiding this comment.
What if the title is an empty string? Do we need a default for that?
There was a problem hiding this comment.
Yes, it shouldn't be allowed. The goal is that we always have a device name.
There was a problem hiding this comment.
Is it an idea to only require this when has_entity_name is True?
3952fd4 to
592e297
Compare
Breaking change
Proposed change
If no device name is given, we default the name of the device to the config entry title. This is ignored if a default name is given. That way we always have a device name.
Replaces #95485
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: