From c74d28488a26abec9e173e86aafc860c7b7088ec Mon Sep 17 00:00:00 2001 From: Daniel Rheinbay Date: Wed, 14 Jun 2023 23:01:34 +0200 Subject: [PATCH] Use resource ID as unique id. --- custom_components/pixometer/sensor.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/custom_components/pixometer/sensor.py b/custom_components/pixometer/sensor.py index 9b4fd37..89756e9 100644 --- a/custom_components/pixometer/sensor.py +++ b/custom_components/pixometer/sensor.py @@ -160,10 +160,8 @@ def icon(self) -> str: @property def unique_id(self) -> str: - """Return the name of the sensor.""" - return ( - f"{NAME} {self._meter_details.get('location_in_building').replace('-', '_')}" - ) + """Return the unique ID of the sensor.""" + return self._meter_details.get('resource_id') @property def name(self) -> str: