Skip to content

Commit d8cc3c9

Browse files
committed
fix(text): tank-name max 15→24 — S3 hubs serve longer names, entity crashed
1 parent 1ed725f commit d8cc3c9

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

custom_components/smartghar/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"requirements": [
1414
"pyserial-asyncio-fast==0.16"
1515
],
16-
"version": "0.11.0",
16+
"version": "0.11.1",
1717
"zeroconf": [
1818
"_smartghar._tcp.local."
1919
]

custom_components/smartghar/text.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717
from .device_info import subdevice_device_info
1818
from .coordinator import SmartGharCoordinator
1919

20-
# Hub firmware caps tank names at TX_NAME_MAX (16 chars) but enforces a
21-
# stricter sanitised set on the device side. We mirror the length limit and
22-
# let the hub reject bad characters with a 4xx; the user sees the error in HA.
23-
TANK_NAME_MAX_LEN = 15
20+
# Hub firmware caps tank names at TX_NAME_MAX 25 (24 chars + NUL) on the
21+
# S3/DevKit hubs; older C3 hubs cap at 15 and sanitize/truncate server-side.
22+
# Mirror the LARGEST limit any hub can return — a shorter native_max makes
23+
# the entity raise (and go unavailable) when a hub serves a longer name.
24+
# Bad characters are still rejected by the hub with a 4xx; user sees it in HA.
25+
TANK_NAME_MAX_LEN = 24
2426

2527

2628
async def async_setup_entry(

0 commit comments

Comments
 (0)