Change naming of MQTT entities to correspond with HA guidelines (#95159)
* Set has_entity_name if device_name is set * revert unneeded formatting change * Add image platform * Follow up comment * Don't set `has_entity_name` without device name * Only set has_entity_name if a valid name is set * Follow device_class name and add tests * Follow up comments add extra tests * Move to helper - Log a warning * fix test * Allow to assign None as name explictly * Refactor * Log info messages when device name is not set * Revert scene schema change - no device link * Always set has_entity_name with device mapping * Always set `_attr_has_entity_name` * Cleanup
This commit is contained in:
parent
747f4d4a73
commit
447fbf58c9
36 changed files with 433 additions and 66 deletions
|
@ -54,7 +54,7 @@ MQTT_SELECT_ATTRIBUTES_BLOCKED = frozenset(
|
|||
PLATFORM_SCHEMA_MODERN = MQTT_RW_SCHEMA.extend(
|
||||
{
|
||||
vol.Optional(CONF_COMMAND_TEMPLATE): cv.template,
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Optional(CONF_NAME): vol.Any(cv.string, None),
|
||||
vol.Required(CONF_OPTIONS): cv.ensure_list,
|
||||
vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
|
||||
},
|
||||
|
@ -89,6 +89,7 @@ async def _async_setup_entity(
|
|||
class MqttSelect(MqttEntity, SelectEntity, RestoreEntity):
|
||||
"""representation of an MQTT select."""
|
||||
|
||||
_default_name = DEFAULT_NAME
|
||||
_entity_id_format = select.ENTITY_ID_FORMAT
|
||||
_attributes_extra_blocked = MQTT_SELECT_ATTRIBUTES_BLOCKED
|
||||
_command_template: Callable[[PublishPayloadType], PublishPayloadType]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue