From 9f6c75d924a796b1697d38b35128224534af3320 Mon Sep 17 00:00:00 2001 From: Tomaae <23486452+tomaae@users.noreply.github.com> Date: Wed, 26 Apr 2023 01:27:50 +0200 Subject: [PATCH] workaround for non-standard smart response, ref #109 --- custom_components/openmediavault/apiparser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/openmediavault/apiparser.py b/custom_components/openmediavault/apiparser.py index 6116c70..380b4d0 100644 --- a/custom_components/openmediavault/apiparser.py +++ b/custom_components/openmediavault/apiparser.py @@ -40,13 +40,13 @@ def from_entry(entry, param, default="") -> str: if isinstance(default, str): ret = str(ret) elif isinstance(default, int): - if " " in ret: + if isinstance(default, str) and " " in ret: ret_tmp = ret.split(" ") ret = ret_tmp[0] ret = int(ret) elif isinstance(default, float): - if " " in ret: + if isinstance(default, str) and " " in ret: ret_tmp = ret.split(" ") ret = ret_tmp[0]