From d89bfe79f9f081ff8eb55e5b8d90aa2b0a025edd Mon Sep 17 00:00:00 2001 From: Chris Talkington Date: Tue, 4 Aug 2020 19:00:05 -0500 Subject: [PATCH] Allow device class to control icons for tesla (#37526) --- homeassistant/components/tesla/__init__.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/tesla/__init__.py b/homeassistant/components/tesla/__init__.py index 82c98518f48..67ebe90669d 100644 --- a/homeassistant/components/tesla/__init__.py +++ b/homeassistant/components/tesla/__init__.py @@ -15,12 +15,10 @@ from homeassistant.const import ( CONF_SCAN_INTERVAL, CONF_TOKEN, CONF_USERNAME, - DEVICE_CLASS_BATTERY, ) from homeassistant.core import callback from homeassistant.helpers import aiohttp_client, config_validation as cv from homeassistant.helpers.entity import Entity -from homeassistant.helpers.icon import icon_for_battery_level from homeassistant.util import slugify from .config_flow import ( @@ -223,14 +221,8 @@ class TeslaDevice(Entity): @property def icon(self): """Return the icon of the sensor.""" - if ( - self.device_class == DEVICE_CLASS_BATTERY - and self.tesla_device.has_battery() - ): - return icon_for_battery_level( - battery_level=self.tesla_device.battery_level(), - charging=self.tesla_device.battery_charging(), - ) + if self.device_class: + return None return self._icon