From 9a1fcee097c15ae60d36f7aa046a4f2455e5dac8 Mon Sep 17 00:00:00 2001 From: Tomaae <23486452+tomaae@users.noreply.github.com> Date: Tue, 25 Apr 2023 23:59:46 +0200 Subject: [PATCH] added data gathering entry for cputemp #104 --- .../openmediavault/omv_controller.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/custom_components/openmediavault/omv_controller.py b/custom_components/openmediavault/omv_controller.py index 66b426b..aa5b30f 100644 --- a/custom_components/openmediavault/omv_controller.py +++ b/custom_components/openmediavault/omv_controller.py @@ -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() @@ -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 # ---------------------------