Skip to content

Commit

Permalink
add unique id
Browse files Browse the repository at this point in the history
  • Loading branch information
Digl authored Sep 8, 2021
1 parent bf70efe commit 4852f88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/wienerlinien/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(self, api, name, firstnext):
self._name = name
self._state = None
self.attributes = {}
self._unique_id = self._name

async def async_update(self):
"""Update data."""
Expand Down Expand Up @@ -105,6 +106,11 @@ def name(self):
"""Return name."""
return DEPARTURES[self.firstnext]["name"].format(self._name)

@property
def unique_id(self):
"""Return unique id."""
return self._unique_id

@property
def state(self):
"""Return state."""
Expand Down

0 comments on commit 4852f88

Please sign in to comment.