Error message keys in strings.json do not match config_flow.py #6
Labels
No labels
blocked:commit-ready-failed
blocked:gate-fetch
blocked:gate-lint
blocked:gate-plan
blocked:gate-research
blocked:needs-decision
blocked:needs-human
blocked:no-changes
blocked:verify-failed
bug
deferred
feature-request
in-progress
needs-decompose
needs-triage
quickfix
security/medium
test-coverage
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/yeedi-ha-mqtt#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
strings.json defines specific error keys that are never used by the config flow validation code:
invalid_url_schema_override_rest_url(defined in strings.json but not in code)invalid_url_schema_override_mqtt_url(defined in strings.json but not in code)The config flow uses the generic key
"invalid_url"for both REST and MQTT URL validation errors:Impact
Suggested fix
Change config_flow.py to use the specific keys matching strings.json, for example:
errors[CONF_OVERRIDE_REST_URL] = "invalid_url_schema_override_rest_url"errors[CONF_OVERRIDE_MQTT_URL] = "invalid_url_schema_override_mqtt_url"Or alternately, remove the unused keys from strings.json.