Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
HomeAssistant
Core
Commits
0300ef20
Unverified
Commit
0300ef20
authored
6 years ago
by
Paulus Schoutsen
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix entity registry comments (#20357)
parent
a396ee2c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
homeassistant/helpers/entity_registry.py
+2
-2
2 additions, 2 deletions
homeassistant/helpers/entity_registry.py
tests/helpers/test_entity_registry.py
+9
-0
9 additions, 0 deletions
tests/helpers/test_entity_registry.py
with
11 additions
and
2 deletions
homeassistant/helpers/entity_registry.py
+
2
−
2
View file @
0300ef20
...
@@ -127,8 +127,8 @@ class EntityRegistry:
...
@@ -127,8 +127,8 @@ class EntityRegistry:
device_id
=
device_id
,
device_id
=
device_id
,
# When we changed our slugify algorithm, we invalidated some
# When we changed our slugify algorithm, we invalidated some
# stored entity IDs with either a __ or ending in _.
# stored entity IDs with either a __ or ending in _.
# Fix introduced in 0.86 (Jan 23, 201
8
). Next line can be
# Fix introduced in 0.86 (Jan 23, 201
9
). Next line can be
# removed when we release 1.0 or in 20
19
.
# removed when we release 1.0 or in 20
20
.
new_entity_id
=
'
.
'
.
join
(
slugify
(
part
)
for
part
new_entity_id
=
'
.
'
.
join
(
slugify
(
part
)
for
part
in
entity_id
.
split
(
'
.
'
,
1
)))
in
entity_id
.
split
(
'
.
'
,
1
)))
...
...
This diff is collapsed.
Click to expand it.
tests/helpers/test_entity_registry.py
+
9
−
0
View file @
0300ef20
...
@@ -240,6 +240,10 @@ async def test_loading_invalid_entity_id(hass, hass_storage):
...
@@ -240,6 +240,10 @@ async def test_loading_invalid_entity_id(hass, hass_storage):
'
entity_id
'
:
'
test.invalid_end_
'
,
'
entity_id
'
:
'
test.invalid_end_
'
,
'
platform
'
:
'
super_platform
'
,
'
platform
'
:
'
super_platform
'
,
'
unique_id
'
:
'
id-invalid-end
'
,
'
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):
...
@@ -256,3 +260,8 @@ async def test_loading_invalid_entity_id(hass, hass_storage):
'
test
'
,
'
super_platform
'
,
'
id-invalid-end
'
)
'
test
'
,
'
super_platform
'
,
'
id-invalid-end
'
)
assert
valid_entity_id
(
entity_invalid_end
.
entity_id
)
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment