mirror of
https://github.com/home-assistant/core.git
synced 2025-06-05 21:57:08 +00:00
Change default icons for Tesla components (#30288)
This commit is contained in:
parent
d0c9a42b81
commit
40e3d6f773
@ -26,7 +26,7 @@ from .config_flow import (
|
|||||||
configured_instances,
|
configured_instances,
|
||||||
validate_input,
|
validate_input,
|
||||||
)
|
)
|
||||||
from .const import DATA_LISTENER, DOMAIN, TESLA_COMPONENTS
|
from .const import DATA_LISTENER, DOMAIN, SENSOR_ICONS, TESLA_COMPONENTS
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -186,6 +186,11 @@ class TeslaDevice(Entity):
|
|||||||
self._name = self.tesla_device.name
|
self._name = self.tesla_device.name
|
||||||
self.tesla_id = slugify(self.tesla_device.uniq_name)
|
self.tesla_id = slugify(self.tesla_device.uniq_name)
|
||||||
self._attributes = {}
|
self._attributes = {}
|
||||||
|
self._icon = (
|
||||||
|
SENSOR_ICONS[self.tesla_device.type]
|
||||||
|
if self.tesla_device.type and self.tesla_device.type in SENSOR_ICONS.keys()
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -197,6 +202,11 @@ class TeslaDevice(Entity):
|
|||||||
"""Return a unique ID."""
|
"""Return a unique ID."""
|
||||||
return self.tesla_id
|
return self.tesla_id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def icon(self):
|
||||||
|
"""Return the icon of the sensor."""
|
||||||
|
return self._icon
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""Return the polling state."""
|
"""Return the polling state."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user