-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Area Card Editor: show a list of relevant entities #21117
Conversation
WalkthroughWalkthroughThe updates center on refactoring internal functions to be public for better modularity and usability in the Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant LuiAreaCardEditor as HuiAreaCardEditor
participant DeviceRegistry as DeviceRegistry
participant EntityRegistry as EntityRegistry
User->>LuiAreaCardEditor: Open Area Card Editor
LuiAreaCardEditor->>DeviceRegistry: subscribeDeviceRegistry()
DeviceRegistry-->>LuiAreaCardEditor: Device data
LuiAreaCardEditor->>EntityRegistry: subscribeEntityRegistry()
EntityRegistry-->>LuiAreaCardEditor: Entity data
LuiAreaCardEditor->>LuiAreaCardEditor: Update state with observed and controlled entities
LuiAreaCardEditor-->>User: Display updated UI with entities
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (3)
Additional context usedBiome
Gitleaks
Additional comments not posted (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 2
Outside diff range comments (2)
src/panels/lovelace/editor/config-elements/hui-area-card-editor.ts (1)
Line range hint
323-323
: Avoid using the delete operator for performance reasons.- delete config.camera_view; + config.camera_view = undefined;Using
undefined
assignment instead ofdelete
can help maintain performance, especially in environments where performance is critical.src/panels/lovelace/cards/hui-area-card.ts (1)
Line range hint
222-222
: Declare a type for the variable to avoid implicit 'any' type.let uom: string | undefined;Explicitly declaring the type for
uom
enhances code readability and maintainability by providing clear information about the expected type.
I wonder if this should be part of the area page instead of the card editor. |
Perhaps, thought that might be a lot of information on one page, and it's somewhat disconnected from the area card where it would be relevant to see it. When people get results they don't expect, or see device_classes they didn't expect available in the selector, I'm not sure if they would know to navigate there to find the information. But perhaps more detail on the area page could be part of a solution to this problem, if there was a good way for it to be discoverable from here. |
Closing this as it doesn't appear it will be accepted in anything close to its current form. |
Proposed change
Display the list of entities used in the area card editor. Otherwise this information is quite difficult to find, and often cause unexpected result when there is an extra entity that user doesn't realize.
Perhaps as a further enhancement, the bullet-list could have added checkboxes, which can allow for deselecting/ignoring certain entities from the card.
Also this PR unifies the code for filtering entities in the area between area-card and area-card-editor. Previously they were both implementing the solution in different ways.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
Summary by CodeRabbit
New Features
Refactor
Localization