Save attribute checkbox state#8010
Conversation
spacegaier
left a comment
There was a problem hiding this comment.
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
|
@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 devtoolsAdditional information
Checklist
If user exposed functionality or configuration variables are added/changed: