Exclude sun attributes from being recorded in the database (#68887)

This commit is contained in:
J. Nick Koston 2022-03-29 23:03:08 -10:00 committed by GitHub
parent ecd43f391f
commit bbcefd6fec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 125 additions and 15 deletions

View 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,
}