Move definition of attributes excluded from history to entity classes (#100430)
* Move definition of attributes excluded from history to entity classes * Revert change which should be in a follow-up PR * Fix sun unrecorded attributes * Fix input_select unrecorded attributes
This commit is contained in:
parent
aed3ba3acd
commit
df73850f56
65 changed files with 143 additions and 558 deletions
|
@ -22,9 +22,6 @@ from homeassistant.helpers import collection
|
|||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity import ToggleEntity
|
||||
from homeassistant.helpers.entity_component import EntityComponent
|
||||
from homeassistant.helpers.integration_platform import (
|
||||
async_process_integration_platform_for_component,
|
||||
)
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
import homeassistant.helpers.service
|
||||
from homeassistant.helpers.storage import Store
|
||||
|
@ -94,10 +91,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||
"""Set up an input boolean."""
|
||||
component = EntityComponent[InputBoolean](_LOGGER, DOMAIN, hass)
|
||||
|
||||
# Process integration platforms right away since
|
||||
# we will create entities before firing EVENT_COMPONENT_LOADED
|
||||
await async_process_integration_platform_for_component(hass, DOMAIN)
|
||||
|
||||
id_manager = collection.IDManager()
|
||||
|
||||
yaml_collection = collection.YamlCollection(
|
||||
|
@ -156,6 +149,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
|||
class InputBoolean(collection.CollectionEntity, ToggleEntity, RestoreEntity):
|
||||
"""Representation of a boolean input."""
|
||||
|
||||
_unrecorded_attributes = frozenset({ATTR_EDITABLE})
|
||||
|
||||
_attr_should_poll = False
|
||||
editable: bool
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
"""Integration platform for recorder."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.const import ATTR_EDITABLE
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
|
||||
@callback
|
||||
def exclude_attributes(hass: HomeAssistant) -> set[str]:
|
||||
"""Exclude editable hint from being recorded in the database."""
|
||||
return {ATTR_EDITABLE}
|
Loading…
Add table
Add a link
Reference in a new issue