-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Replace Entity.device_state_attributes with Entity.extra_state_attributes #47304
Replace Entity.device_state_attributes with Entity.extra_state_attributes #47304
Conversation
I think this makes sense, however, this also opens up the opportunity to do something about
Out developer documentation does not really help either as it seems 😓 And a quick search through our codebase, it is all used mixed up 😢 For example, the |
You mean integrations which override |
No, I mean; maybe we can reduce it to a single thing: |
After some discussion, the conclusion is:
|
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.
✅ LGTM
Created a documentation PR in: home-assistant/developers.home-assistant#837 |
Proposed change
Replace
Entity.device_state_attributes
withEntity.extra_state_attributes
.The name
device_state_attributes
is confusing and the actual device attributes are available fromEntity.device_info
.To be backwards compatible,
Entity.device_state_attributes
is still called if it is implemented andEntity.extra_state_attributes
returnsNone
.Planned follow-up PRs:
Entity.state_attributes
as@final
in component base classesEntity.extra_state_attributes
instead ofEntity.device_state_attributes
Entity.extra_state_attributes
instead ofEntity.state_attributes
Suggested plan for deprecation:
Type of change
Example entry for
configuration.yaml
:# Example configuration.yaml
Additional information
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: