Skip to content

Commit

Permalink
add unique_id to SMHI (#19183)
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrike authored and fabaff committed Dec 12, 2018
1 parent d1eb5da commit c0cd2d4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions homeassistant/components/weather/smhi.py
Expand Up @@ -96,6 +96,11 @@ def __init__(self, name: str, latitude: str,
self._fail_count = 0
self._smhi_api = Smhi(self._longitude, self._latitude, session=session)

@property
def unique_id(self) -> str:
"""Return a unique id."""
return '{}, {}'.format(self._latitude, self._longitude)

@Throttle(MIN_TIME_BETWEEN_UPDATES)
async def async_update(self) -> None:
"""Refresh the forecast data from SMHI weather API."""
Expand Down

0 comments on commit c0cd2d4

Please sign in to comment.