Skip to content

fix(discovery): case-insensitive hostname match — the P4 was invisible - #22

Merged
Skeyelab merged 1 commit into
mainfrom
fix/p4-discovery-case-insensitive
Jul 15, 2026
Merged

Skeyelab merged 1 commit into
mainfrom
fix/p4-discovery-case-insensitive

Conversation

@Skeyelab

Copy link
Copy Markdown
Member

A real ESP32-P4 found this: it advertises its Bonjour instance name as KitchenSync (capital K), while the Touch/X32Link use lowercase hostnames. hasPrefix is case-sensitive, so the P4 was filtered out. Lowercase before matching. Test written from the device's actual advertisement.

https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6

…s invisible

A real ESP32-P4 on the LAN found this. It advertises its Bonjour INSTANCE NAME as
"KitchenSync" (capital K, a friendly name), where the Touch and X32Link use lowercase
hostnames (kstouch-…, x32link-…). The hostname fallback used hasPrefix, which is
case-sensitive, so `"KitchenSync".hasPrefix("kitchensync")` was false and the P4 never
showed up. A Bonjour name's case is not meaningful. Lowercase before matching.

(The P4 also publishes dev=kitchensync in TXT, so a TXT-aware client matches it anyway;
this fixes the hostname fallback for units whose TXT the browse result doesn't carry.)

Test written from the real device's advertisement.

Claude-Session: https://claude.ai/code/session_01F7YsQgso3KNpeXbP5vNVj6
@Skeyelab
Skeyelab merged commit be380f1 into main Jul 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants