From 0cb468d7b0987733600bbc850a5e6a1538509784 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Thu, 19 Dec 2019 17:45:52 +0100 Subject: [PATCH] Make name of nmbs live sensor customizable via unique_id (#29662) * Make name customizable for nmbs live sensors * Change order of the live name * Added unique id to live nmbs sensor * Revert changing the name of the live sensor --- homeassistant/components/nmbs/sensor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/nmbs/sensor.py b/homeassistant/components/nmbs/sensor.py index 26802808c0a..35c928deb37 100644 --- a/homeassistant/components/nmbs/sensor.py +++ b/homeassistant/components/nmbs/sensor.py @@ -92,7 +92,7 @@ class NMBSLiveBoard(Entity): """Initialize the sensor for getting liveboard data.""" self._station = live_station self._api_client = api_client - + self._unique_id = f"nmbs_live_{self._station}" self._attrs = {} self._state = None @@ -101,6 +101,11 @@ class NMBSLiveBoard(Entity): """Return the sensor default name.""" return "NMBS Live" + @property + def unique_id(self): + """Return a unique ID.""" + return self._unique_id + @property def icon(self): """Return the default icon or an alert icon if delays."""