Skip to content

Commit

Permalink
Merge pull request #123 from basilfx/feature/unique_id_string
Browse files Browse the repository at this point in the history
Ensure device identifier is a string
  • Loading branch information
basilfx authored May 14, 2024
2 parents 4f9aa30 + d8a20ab commit 934a5e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions custom_components/biketrax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ def __init__(
self.device = device

self._attrs: dict[str, Any] = {
"id": self.device.id,
"id": str(self.device.id),
"name": self.device.name,
}
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self.device.id)},
identifiers={(DOMAIN, str(self.device.id))},
model=device.name,
name=device.name,
)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/biketrax/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def __init__(
"""Initialize the tracker."""
super().__init__(coordinator, device)

self._attr_unique_id = device.id
self._attr_name = device.name
self._attr_unique_id = f"{device.id}-location"

@property
def battery_level(self) -> int | None:
Expand Down

0 comments on commit 934a5e4

Please sign in to comment.