Files
hassio-integration-perfectd…/custom_components/perfectdraft/strings.json
T
rickandCursor 5d049c5529 fix: translate the already_in_progress abort, derive the reason set
Verification caught this change violating its own requirement that every
abort reason the flow can emit has a translation. async_set_unique_id()
defaults to raise_on_progress=True and raises already_in_progress when
another flow holds the same unique ID. That is reachable, and reachable
by exactly the users this change is for: park a reauth flow, give up,
try Add Integration for the same account, and the raw key surfaces.

The coverage test was hardcoded to three reasons, so it checked a "for
every" requirement against a list written by hand and passed anyway.
Replace it with an AST scan of config_flow.py that resolves each
aborting helper call to the reason it raises, honouring explicit reason=
and the raise_on_progress=False opt-out, plus a sanity test so a scanner
that goes blind fails instead of silently passing. Confirmed the new
check fails against the pre-fix translation files.

Also adds a regression test for the concurrent-flow path, which is the
evidence that this abort is real rather than theoretical.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-06 15:39:13 +02:00

69 lines
2.5 KiB
JSON

{
"config": {
"step": {
"user": {
"title": "PerfectDraft Account",
"description": "Enter your PerfectDraft app credentials.",
"data": {
"email": "Email",
"password": "Password"
}
},
"token": {
"title": "Verification Token",
"description": "Paste a verification token from PerfectDraft's website. See the [setup instructions](https://github.com/Falkvinge/hassio-integration-perfectdraft-pro#step-2-verification-token) for the 30-second walkthrough. The token expires in 2 minutes, so generate it right before pasting.",
"data": {
"recaptcha_token": "Verification Token"
}
},
"reauth_confirm": {
"title": "Re-authenticate PerfectDraft",
"description": "Your session has expired. Please re-enter your credentials.",
"data": {
"email": "Email",
"password": "Password"
}
}
},
"error": {
"invalid_auth": "Authentication failed. Token may have expired (2 min limit) or credentials are wrong. Try again with a fresh token.",
"cannot_connect": "Cannot connect to PerfectDraft service.",
"unknown": "An unexpected error occurred."
},
"abort": {
"already_configured": "This PerfectDraft account is already configured.",
"reauth_successful": "Re-authentication successful.",
"reauth_account_mismatch": "Those credentials are for a different PerfectDraft account. Re-authenticate with the account this integration was set up with, or delete the integration and add the other account separately.",
"already_in_progress": "Setup for this PerfectDraft account is already under way. Finish or cancel the pending flow first — look for it under Settings > Devices & Services."
}
},
"entity": {
"sensor": {
"temperature": { "name": "Temperature" },
"keg_remaining": { "name": "Keg Remaining" },
"keg_product_id": { "name": "Keg Product" },
"keg_name": { "name": "Keg" },
"connection": { "name": "Connection" },
"door": { "name": "Door" },
"pours": { "name": "Pours" },
"last_pour": { "name": "Last Pour" },
"firmware": { "name": "Firmware" },
"mode": { "name": "Mode" },
"keg_freshness": { "name": "Keg Freshness" }
},
"button": {
"mark_keg_changed": { "name": "Mark Keg Changed" }
}
},
"options": {
"step": {
"init": {
"title": "PerfectDraft Options",
"data": {
"scan_interval": "Polling interval (seconds)"
}
}
}
}
}