Repository navigation
feat(config): propose the declared indoor monitor for Call Home - #173
Conversation
|
Nice addition. Tests pass here (Python 3.14, also with #171, #174 and #175 merged on top).
Happy to run the step on our 40515 and report what it shows. |
|
Thanks for the detailed review. I’ve addressed all four points in commit
The updated PR passes 2,199 default tests. With #171, #174 and #175 applied, 2,218 tests pass. Both runs reach 95.89% line and branch coverage, and These changes have automated coverage; the updated options flow has not yet been field-tested on my 40517. Could you try the updated branch on your 40515 and report what the step shows, particularly whether GET_NICKS returns a declaration or the new no-reply message? Thanks again for offering to test it. |
|
Tried Configure → Find indoor monitor sent GET_NICKS to 60001 only. The usual 407 came first, then the retry got a 200 and the reply arrived about 0.3 s after the first send: That makes 60001 the proposal, the address Call Home already uses here. I drove the flow through the API and kept 60001, so I didn't look at the form itself. Nothing rang, nothing else changed. I didn't get to test the no-reply path, since the panel always answered. On this plant GET_NICKS to an existing address does answer, so the "no SIP answer on a cloud 40515" case from the Works for us, thanks for the quick turnaround! |
lollox80
left a comment
There was a problem hiding this comment.
Thanks, and thanks @Apeiv for the 40515 run. Read through f4fc8bd: the logic matches what async_find_picg returns on main (queued/exists without a reply → no-reply message, ok: False → unavailable, a reply without a unique valid PICG → not found), and the PICG = SGA guard covers the 40507 case. A few small points, none blocking:
options_flow.py(async_step_internal_panel, theinternal_panel_same_as_sgabranch): this is informational, not a failure, but aserrors["base"]HA shows it in red as if the lookup had failed. Could it go into the description instead (e.g. a{note}placeholder), keepingerrorsfor real failures?- Same function, the late-reply path: when a GET_NICKS reply arrives after
reply_waitand carries no PICG,async_find_picgreturnsreply_after: Noneand norepliedprobe, so the user sees "no reply" although a reply did arrive. Edge case; fine to leave, maybe worth a one-line comment. sip_timeout=20, reply_wait=10: the form can sit for ~30 s with only a spinner. A shorterreply_wait(Apeiv's reply came in ~0.3 s) would cut the worst case; your call.- Nit, docs (
CONFIGURATION.md/.it.md): the last two sentences ("Cached nicknames without a PICG…", "No reply and an unavailable lookup…") describe internals more than what the user does; they could be dropped.
|
Field test of
So the branch added after @Apeiv's review behaves as intended on real hardware. With Apeiv's run on his 40515 (PICG ≠ SGA, proposal = 60001), both sides are now covered. What's left is your run on the 40517 through the form. Optional nit on the wording: the intro text is the same in both cases ("Viene proposto un PICG diverso dall'SGA; se coincidono si mantiene la destinazione attuale…"). When nothing is proposed, as here, the first half reads oddly. Either two texts (one per case), or a neutral sentence such as "Se il PICG dichiarato è diverso dall'SGA viene proposto come posto interno; altrimenti resta la destinazione attuale." (and the same in English). Fine to leave for a follow-up. |
Resolve the conflicts with ha-vimar#174 by keeping both sides: the flow's _internal_panel_suggestion and _phonebook_source attributes, and the internal panel tests next to the import summary test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMtKjPuZNEaX23BpL9AsaA
Resolve the conflict in tests/test_config_flow_steps.py by keeping both sides: the outgoing video option tests and the internal panel and import summary tests from #173 and #174. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XMtKjPuZNEaX23BpL9AsaA



What and why
Call Home's default indoor-panel address is not correct on every plant. On the Tab 7S Up 40517 in #172, GET_NICKS declared PICG 60001, distinct from SGA 61000; using that PICG made Call Home ring the physical monitor. On the 40507 development plant, PICG is also the SGA/controller, and Call Home uses another address. A PICG declaration alone therefore cannot identify the monitor on every plant.
Add Configure → Find indoor monitor. It proposes a single validated PICG extension only when it differs from the effective SGA (
sga_target or SGA_TARGET). When they coincide, a neutral conditional explanation in the form description keeps this informational rather than showing a red error; the current Call Home destination, including its existing default, is preserved. Saving requires explicit confirmation and changes only the indoor-panel option.Cached nicknames containing a PICG are reused. A cache without a PICG triggers GET_NICKS to only the configured address. Missing nickname replies and unavailable lookups (disconnected/missing hub or an active scan) have separate messages from a reply without a unique valid PICG. The flow uses
rest_client.ROLE_PICGand retains strict target and ambiguity checks. A known monitor address can still be entered manually after any lookup error.The step does not infer addresses from numbering, scan ranges or place calls.
Tested on
The PICG-to-monitor mapping and successful Call Home were verified on an Elvox Tab 7S Up 40517, SW 2.1.0203 / FW 1.06, cloud TLS, Home Assistant Container. The new options UI has not yet been field-tested on that plant. The 40507 counterexample and cloud 40515 no-reply behavior were supplied in review; they are covered by synthetic regression cases, not new hardware measurements by this contributor.
Tests cover empty/explicit SGA and indoor target values, cached/queried nicknames, timeout and accepted-without-reply results, unavailable scans, missing/invalid/ambiguous declarations, explicit confirmation, and preservation of unrelated settings. The combined branch with #171, #174 and #175 is also tested.
Validation: standalone default suite 2,199 passed; combined suite 2,218 passed; each has 1 skipped and 204 deselected, line and branch coverage 95.89%. Whole-repository
ruff check .passes.Docs
Docs: docs/CONFIGURATION.md and docs/CONFIGURATION.it.md; English and Italian options-flow translations.
Changelog
Changelog: Enhancements - Propose a declared PICG as the Call Home destination when it differs from the SGA, preserving the current destination otherwise and distinguishing unavailable lookups from missing replies.