Move icon constants to entity attributes (#90518)
* Move icon constants to attribute * Adjust test
This commit is contained in:
parent
2e0ecf9bd9
commit
d0c38c1e12
29 changed files with 46 additions and 177 deletions
|
@ -18,8 +18,6 @@ from homeassistant.util import Throttle
|
|||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ICON = "mdi:bus-clock"
|
||||
|
||||
CONF_APP_ID = "app_id"
|
||||
CONF_APP_KEY = "app_key"
|
||||
CONF_LINE = "line"
|
||||
|
@ -74,6 +72,7 @@ class TMBSensor(SensorEntity):
|
|||
"""Implementation of a TMB line/stop Sensor."""
|
||||
|
||||
_attr_attribution = "Data provided by Transport Metropolitans de Barcelona"
|
||||
_attr_icon = "mdi:bus-clock"
|
||||
|
||||
def __init__(self, ibus_client, stop, line, name):
|
||||
"""Initialize the sensor."""
|
||||
|
@ -89,11 +88,6 @@ class TMBSensor(SensorEntity):
|
|||
"""Return the name of the sensor."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
"""Return the icon for the frontend."""
|
||||
return ICON
|
||||
|
||||
@property
|
||||
def native_unit_of_measurement(self):
|
||||
"""Return the unit of measurement."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue