From e59d259379c49ef412abadb4caafdefb37a35930 Mon Sep 17 00:00:00 2001 From: deler Date: Thu, 16 Nov 2023 19:17:18 +0100 Subject: [PATCH] Remove random from unique_id --- custom_components/fuel_prices_sweden/const.py | 2 +- custom_components/fuel_prices_sweden/sensor.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/custom_components/fuel_prices_sweden/const.py b/custom_components/fuel_prices_sweden/const.py index c0299a5..5ffe784 100644 --- a/custom_components/fuel_prices_sweden/const.py +++ b/custom_components/fuel_prices_sweden/const.py @@ -62,7 +62,7 @@ CONF_FUEL_TYPE = "fuel_type" CONF_PRICE = "price" CONF_UPDATED_AT = "updated_at" -CONF_ENTRY_TITLE = "Fuel Price" +CONF_ENTRY_TITLE = "Fuel Prices" CONF_IS_MANUAL = "is_manual" PLACEHOLDER_KEY_STATION_NAME = "station_name" diff --git a/custom_components/fuel_prices_sweden/sensor.py b/custom_components/fuel_prices_sweden/sensor.py index fbb6687..cf703fe 100644 --- a/custom_components/fuel_prices_sweden/sensor.py +++ b/custom_components/fuel_prices_sweden/sensor.py @@ -1,6 +1,5 @@ """Sensor module.""" import logging -import random from homeassistant.components.sensor import ( SensorEntity, @@ -110,7 +109,7 @@ def should_poll(self): @property def unique_id(self): """Get unique_id.""" - return f"{self._id}_{random.randint(1, 100)}" + return f"{self._id}" @property def device_class(self):