add unique_id to SMHI (#19183)
This commit is contained in:
parent
d1eb5da5f4
commit
c0cd2d48ec
1 changed files with 5 additions and 0 deletions
|
@ -96,6 +96,11 @@ class SmhiWeather(WeatherEntity):
|
||||||
self._fail_count = 0
|
self._fail_count = 0
|
||||||
self._smhi_api = Smhi(self._longitude, self._latitude, session=session)
|
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)
|
@Throttle(MIN_TIME_BETWEEN_UPDATES)
|
||||||
async def async_update(self) -> None:
|
async def async_update(self) -> None:
|
||||||
"""Refresh the forecast data from SMHI weather API."""
|
"""Refresh the forecast data from SMHI weather API."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue