Skip to content

Commit

Permalink
Removed version check from TrueNAS Core, fixes #186
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Nov 14, 2024
1 parent ed432b9 commit bdb1da3
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions custom_components/truenas/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,25 @@ def get_systeminfo(self) -> None:
self._is_scale = bool(
self.ds["system_info"]["version"].startswith("TrueNAS-SCALE-")
)
if not self._version_major:
self._version_major = int(
self.ds["system_info"]
.get("version")
.removeprefix("TrueNAS-")
.removeprefix("SCALE-")
.split(".")[0]
)

if not self._version_minor:
self._version_minor = int(
self.ds["system_info"]
.get("version")
.removeprefix("TrueNAS-")
.removeprefix("SCALE-")
.split(".")[1]
)
if self._is_scale:
if not self._version_major:
self._version_major = int(
self.ds["system_info"]
.get("version")
.removeprefix("TrueNAS-")
.removeprefix("SCALE-")
.split(".")[0]
)

if not self._version_minor:
self._version_minor = int(
self.ds["system_info"]
.get("version")
.removeprefix("TrueNAS-")
.removeprefix("SCALE-")
.split(".")[1]
)

self._is_virtual = self.ds["system_info"]["system_manufacturer"] in [
"QEMU",
Expand Down

0 comments on commit bdb1da3

Please sign in to comment.