laundry: show the names assigned so far during guided setup
A nine-program walk is hard to keep your place in. The counter alone doesn't say what you've already done, and the programs still to do can't be listed -- they're unnamed by definition, which is the whole premise. So "named so far" is the only orientation available, and it now appears on all three guided screens. It doubles as duplicate avoidance on the naming form: a repeated name is rejected, so seeing the others while typing beats being bounced afterwards. Listed in the appliance's own advertised order rather than the order they were named -- a stable order either way, and not numbered: whether it matches the dial is plausible but unverified, and implying it would be worse than saying nothing.
This commit is contained in:
9 files changed
+73
-23
No files matched your search
@@ -589,3 +589,36 @@ async def test_closing_the_dialog_stops_probing_the_appliance(hass: HomeAssistan
|
||||
settled = probes
|
||||
await asyncio.sleep(0.05)
|
||||
assert probes == settled
|
||||
|
||||
|
||||
async def test_guided_lists_the_names_assigned_so_far(hass: HomeAssistant):
|
||||
"""The only orientation available on a long walk -- the programs still to
|
||||
do are unnamed by definition, so 'done so far' is all there is to show.
|
||||
It doubles as duplicate avoidance, since the form rejects a repeat."""
|
||||
coordinator = await _coordinator(hass)
|
||||
handler = await _options_handler(hass, coordinator)
|
||||
|
||||
assert handler._cloud_progress_placeholders(coordinator)["named_list"] == "none yet"
|
||||
|
||||
coordinator.apply_cloud_courses({"55": "Sports", "6B": "Jeans"}, "87")
|
||||
await _flush(hass)
|
||||
placeholders = handler._cloud_progress_placeholders(coordinator)
|
||||
assert placeholders["named"] == "2"
|
||||
assert placeholders["total"] == "9"
|
||||
# The appliance's own advertised order, not naming order: 6B precedes 55
|
||||
# in CloudExtraCourse_0A5C286B2D0C55301A.
|
||||
assert placeholders["named_list"] == "Jeans, Sports"
|
||||
|
||||
|
||||
async def test_the_name_form_shows_the_other_names_while_typing(hass: HomeAssistant):
|
||||
coordinator = await _coordinator(hass)
|
||||
coordinator.apply_cloud_courses({"6B": "Jeans"}, "87")
|
||||
await _flush(hass)
|
||||
|
||||
handler = await _options_handler(hass, coordinator)
|
||||
await handler.async_step_cloud_guided()
|
||||
_stub_probe(coordinator, ["55"])
|
||||
await _run_wait(handler)
|
||||
|
||||
form = await handler.async_step_cloud_name()
|
||||
assert form["description_placeholders"]["named_list"] == "Jeans"
|
||||
Reference in new issue
Block a user