Exclude sun attributes from being recorded in the database (#68887)
This commit is contained in:
parent
ecd43f391f
commit
bbcefd6fec
3 changed files with 125 additions and 15 deletions
32
homeassistant/components/sun/recorder.py
Normal file
32
homeassistant/components/sun/recorder.py
Normal file
|
@ -0,0 +1,32 @@
|
|||
"""Integration platform for recorder."""
|
||||
from __future__ import annotations
|
||||
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
from . import (
|
||||
STATE_ATTR_AZIMUTH,
|
||||
STATE_ATTR_ELEVATION,
|
||||
STATE_ATTR_NEXT_DAWN,
|
||||
STATE_ATTR_NEXT_DUSK,
|
||||
STATE_ATTR_NEXT_MIDNIGHT,
|
||||
STATE_ATTR_NEXT_NOON,
|
||||
STATE_ATTR_NEXT_RISING,
|
||||
STATE_ATTR_NEXT_SETTING,
|
||||
STATE_ATTR_RISING,
|
||||
)
|
||||
|
||||
|
||||
@callback
|
||||
def exclude_attributes(hass: HomeAssistant) -> set[str]:
|
||||
"""Exclude sun attributes from being recorded in the database."""
|
||||
return {
|
||||
STATE_ATTR_AZIMUTH,
|
||||
STATE_ATTR_ELEVATION,
|
||||
STATE_ATTR_RISING,
|
||||
STATE_ATTR_NEXT_DAWN,
|
||||
STATE_ATTR_NEXT_DUSK,
|
||||
STATE_ATTR_NEXT_MIDNIGHT,
|
||||
STATE_ATTR_NEXT_NOON,
|
||||
STATE_ATTR_NEXT_RISING,
|
||||
STATE_ATTR_NEXT_SETTING,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue