Skip to content

Apply BLE-00 HW-0 Homey measurements to the Homey adapter - #50

Merged
Bre77 merged 1 commit into
mainfrom
fm/nlib-homey-adapter-hw0
Nov 3, 2026
Merged

Bre77 merged 1 commit into
mainfrom
fm/nlib-homey-adapter-hw0

Conversation

@Bre77

@Bre77 Bre77 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Applies the HW-0 results (report: nlib-hardware-tests/report.md, "Measured values for the Homey adapter").

  • HOMEY_MAX_WRITE_SIZE 20 -> null: one write per frame. Only a 114-byte frame was measured; a ~200 B signed frame is confirmed by HW-5. maxWriteSize: 20 still works.
  • Homey adapter sets scanTimeoutMs = 15 s (HOMEY_SCAN_TIMEOUT_MS), via a new optional BleTransport.scanTimeoutMs that scan_timeout_ms overrides. Other adapters keep 10 s. Docs: Homey scan "about 5 s" -> "about 10 s".
  • Reply waiter: no code change was needed. onMessage pushes into the per-domain ReplyQueue whether or not anyone waits, and awaitReply starts its deadline after the write, so an early reply is kept on every path (the wake probe goes through _send). Added a test with a link whose write resolves 200 ms after the reply.
  • No properties check added. ESPHome untouched (separate task).

Tests run: homey, vehiclebluetooth, contract, asleep, docs-samples; both tsc configs clean. Changeset included.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

The Homey adapter now defaults to one write per frame and exposes a 15-second scan timeout. VehicleBluetooth uses a transport-specific timeout when no explicit timeout is set. Documentation and tests describe these defaults and cover the related behavior.

Changes: Homey BLE defaults

Layer / File(s) Summary
Write-size default and measured Homey behavior
.changeset/homey-hw0-values.md, README.md, docs/bluetooth_vehicles.md, src/bluetooth/adapters/homey.ts, test/bluetooth/adapters/homey.test.ts, test/consumers/*
The Homey write-size default changes from 20 to null, so a frame is sent in one write. Tests retain explicit 20-byte chunking. Documentation records the 114-byte single-write measurement and notes that behavior for an approximately 200-byte signed frame remains unmeasured.

Scan-timeout fallback and VehicleBluetooth tests

Layer / File(s) Summary
Transport timeout precedence and request tests
src/bluetooth/transport.ts, src/bluetooth/constants.ts, src/bluetooth/adapters/homey.ts, src/bluetooth/vehiclebluetooth.ts, docs/bluetooth_vehicles.md, test/bluetooth/adapters/homey.test.ts, test/bluetooth/vehiclebluetooth.test.ts, test/helpers/blevehicle.ts
BleTransport adds optional scanTimeoutMs, and the Homey transport sets it to 15,000 ms. VehicleBluetooth prioritizes an explicit scan_timeout_ms, then the transport value, then the shared default. Tests cover the transport timeout and retention of a session-info reply received before a delayed write resolves.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

Merge Risk: Moderate · up to 657ae

A fresh Homey Flow action following the example can exceed its action window before sending a command. Clarify how to discover and retain the device before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts ### CodeRabbit Verify
  • Run CodeRabbit Verify to test the changes in this pull request.

@Bre77
Bre77 merged commit 9aebb62 into main Nov 3, 2026
4 of 7 checks 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.

1 participant