hvac/backend
jtricerolph 1a06a860f5 Fix Daikin driver: use node:http instead of fetch() — undici gets 0-byte bodies
Live-tested against the real unit (10.4.2.6, 2026-08-25): a full-subnet sweep came
back with 0 units found despite the device being reachable and fast (~150ms). Root
cause isolated via a series of in-container diagnostics, not a timeout or CIDR-math
bug — Node's fetch() (undici) reliably read a 0-byte body from this adapter's
embedded webserver, which sends a connection-close-delimited response (no
Content-Length, HTTP/1.0-style) rather than a Content-Length/chunked body. wget,
curl, and node:http all read the real ~400-byte body fine; fetch() alone did not.

Switched every request in lib/drivers/daikin.js (probe, get_control_info,
get_sensor_info, set_control_info) from fetch() to a small node:http-based
httpGet() helper with Connection: close, and left a comment warning not to
"simplify" this back to fetch(). Bumped SWEEP_TIMEOUT_MS 500ms -> 800ms for
headroom (confirmed real round-trip is ~150-180ms, so this was never the actual
problem, but a little slack is cheap).

node --check clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-25 12:12:38 +00:00
..
scripts Add Phase 2 MHI Modbus register-map profile, xlsx importer, and a 2026-07-27 14:19:58 +00:00
src Fix Daikin driver: use node:http instead of fetch() — undici gets 0-byte bodies 2026-08-25 12:12:38 +00:00
Dockerfile Scaffold Phase 1 hvac app — NewBook-driven room TRV heating scheduler 2026-07-26 18:00:42 +00:00
package.json Add MHI aircon manual control (Phase 2, Modbus only) 2026-07-27 14:43:38 +00:00