Add extra state attributes to goalzero (#52932)
* Add extra state attributes to goalzero * tweak
This commit is contained in:
parent
059a9bc8ed
commit
a9b9c4f13c
3 changed files with 20 additions and 3 deletions
|
@ -7,7 +7,7 @@ from homeassistant.components.binary_sensor import DOMAIN as DOMAIN_BINARY_SENSO
|
|||
from homeassistant.components.sensor import DOMAIN as DOMAIN_SENSOR
|
||||
from homeassistant.components.switch import DOMAIN as DOMAIN_SWITCH
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_HOST, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
|
@ -17,7 +17,13 @@ from homeassistant.helpers.update_coordinator import (
|
|||
UpdateFailed,
|
||||
)
|
||||
|
||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN, MIN_TIME_BETWEEN_UPDATES
|
||||
from .const import (
|
||||
ATTRIBUTION,
|
||||
DATA_KEY_API,
|
||||
DATA_KEY_COORDINATOR,
|
||||
DOMAIN,
|
||||
MIN_TIME_BETWEEN_UPDATES,
|
||||
)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
@ -74,6 +80,8 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry):
|
|||
class YetiEntity(CoordinatorEntity):
|
||||
"""Representation of a Goal Zero Yeti entity."""
|
||||
|
||||
_attr_extra_state_attributes = {ATTR_ATTRIBUTION: ATTRIBUTION}
|
||||
|
||||
def __init__(self, api, coordinator, name, server_unique_id):
|
||||
"""Initialize a Goal Zero Yeti entity."""
|
||||
super().__init__(coordinator)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue