Skip to content

Commit

Permalink
Fixed: AllInOne sensor is working now
Browse files Browse the repository at this point in the history
  • Loading branch information
ualex73 committed May 16, 2024
1 parent ff25eac commit aa33e36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/monitor_docker/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@
),
CONTAINER_INFO_ALLINONE: SensorEntityDescription(
key=CONTAINER_INFO_ALLINONE,
name="AllInOne",
name="State",
icon="mdi:checkbox-marked-circle-outline",
),
}
Expand Down
10 changes: 4 additions & 6 deletions custom_components/monitor_docker/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)
Expand Down Expand Up @@ -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 = {}
Expand Down

0 comments on commit aa33e36

Please sign in to comment.