From db3d8334e52a02a0eb01d450af47dd2addd60b00 Mon Sep 17 00:00:00 2001 From: "Dimitris L." <82817550+lebdim@users.noreply.github.com> Date: Sun, 12 Jul 2026 11:56:19 +0300 Subject: [PATCH 1/2] Add unique_id + entity_id setter to DockerContainerSwitch --- custom_components/monitor_docker/switch.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/monitor_docker/switch.py b/custom_components/monitor_docker/switch.py index 92fa755..c22991d 100644 --- a/custom_components/monitor_docker/switch.py +++ b/custom_components/monitor_docker/switch.py @@ -188,12 +188,17 @@ def __init__( ) self._name = name_format.format(name=alias_name) self._removed = False + self._attr_unique_id = slugify(f"{self._instance}_{self._cname}_switch") @property def entity_id(self) -> str: """Return the entity id of the switch.""" return self._entity_id + @entity_id.setter + def entity_id(self, value: str) -> None: + self._entity_id = value + @property def name(self) -> str: """Return the name of the sensor.""" From de9cdbf20a43288c851421710adc7ed454cf2adb Mon Sep 17 00:00:00 2001 From: "Dimitris L." <82817550+lebdim@users.noreply.github.com> Date: Sun, 12 Jul 2026 11:56:22 +0300 Subject: [PATCH 2/2] Add unique_id + entity_id setter to DockerContainerButton --- custom_components/monitor_docker/button.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/monitor_docker/button.py b/custom_components/monitor_docker/button.py index c653fc7..7cd58c3 100644 --- a/custom_components/monitor_docker/button.py +++ b/custom_components/monitor_docker/button.py @@ -187,12 +187,17 @@ def __init__( ) self._name = name_format.format(name=alias_name) self._removed = False + self._attr_unique_id = slugify(f"{self._instance}_{self._cname}_restart") @property def entity_id(self) -> str: """Return the entity id of the button.""" return self._entity_id + @entity_id.setter + def entity_id(self, value: str) -> None: + self._entity_id = value + @property def name(self) -> str: """Return the name of the sensor."""