Skip to content

Commit

Permalink
added data gathering entry for cputemp #104
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaae committed Apr 25, 2023
1 parent d7a76f3 commit 9a1fcee
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions custom_components/openmediavault/omv_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ async def async_update(self):
and self.data["plugin"]["openmediavault-compose"]["installed"]
):
await self.hass.async_add_executor_job(self.get_compose)
if (
self.api.connected()
and "openmediavault-cputemp" in self.data["plugin"]
and self.data["plugin"]["openmediavault-cputemp"]["installed"]
):
await self.hass.async_add_executor_job(self.get_cputemp)

self.lock.release()

Expand Down Expand Up @@ -274,6 +280,25 @@ def get_hwinfo(self):
self.data["hwinfo"]["availablePkgUpdates"] > 0
)

# ---------------------------
# get_cputemp
# ---------------------------
def get_cputemp(self):
# tmp_data = parse_api(
# data={},
# source=self.api.query("CpuTemp", "get"),
# vals=[
# {"name": "devicemodel", "default": "unknown"},
# {"name": "serialnumber", "default": "unknown"},
# {"name": "firmwareversion", "default": "unknown"},
# {"name": "sectorsize", "default": "unknown"},
# {"name": "rotationrate", "default": "unknown"},
# {"name": "writecacheis", "type": "bool", "default": False},
# {"name": "smartsupportis", "type": "bool", "default": False},
# ],
# )
print("CpuTemp:", self.api.query("CpuTemp", "get"))

# ---------------------------
# get_disk
# ---------------------------
Expand Down

0 comments on commit 9a1fcee

Please sign in to comment.