Add enum device_class and state options property to sensor entities (#82489)
This commit is contained in:
parent
3feea879dd
commit
ce00f093d6
9 changed files with 272 additions and 8 deletions
|
@ -29,13 +29,14 @@ from homeassistant.const import (
|
|||
VOLUME_CUBIC_FEET,
|
||||
VOLUME_CUBIC_METERS,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, State, split_entity_id
|
||||
from homeassistant.core import HomeAssistant, State, callback, split_entity_id
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity import entity_sources
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from . import (
|
||||
ATTR_LAST_RESET,
|
||||
ATTR_OPTIONS,
|
||||
ATTR_STATE_CLASS,
|
||||
DOMAIN,
|
||||
STATE_CLASS_MEASUREMENT,
|
||||
|
@ -724,3 +725,9 @@ def validate_statistics(
|
|||
)
|
||||
|
||||
return validation_result
|
||||
|
||||
|
||||
@callback
|
||||
def exclude_attributes(hass: HomeAssistant) -> set[str]:
|
||||
"""Exclude attributes from being recorded in the database."""
|
||||
return {ATTR_OPTIONS}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue