Move icon constants to entity attributes (#90518)

* Move icon constants to attribute

* Adjust test
This commit is contained in:
epenet
2023-03-31 09:34:17 +02:00
committed by GitHub
parent 2e0ecf9bd9
commit d0c38c1e12
29 changed files with 46 additions and 177 deletions
+2 -4
View File
@@ -3,9 +3,7 @@ from unittest.mock import MagicMock
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
from homeassistant.components.srp_energy.const import (
ATTRIBUTION,
DEFAULT_NAME,
ICON,
SENSOR_NAME,
SENSOR_TYPE,
SRP_ENERGY_DOMAIN,
@@ -91,10 +89,10 @@ async def test_srp_entity(hass: HomeAssistant) -> None:
assert srp_entity.unique_id == SENSOR_TYPE
assert srp_entity.state is None
assert srp_entity.unit_of_measurement == UnitOfEnergy.KILO_WATT_HOUR
assert srp_entity.icon == ICON
assert srp_entity.icon == "mdi:flash"
assert srp_entity.usage == "2.00"
assert srp_entity.should_poll is False
assert srp_entity.attribution == ATTRIBUTION
assert srp_entity.attribution == "Powered by SRP Energy"
assert srp_entity.available is not None
assert srp_entity.device_class is SensorDeviceClass.ENERGY
assert srp_entity.state_class is SensorStateClass.TOTAL_INCREASING