diff --git a/custom_components/monitor_docker/const.py b/custom_components/monitor_docker/const.py index b07dee0..cb385c9 100644 --- a/custom_components/monitor_docker/const.py +++ b/custom_components/monitor_docker/const.py @@ -213,7 +213,7 @@ ), CONTAINER_INFO_ALLINONE: SensorEntityDescription( key=CONTAINER_INFO_ALLINONE, - name="AllInOne", + name="State", icon="mdi:checkbox-marked-circle-outline", ), } diff --git a/custom_components/monitor_docker/sensor.py b/custom_components/monitor_docker/sensor.py index a083b1a..67ac9f5 100644 --- a/custom_components/monitor_docker/sensor.py +++ b/custom_components/monitor_docker/sensor.py @@ -295,11 +295,9 @@ def __init__( self.entity_description = description if self.entity_description.key == CONTAINER_INFO_ALLINONE: - self.entity_description = CONTAINER_MONITOR_LIST[CONTAINER_INFO_STATE] - - self._state_extra = None - - if self.entity_description.key == CONTAINER_INFO_ALLINONE: + self._entity_id = ENTITY_ID_FORMAT.format( + slugify(self._prefix + "_" + self._cname) + ) self._attr_name = ENTITY_ID_FORMAT.format( slugify(self._prefix + "_" + self._cname) ) @@ -401,7 +399,7 @@ def event_callback(self, name="", remove=False) -> None: "[%s] %s: Received callback for: %s", self._instance, self._cname, - self.entity_description.name, + self.entity_description.key, ) stats = {}