New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add selectors to ha-form #11534
Add selectors to ha-form #11534
Conversation
src/components/ha-form/types.ts
Outdated
required?: boolean; | ||
optional?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should decided which one to use by default, maybe drop 1 from the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but let's do that in a future PR. We will need to check what is used where.
For the backend, both required and optional fields can have a default, which is filled in when key is omitted. So not so required or optional…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with keeping required
. Let's update it in another PR. It means rewriting all checks for optional
to be !required
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet this has something to do with icons being imported by the supervisor now that we import |
Yep, that's the issue |
442533b
to
8696173
Compare
selector-entity -> ha-entity-picker -> state-badge -> ha-state-icon -> ha-icon -> 💣 |
I've fixed it now by blocking |
{ name: "text", selector: { text: { multiline: false } } }, | ||
{ name: "text_multiline", selector: { text: { multiline: true } } }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive me for my ignorance/lack of knowledge on this part.
Can't we handle the selector options?
As in, would be nice if multiline was not defined by the schema name.
The same issue also returns in, for example, the entity selector. Would be nice if we could pass in data from the flow limiting, e.g., the domain you could select.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the case, the name is just for the demo. These are the same selectors that are used in blueprints and service calls.
I think this is ok. |
Breaking change
Proposed change
Add support for selectors in ha-form.
Goal is to eventually remove all other types and be selector only.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: