Skip to content
Snippets Groups Projects
Unverified Commit 0300ef20 authored by Paulus Schoutsen's avatar Paulus Schoutsen Committed by GitHub
Browse files

Fix entity registry comments (#20357)

parent a396ee2c
Branches
Tags
No related merge requests found
......@@ -127,8 +127,8 @@ class EntityRegistry:
device_id=device_id,
# When we changed our slugify algorithm, we invalidated some
# stored entity IDs with either a __ or ending in _.
# Fix introduced in 0.86 (Jan 23, 2018). Next line can be
# removed when we release 1.0 or in 2019.
# Fix introduced in 0.86 (Jan 23, 2019). Next line can be
# removed when we release 1.0 or in 2020.
new_entity_id='.'.join(slugify(part) for part
in entity_id.split('.', 1)))
......
......@@ -240,6 +240,10 @@ async def test_loading_invalid_entity_id(hass, hass_storage):
'entity_id': 'test.invalid_end_',
'platform': 'super_platform',
'unique_id': 'id-invalid-end',
}, {
'entity_id': 'test._invalid_start',
'platform': 'super_platform',
'unique_id': 'id-invalid-start',
}
]
}
......@@ -256,3 +260,8 @@ async def test_loading_invalid_entity_id(hass, hass_storage):
'test', 'super_platform', 'id-invalid-end')
assert valid_entity_id(entity_invalid_end.entity_id)
entity_invalid_start = registry.async_get_or_create(
'test', 'super_platform', 'id-invalid-start')
assert valid_entity_id(entity_invalid_start.entity_id)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment