Commit b2a3c65
Ravi Singh
fix(mdns+webui): pass NULL instance name + return hub_name in /api/v1/info
Two bench-discovered bugs in v6.2.0-alpha.2 that made AmbiSense show
up in HA's SmartGhar integration with broken labels:
netmgr.c — mDNS instance name leak:
mdns_service_add("_smartghar", "_smartghar", "_tcp", ...) passed the
raw service label as the friendly instance name (1st arg). Result:
HA's discovery card showed "_smartghar [random]" instead of the
device's name. Fix: pass NULL so the service inherits the global
mdns_instance_name_set("AmbiSense") set above.
webui.c — missing hub_name field:
smartghar-homeassistant's SmartGharHubSensor.device_info reads
info.get("hub_name") to populate HA's device-registry name.
Without it, the integration falls back to "SmartGhar Hub
(XXXXXX)" which is ugly. TankSync emits hub_name as the hostname
("tanksync-f6dc"); AmbiSense now does the same ("ambisense-f6dc").
Bench-tested: discovery card now reads "AmbiSense" instead of
"_smartghar"; device-registry name populates as "ambisense-XXXX"
matching the host. Combined with the existing product=ambisense
field, the device-registry model resolves correctly to "AmbiSense
Hub" via hub_model_for_product() in smartghar-homeassistant v0.7.0.1 parent 78cf463 commit b2a3c65
2 files changed
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
158 | 163 | | |
159 | 164 | | |
160 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
904 | 911 | | |
905 | 912 | | |
906 | 913 | | |
| |||
0 commit comments