add unique_id to SMHI (#19183)

This commit is contained in:
Fredrik Erlandsson 2018-12-12 09:29:45 +01:00 committed by Fabian Affolter
parent d1eb5da5f4
commit c0cd2d48ec

View file

@ -96,6 +96,11 @@ class SmhiWeather(WeatherEntity):
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."""