Skip to content

Commit 4807f8e

Browse files
✨ Improve board type detection for ESP32
This will help cases where heishamon < 3.9 is running
1 parent 9c20141 commit 4807f8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

custom_components/aquarea/definitions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,12 @@ def read_board_type(json_doc: str) -> Optional[str]:
10671067
if "board" in j:
10681068
return j["board"]
10691069
if "voltage" in j:
1070+
# ESP32 has a static 3.3V and more than 64k free heap
10701071
if j["voltage"] != "3.3":
10711072
return "ESP8266"
1073+
if "free heap" in j:
1074+
if float(j["free heap"]) > 65535:
1075+
return "ESP32"
10721076
return None
10731077

10741078
def ms_to_secs(value: Optional[float]) -> Optional[float]:

0 commit comments

Comments
 (0)