Error message keys in strings.json do not match config_flow.py #6

Closed
opened 2026-05-11 06:15:05 +00:00 by Mark · 0 comments
Owner

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:

errors[CONF_OVERRIDE_REST_URL] = "invalid_url"
errors[CONF_OVERRIDE_MQTT_URL] = "invalid_url"

Impact

  • The more descriptive error messages in strings.json are never displayed to users.
  • Users see generic "Invalid URL" regardless of which URL field has the problem.

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.

## 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: ```python errors[CONF_OVERRIDE_REST_URL] = "invalid_url" errors[CONF_OVERRIDE_MQTT_URL] = "invalid_url" ``` ## Impact - The more descriptive error messages in strings.json are never displayed to users. - Users see generic "Invalid URL" regardless of which URL field has the problem. ## 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.
Mark closed this issue 2026-05-11 16:00:21 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/yeedi-ha-mqtt#6
No description provided.