From c0cd2d48ece830bef0cf457e07e70c562837348e Mon Sep 17 00:00:00 2001 From: Fredrik Erlandsson Date: Wed, 12 Dec 2018 09:29:45 +0100 Subject: [PATCH] add unique_id to SMHI (#19183) --- homeassistant/components/weather/smhi.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/weather/smhi.py b/homeassistant/components/weather/smhi.py index c686b5c90e9..94873b03bd6 100644 --- a/homeassistant/components/weather/smhi.py +++ b/homeassistant/components/weather/smhi.py @@ -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."""