mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Do not show an empty component name on MQTT device subentries not as None
if it is not set (#144792)
This commit is contained in:
parent
053e5417a7
commit
71108d9ca0
@ -2168,7 +2168,7 @@ class MQTTSubentryFlowHandler(ConfigSubentryFlow):
|
|||||||
entities = [
|
entities = [
|
||||||
SelectOptionDict(
|
SelectOptionDict(
|
||||||
value=key,
|
value=key,
|
||||||
label=f"{device_name} {component_data.get(CONF_NAME, '-')}"
|
label=f"{device_name} {component_data.get(CONF_NAME, '-') or '-'}"
|
||||||
f" ({component_data[CONF_PLATFORM]})",
|
f" ({component_data[CONF_PLATFORM]})",
|
||||||
)
|
)
|
||||||
for key, component_data in self._subentry_data["components"].items()
|
for key, component_data in self._subentry_data["components"].items()
|
||||||
@ -2400,7 +2400,8 @@ class MQTTSubentryFlowHandler(ConfigSubentryFlow):
|
|||||||
self._component_id = None
|
self._component_id = None
|
||||||
mqtt_device = self._subentry_data[CONF_DEVICE][CONF_NAME]
|
mqtt_device = self._subentry_data[CONF_DEVICE][CONF_NAME]
|
||||||
mqtt_items = ", ".join(
|
mqtt_items = ", ".join(
|
||||||
f"{mqtt_device} {component_data.get(CONF_NAME, '-')} ({component_data[CONF_PLATFORM]})"
|
f"{mqtt_device} {component_data.get(CONF_NAME, '-') or '-'} "
|
||||||
|
f"({component_data[CONF_PLATFORM]})"
|
||||||
for component_data in self._subentry_data["components"].values()
|
for component_data in self._subentry_data["components"].values()
|
||||||
)
|
)
|
||||||
menu_options = [
|
menu_options = [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user