mirror of
https://github.com/elisspace/core.git
synced 2026-09-29 13:59:54 +00:00
Move icon constants to entity attributes (#90518)
* Move icon constants to attribute * Adjust test
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user