-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Save attribute checkbox state #8010
Conversation
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.
Two points:
- I propose to rename the storage parameter, so that the area/topic comes first: "devToolsShowAttributes". That would more closely match existing stored parameters such as "sidebarPanelOrder".
- There is already coding in HA how to handle local storage parameters. That should perhaps be reused. See
frontend/src/components/ha-sidebar.ts
Lines 191 to 194 in c196549
@LocalStorage("sidebarPanelOrder", true, { attribute: false, }) private _panelOrder: string[] = [];
@spacegaier Could you point me how to use the localStorage decorator? I skimmed through the code, but I couldn't figure out the parameter order. |
What do you mean by "property order"? Never used local storage in HA myself. |
I mean how to use it. I can see that the first thing you pass to |
It's all defined in the HA coding: frontend/src/common/decorators/local-storage.ts Lines 85 to 89 in c196549
Second parameter seems to indicate whether it's a property and if it is, then the value is automatically read from it by the looks of it. So it is basically subscribing to value changes (changes introduced here #6776). |
This is not a typescript file and not a Lit element, so you cant use that decorator without converting it first. |
Proposed change
Save whether or not the attribute checkbox is checked in localStorage. This can help if you have a lot of entities, so you don't have to wait forever to load the attributes.
Type of change
Example configuration
# Go into the states tab of devtools
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: