mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Expect devices to have no name
This commit is contained in:
parent
2fa4e2e468
commit
7f7c403e00
@ -153,11 +153,12 @@ def platform_devices_from_config(config, domain, hass,
|
||||
no_name_count = 0
|
||||
|
||||
for device in devices:
|
||||
name = device.name
|
||||
# Get the name or set to default if none given
|
||||
name = device.name or DEVICE_DEFAULT_NAME
|
||||
|
||||
if name == DEVICE_DEFAULT_NAME:
|
||||
no_name_count += 1
|
||||
name = "{} #{}".format(domain, no_name_count)
|
||||
name = "{} {}".format(domain, no_name_count)
|
||||
|
||||
entity_id = ensure_unique_string(
|
||||
entity_id_format.format(slugify(name)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user