Skip to content

Commit

Permalink
Fix update chart
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed May 31, 2024
1 parent d84da58 commit 5845ea1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion custom_components/truenas/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"issue_tracker": "https://github.com/cyr-ius/hass-truenas/issues",
"loggers": ["truenaspy"],
"requirements": ["truenaspy==0.6.6"],
"version": "0.7.0"
"version": "0.7.1"
}
19 changes: 12 additions & 7 deletions custom_components/truenas/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,17 @@ async def async_setup_entry(
entities = []
for description in RESOURCE_LIST:
if description.reference:
for value in getattr(coordinator.data, description.refer, {}):
entities.append(
description.func(
coordinator, description, value[description.reference]
)
)
specs_entities = [
description.func(coordinator, description, value[description.reference])
for value in getattr(coordinator.data, description.refer, {})
]
entities.extend(specs_entities)
# for value in getattr(coordinator.data, description.refer, {}):
# entities.append(
# description.func(
# coordinator, description, value[description.reference]
# )
# )
else:
entities.append(description.func(coordinator, description))

Expand Down Expand Up @@ -170,5 +175,5 @@ def in_progress(self) -> int:
async def async_install(self, version: str, backup: bool, **kwargs: Any) -> None:
"""Install an update."""
self._installing = True
await self.coordinator.api.async_update_chart(id=id)
await self.coordinator.api.async_update_chart(id=self.data["id"])
await self.coordinator.async_refresh()

0 comments on commit 5845ea1

Please sign in to comment.