Skip to content

Commit

Permalink
Merge pull request #9 from si458/unique-entity-id
Browse files Browse the repository at this point in the history
add entity id for uniqueness
  • Loading branch information
jampez77 committed Jan 10, 2024
2 parents 3ad2860 + c6394cc commit 798b668
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions custom_components/dvla/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def __init__(
configuration_url="https://github.com/jampez77/DVLA-Vehicle-Checker/",
)
self._attr_unique_id = f"{DOMAIN}-{name}-{description.key}-binary".lower()
self.entity_id = f"binary_sensor.{DOMAIN}_{name}_{description.key}".lower()
self.attrs: dict[str, Any] = {}
self.entity_description = description

Expand Down
1 change: 1 addition & 0 deletions custom_components/dvla/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ def __init__(
configuration_url="https://github.com/jampez77/DVLA-Vehicle-Checker/",
)
self._attr_unique_id = f"{DOMAIN}-{name}-{description.key}".lower()
self.entity_id = f"sensor.{DOMAIN}_{name}_{description.key}".lower()
self.attrs: dict[str, Any] = {}
self.entity_description = description

Expand Down

0 comments on commit 798b668

Please sign in to comment.