Remove attribution from extra state attributes (#76580)
This commit is contained in:
parent
8ecbb85852
commit
dbfba3a951
6 changed files with 17 additions and 26 deletions
|
@ -9,7 +9,7 @@ from fixerio.exceptions import FixerioException
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
|
||||
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME, CONF_TARGET
|
||||
from homeassistant.const import CONF_API_KEY, CONF_NAME, CONF_TARGET
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
@ -61,6 +61,8 @@ def setup_platform(
|
|||
class ExchangeRateSensor(SensorEntity):
|
||||
"""Representation of a Exchange sensor."""
|
||||
|
||||
_attr_attribution = ATTRIBUTION
|
||||
|
||||
def __init__(self, data, name, target):
|
||||
"""Initialize the sensor."""
|
||||
self.data = data
|
||||
|
@ -88,7 +90,6 @@ class ExchangeRateSensor(SensorEntity):
|
|||
"""Return the state attributes."""
|
||||
if self.data.rate is not None:
|
||||
return {
|
||||
ATTR_ATTRIBUTION: ATTRIBUTION,
|
||||
ATTR_EXCHANGE_RATE: self.data.rate["rates"][self._target],
|
||||
ATTR_TARGET: self._target,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue