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
|
@ -10,7 +10,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||
from .const import DOMAIN
|
||||
|
||||
SWITCH_PREFIX = "Switch"
|
||||
ICON = "mdi:toggle-switch"
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
|
@ -55,6 +54,8 @@ async def async_setup_entry(
|
|||
class SmappeeActuator(SwitchEntity):
|
||||
"""Representation of a Smappee Comport Plug."""
|
||||
|
||||
_attr_icon = "mdi:toggle-switch"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
smappee_base,
|
||||
|
@ -105,11 +106,6 @@ class SmappeeActuator(SwitchEntity):
|
|||
# Switch or comfort plug
|
||||
return self._state == "ON_ON"
|
||||
|
||||
@property
|
||||
def icon(self):
|
||||
"""Icon to use in the frontend."""
|
||||
return ICON
|
||||
|
||||
def turn_on(self, **kwargs: Any) -> None:
|
||||
"""Turn on Comport Plug."""
|
||||
if self._actuator_type in ("SWITCH", "COMFORT_PLUG"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue