Skip to content

Add static IP pairing support with Jest test suite#224

Open
qmalexander wants to merge 5 commits intoaivus:masterfrom
qmalexander:feature/static-ip-pairing
Open

Add static IP pairing support with Jest test suite#224
qmalexander wants to merge 5 commits intoaivus:masterfrom
qmalexander:feature/static-ip-pairing

Conversation

@qmalexander
Copy link
Copy Markdown

  • Pair UI: new "add_static_ip" view lets users enter a device IP directly instead of relying solely on UDP broadcast discovery
  • Optional "skip UDP scan" checkbox for environments where UDP is blocked; uses IP as device identifier and accepts an optional custom name
  • finder.js: add probe(ip) method for targeted unicast UDP scan
  • device.js: connect via stored static_ip setting at runtime, bypassing the Finder when a static IP is configured
  • driver.js: replace onPairListDevices with onPair; session-scoped static device list merged into list_devices results (deduped by MAC)
  • driver.compose.json: add_static_ip pair view + static_ip device setting
  • Jest test suite (23 tests) covering finder.probe(), driver pair handlers, and device._findDevices() static IP path

- Pair UI: new "add_static_ip" view lets users enter a device IP directly
  instead of relying solely on UDP broadcast discovery
- Optional "skip UDP scan" checkbox for environments where UDP is blocked;
  uses IP as device identifier and accepts an optional custom name
- finder.js: add probe(ip) method for targeted unicast UDP scan
- device.js: connect via stored static_ip setting at runtime, bypassing
  the Finder when a static IP is configured
- driver.js: replace onPairListDevices with onPair; session-scoped static
  device list merged into list_devices results (deduped by MAC)
- driver.compose.json: add_static_ip pair view + static_ip device setting
- Jest test suite (23 tests) covering finder.probe(), driver pair handlers,
  and device._findDevices() static IP path
@aivus
Copy link
Copy Markdown
Owner

aivus commented Mar 25, 2026

Hello @qmalexander

Thank you for the contribution. It will take some time to review and test the changes.
I'll get back to you soon.

@qmalexander
Copy link
Copy Markdown
Author

@aivus any update on eta? Hoping to get this working so my automations can start working again 🙃

Disable mocha/no-mocha-arrows (crashes ESLint 7 on Jest arrow functions)
and global-require for test/**/*.js overrides.
@aivus
Copy link
Copy Markdown
Owner

aivus commented Apr 19, 2026

Hello @qmalexander

I'm currently (sporadically) testing the changes. I didn't look into the code yet.

Question: I've added the device using the IP address, opened the settings of this device and see no static IP address displayed in the settings. Is it expected?

When probe(ip) succeeds, _onMessage stores the device in finder._hvacs,
so it appears in the broadcast-found list without settings. The static IP
was then lost because the deduplication filtered it from the manual list.

Now list_devices builds a mac→staticIp lookup first and applies it to
any broadcast-found device that was also added as a static device.
@qmalexander
Copy link
Copy Markdown
Author

Hello @qmalexander

I'm currently (sporadically) testing the changes. I didn't look into the code yet.

Question: I've added the device using the IP address, opened the settings of this device and see no static IP address displayed in the settings. Is it expected?

Hi @aivus, Thank you for testing. No the expectation was that the static IP should be visible on the device settings. I pushed a fix for it can you test it again and see if it works for you now?

Br
Alexander

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