Make field description optional for non config flows#166892
Make field description optional for non config flows#166892emontnemery wants to merge 1 commit intodevfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates hassfest’s translations schema so that description is no longer mandatory for field definitions outside config flows (services, conditions, triggers, and selector/object-selector fields).
Changes:
- Make
selector.fields.<key>.descriptionoptional in the “new format” selector schema. - Make
services.<service>.fields.<field>.descriptionoptional. - Make
conditions.<cond>.fields.<field>.descriptionandtriggers.<trigger>.fields.<field>.descriptionoptional.
| vol.Required("name"): str, | ||
| vol.Required( | ||
| vol.Optional( | ||
| "description" | ||
| ): translation_value_validator, | ||
| }, |
There was a problem hiding this comment.
Add a hassfest translation schema test that verifies selector field entries are accepted without a description now that the schema makes it optional, to prevent regressions back to requiring it.
| { | ||
| vol.Required("name"): str, | ||
| vol.Required("description"): translation_value_validator, | ||
| vol.Optional("description"): translation_value_validator, | ||
| vol.Optional("example"): translation_value_validator, | ||
| }, |
There was a problem hiding this comment.
Add a hassfest translation schema test covering service field definitions without description, since this change relaxes validation and should be protected by a regression test.
| { | ||
| vol.Required("name"): str, | ||
| vol.Required("description"): translation_value_validator, | ||
| vol.Optional("description"): translation_value_validator, | ||
| vol.Optional("example"): translation_value_validator, | ||
| }, |
There was a problem hiding this comment.
Add a hassfest translation schema test covering condition field definitions without description, to ensure the new optional behavior remains supported.
| { | ||
| vol.Required("name"): str, | ||
| vol.Required("description"): translation_value_validator, | ||
| vol.Optional("description"): translation_value_validator, | ||
| vol.Optional("example"): translation_value_validator, | ||
| }, |
There was a problem hiding this comment.
Add a hassfest translation schema test covering trigger field definitions without description, to prevent the schema from accidentally reintroducing description as required.
abmantis
left a comment
There was a problem hiding this comment.
Can we add/update tests as suggested by copilot?
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Proposed change
Make field description optional for non config flows (fields for conditions, services, triggers and object selectors)
Rationale: We have a rule that data entry fields for config flows must have descriptions, but there's no such rule for conditions, services, triggers or object selectors
This PR will allow us to streamline the UI by removing redundant descriptions as in this screenshot:

Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: