From 3b5a6c2c975f035071a3498945fece21b4283913 Mon Sep 17 00:00:00 2001 From: snaky69 <108159253+ic-dev21@users.noreply.github.com> Date: Sun, 15 Oct 2023 11:33:49 -0400 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20unique=5Fid=20au=20sensor=20d'?= =?UTF-8?q?=C3=A9nergie?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Permettrait possiblement d'arranger #281 Comme ils n'avaient pas de uniqueid il n'arrivaient pas à se populer. Les autres sensors (température, power, etc.) avait leur unique id et étaient fonctionnels. --- custom_components/hilo/sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100644 => 100755 custom_components/hilo/sensor.py diff --git a/custom_components/hilo/sensor.py b/custom_components/hilo/sensor.py old mode 100644 new mode 100755 index 13f2835..fd1df8e --- a/custom_components/hilo/sensor.py +++ b/custom_components/hilo/sensor.py @@ -243,7 +243,8 @@ class EnergySensor(IntegrationSensor): def __init__(self, device): self._device = device - self._attr_name = f"hilo_energy_{slugify(device.name)}" + self._attr_name = f"Hilo Energy {slugify(device.name)}" + self._attr_unique_id = f"hilo_energy_{slugify(device.name)}" self._unit_of_measurement = ENERGY_WATT_HOUR self._unit_prefix = None if device.type == "Meter":