diff --git a/docs/core/entity.md b/docs/core/entity.md index fab83404..505be272 100644 --- a/docs/core/entity.md +++ b/docs/core/entity.md @@ -104,7 +104,7 @@ Properties should always only return information from memory and not do I/O (lik | assumed_state | boolean | `False` | Return `True` if the state is based on our assumption instead of reading it from the device. | | available | boolean | `True` | Indicate if Home Assistant is able to read the state and control the underlying device. | | device_class | string | `None` | Extra classification of what the device is. Each domain specifies their own. Device classes can come with extra requirements for unit of measurement and supported features. | -| device_state_attributes | dict | `None` | Extra information to store in the state machine. It needs to be information that further explains the state, it should not be static information like firmware version. | +| extra_state_attributes | dict | `None` | Extra information to store in the state machine. It needs to be information that further explains the state, it should not be static information like firmware version. | | entity_picture | URL | `None` | Url of a picture to show for the entity. | | name | string | `None` | Name of the entity | | should_poll | boolean | `True` | Should Home Assistant check with the entity for an updated state. If set to `False`, entity will need to notify Home Assistant of new updates by calling one of the [schedule update methods](#methods). | diff --git a/docs/dev_101_states.md b/docs/dev_101_states.md index c7124e06..45b86547 100644 --- a/docs/dev_101_states.md +++ b/docs/dev_101_states.md @@ -114,16 +114,17 @@ After a start or a restart of Home Assistant the component will be visible in th

-In order to expose attributes for a platform, you will need to define a property called `device_state_attributes` on the entity class, which will return a dictionary of attributes: +In order to expose attributes for a platform, you will need to define a property called `extra_state_attributes` on the entity class, which will return a dictionary of attributes: ```python @property -def device_state_attributes(self): - """Return device specific state attributes.""" +def extra_state_attributes(self): + """Return entity specific state attributes.""" return self._attributes ``` :::tip -Entities also have a similar property `state_attributes`, which normally doesn't need to be defined by new platforms. This property is used by base components to add standard sets of attributes to a state. Example: The light component uses `state_attributes` to add brightness to the state dictionary. If you are designing a new component, you should define `state_attributes` instead. +Entities also have a similar property `state_attributes`, which should not be overridden by integrations. This property is used by base entity components to add standard sets of attributes to a state. Example: The light component uses `state_attributes` to add brightness to the state dictionary. If you are designing a new integration, you should define `extra_state_attributes` instead. ::: -To get your component included in the Home Assistant releases, follow the steps described in the [Submit your work](development_submitting.md) section. Basically you only need to move your component into the `homeassistant/component/` directory of your fork and create a Pull Request. + +To get your integration included in the Home Assistant releases, follow the steps described in the [Submit your work](development_submitting.md) section. Basically you only need to move your integration into the `homeassistant/component/` directory of your fork and create a Pull Request.