From 4807f8e300695c1bc15fe3fd0a06bd25086439b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Seux?= Date: Thu, 2 Jan 2025 17:48:08 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Improve=20board=20type=20detection?= =?UTF-8?q?=20for=20ESP32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will help cases where heishamon < 3.9 is running --- custom_components/aquarea/definitions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/aquarea/definitions.py b/custom_components/aquarea/definitions.py index 516df9c..cda9af7 100644 --- a/custom_components/aquarea/definitions.py +++ b/custom_components/aquarea/definitions.py @@ -1067,8 +1067,12 @@ def read_board_type(json_doc: str) -> Optional[str]: if "board" in j: return j["board"] if "voltage" in j: + # ESP32 has a static 3.3V and more than 64k free heap if j["voltage"] != "3.3": return "ESP8266" + if "free heap" in j: + if float(j["free heap"]) > 65535: + return "ESP32" return None def ms_to_secs(value: Optional[float]) -> Optional[float]: