mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Add icon translations to P1 monitor (#111998)
* Add icon translations to P1 monitor * Add icon translations to P1 monitor
This commit is contained in:
parent
0c2cf881ac
commit
0e0c1d337f
9
homeassistant/components/p1_monitor/icons.json
Normal file
9
homeassistant/components/p1_monitor/icons.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"energy_tariff_period": {
|
||||
"default": "mdi:calendar-clock"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -88,7 +88,6 @@ SENSORS_SMARTMETER: tuple[SensorEntityDescription, ...] = (
|
||||
SensorEntityDescription(
|
||||
key="energy_tariff_period",
|
||||
translation_key="energy_tariff_period",
|
||||
icon="mdi:calendar-clock",
|
||||
),
|
||||
)
|
||||
|
||||
|
@ -13,7 +13,6 @@ from homeassistant.components.sensor import (
|
||||
from homeassistant.const import (
|
||||
ATTR_DEVICE_CLASS,
|
||||
ATTR_FRIENDLY_NAME,
|
||||
ATTR_ICON,
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
CURRENCY_EURO,
|
||||
UnitOfElectricCurrent,
|
||||
@ -47,7 +46,6 @@ async def test_smartmeter(
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfPower.WATT
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.POWER
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
state = hass.states.get("sensor.smartmeter_energy_consumption_high_tariff")
|
||||
entry = entity_registry.async_get(
|
||||
@ -64,7 +62,6 @@ async def test_smartmeter(
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.TOTAL_INCREASING
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfEnergy.KILO_WATT_HOUR
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
state = hass.states.get("sensor.smartmeter_energy_tariff_period")
|
||||
entry = entity_registry.async_get("sensor.smartmeter_energy_tariff_period")
|
||||
@ -73,7 +70,6 @@ async def test_smartmeter(
|
||||
assert entry.unique_id == f"{entry_id}_smartmeter_energy_tariff_period"
|
||||
assert state.state == "high"
|
||||
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "SmartMeter Energy tariff period"
|
||||
assert state.attributes.get(ATTR_ICON) == "mdi:calendar-clock"
|
||||
assert ATTR_UNIT_OF_MEASUREMENT not in state.attributes
|
||||
assert ATTR_DEVICE_CLASS not in state.attributes
|
||||
|
||||
@ -109,7 +105,6 @@ async def test_phases(
|
||||
state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfElectricPotential.VOLT
|
||||
)
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.VOLTAGE
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
state = hass.states.get("sensor.phases_current_phase_l1")
|
||||
entry = entity_registry.async_get("sensor.phases_current_phase_l1")
|
||||
@ -123,7 +118,6 @@ async def test_phases(
|
||||
state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfElectricCurrent.AMPERE
|
||||
)
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.CURRENT
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
state = hass.states.get("sensor.phases_power_consumed_phase_l1")
|
||||
entry = entity_registry.async_get("sensor.phases_power_consumed_phase_l1")
|
||||
@ -135,7 +129,6 @@ async def test_phases(
|
||||
assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT
|
||||
assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfPower.WATT
|
||||
assert state.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.POWER
|
||||
assert ATTR_ICON not in state.attributes
|
||||
|
||||
assert entry.device_id
|
||||
device_entry = device_registry.async_get(entry.device_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user