laundry: a payload sitting there is not evidence of when it got there
The Download-course candidate came from "Course_ read while a non-sentinel one-time payload is loaded". On the first rep after any restart that is indistinguishable from a payload left over from a previous run, so an appliance holding cloud payloads while sitting on an ordinary course proposed that ordinary course as the Download one. Accepting the prefill would then make selecting a downloaded program start, say, a cotton wash. Only a transition actually watched counts now. "Never observed" is a distinct state from "observed, nothing loaded" -- absent-then-loaded is a genuine selection and still counts -- so a restored store deliberately re-enters the unobserved state, since a restart cannot tell the two apart. Payloads are still learned from that first rep either way; which programs exist is device fact regardless of when they were loaded. It is only the inference about which course means Download that needs the timing. Both corpus dumps taken off the Download course show the appliance clearing its one-time token to the FFFF sentinel, so this may never fire on these boards. That is a reason to expect them to behave, not to depend on it.
This commit is contained in:
4 files changed
+95
-11
No files matched your search
@@ -318,6 +318,7 @@ async def test_the_form_proposes_the_observed_download_course(hass: HomeAssistan
|
||||
assert result["description_placeholders"]["total"] == "9"
|
||||
# Two learned so far, seven still to walk through on the appliance.
|
||||
assert result["description_placeholders"]["found"] == "2"
|
||||
_observe_program_load(coordinator, SPORTS)
|
||||
assert coordinator.cloud_courses.download_candidates() == ["87"]
|
||||
|
||||
|
||||
@@ -420,6 +421,23 @@ async def test_the_flow_rejects_a_name_shadowing_a_personal_course(hass: HomeAss
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def _observe_program_load(coordinator, blob, course="87"):
|
||||
"""Stand in for the user loading a program while Home Assistant watches.
|
||||
A candidate Download course comes only from a transition that was
|
||||
actually observed, so tests that expect one have to produce it."""
|
||||
coordinator._observe.apply(
|
||||
COURSE,
|
||||
{
|
||||
"x.com.samsung.da.options": [
|
||||
"CloudExtraCourse_0A5C286B2D0C55301A",
|
||||
f"Course_{course}",
|
||||
f"OneTimeCloudCourse_{blob}",
|
||||
]
|
||||
},
|
||||
source="poll",
|
||||
)
|
||||
|
||||
|
||||
def _stub_probe(coordinator, sequence):
|
||||
"""Drive async_probe_cloud_courses from a scripted list of loaded slots,
|
||||
standing in for the user turning the dial. The last entry repeats."""
|
||||
@@ -658,7 +676,9 @@ async def test_guided_setup_alone_produces_a_selectable_cycle(hass: HomeAssistan
|
||||
|
||||
first = await handler.async_step_cloud_name()
|
||||
assert "download_course" in str(first["data_schema"].schema)
|
||||
# Prefilled from the observation the fixture already carries.
|
||||
# Prefilled once a load has actually been watched -- in real use the
|
||||
# guided probe loop feeds observe() and produces exactly this.
|
||||
_observe_program_load(coordinator, SPORTS)
|
||||
assert handler._cloud_course == "87"
|
||||
|
||||
await handler.async_step_cloud_name({"name": "Sports", "download_course": "87"})
|
||||
|
||||
Reference in new issue
Block a user