mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
add unique_id to SMHI (#19183)
This commit is contained in:
parent
d1eb5da5f4
commit
c0cd2d48ec
@ -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…
x
Reference in New Issue
Block a user