mirror of
https://github.com/home-assistant/core
synced 2024-09-03 08:14:07 +02:00
Add icon translations to DSMR (#111411)
* Add icon translations to DSMR * Add icon translations to DSMR
This commit is contained in:
parent
913ee90e1a
commit
7ad1d3e891
24
homeassistant/components/dsmr/icons.json
Normal file
24
homeassistant/components/dsmr/icons.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"electricity_active_tariff": {
|
||||
"default": "mdi:flash"
|
||||
},
|
||||
"short_power_failure_count": {
|
||||
"default": "mdi:flash-off"
|
||||
},
|
||||
"long_power_failure_count": {
|
||||
"default": "mdi:flash-off"
|
||||
},
|
||||
"voltage_swell_l1_count": {
|
||||
"default": "mdi:pulse"
|
||||
},
|
||||
"voltage_swell_l2_count": {
|
||||
"default": "mdi:pulse"
|
||||
},
|
||||
"voltage_swell_l3_count": {
|
||||
"default": "mdi:pulse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -106,7 +106,6 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = (
|
||||
dsmr_versions={"2.2", "4", "5", "5B", "5L"},
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=["low", "normal"],
|
||||
icon="mdi:flash",
|
||||
),
|
||||
DSMRSensorEntityDescription(
|
||||
key="electricity_used_tariff_1",
|
||||
@ -194,7 +193,6 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = (
|
||||
obis_reference=obis_references.SHORT_POWER_FAILURE_COUNT,
|
||||
dsmr_versions={"2.2", "4", "5", "5L"},
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:flash-off",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
DSMRSensorEntityDescription(
|
||||
@ -203,7 +201,6 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = (
|
||||
obis_reference=obis_references.LONG_POWER_FAILURE_COUNT,
|
||||
dsmr_versions={"2.2", "4", "5", "5L"},
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:flash-off",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
DSMRSensorEntityDescription(
|
||||
@ -236,7 +233,6 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = (
|
||||
obis_reference=obis_references.VOLTAGE_SWELL_L1_COUNT,
|
||||
dsmr_versions={"2.2", "4", "5", "5L"},
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:pulse",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
DSMRSensorEntityDescription(
|
||||
@ -245,7 +241,6 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = (
|
||||
obis_reference=obis_references.VOLTAGE_SWELL_L2_COUNT,
|
||||
dsmr_versions={"2.2", "4", "5", "5L"},
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:pulse",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
DSMRSensorEntityDescription(
|
||||
@ -254,7 +249,6 @@ SENSORS: tuple[DSMRSensorEntityDescription, ...] = (
|
||||
obis_reference=obis_references.VOLTAGE_SWELL_L3_COUNT,
|
||||
dsmr_versions={"2.2", "4", "5", "5L"},
|
||||
entity_registry_enabled_default=False,
|
||||
icon="mdi:pulse",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
DSMRSensorEntityDescription(
|
||||
|
@ -22,7 +22,6 @@ from homeassistant.components.sensor import (
|
||||
from homeassistant.const import (
|
||||
ATTR_DEVICE_CLASS,
|
||||
ATTR_FRIENDLY_NAME,
|
||||
ATTR_ICON,
|
||||
ATTR_UNIT_OF_MEASUREMENT,
|
||||
STATE_UNKNOWN,
|
||||
UnitOfEnergy,
|
||||
@ -106,7 +105,6 @@ async def test_default_setup(
|
||||
assert (
|
||||
power_consumption.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.POWER
|
||||
)
|
||||
assert power_consumption.attributes.get(ATTR_ICON) is None
|
||||
assert (
|
||||
power_consumption.attributes.get(ATTR_STATE_CLASS)
|
||||
== SensorStateClass.MEASUREMENT
|
||||
@ -145,7 +143,6 @@ async def test_default_setup(
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_active_tariff")
|
||||
assert active_tariff.state == "low"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENUM
|
||||
assert active_tariff.attributes.get(ATTR_ICON) == "mdi:flash"
|
||||
assert (
|
||||
active_tariff.attributes.get(ATTR_FRIENDLY_NAME)
|
||||
== "Electricity Meter Active tariff"
|
||||
@ -282,7 +279,6 @@ async def test_v4_meter(hass: HomeAssistant, dsmr_connection_fixture) -> None:
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_active_tariff")
|
||||
assert active_tariff.state == "low"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENUM
|
||||
assert active_tariff.attributes.get(ATTR_ICON) == "mdi:flash"
|
||||
assert active_tariff.attributes.get(ATTR_OPTIONS) == ["low", "normal"]
|
||||
assert active_tariff.attributes.get(ATTR_STATE_CLASS) is None
|
||||
assert active_tariff.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
|
||||
@ -369,7 +365,6 @@ async def test_v5_meter(
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_active_tariff")
|
||||
assert active_tariff.state == "low"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENUM
|
||||
assert active_tariff.attributes.get(ATTR_ICON) == "mdi:flash"
|
||||
assert active_tariff.attributes.get(ATTR_OPTIONS) == ["low", "normal"]
|
||||
assert active_tariff.attributes.get(ATTR_STATE_CLASS) is None
|
||||
assert active_tariff.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
|
||||
@ -447,7 +442,6 @@ async def test_luxembourg_meter(hass: HomeAssistant, dsmr_connection_fixture) ->
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_energy_consumption_total")
|
||||
assert active_tariff.state == "123.456"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
|
||||
assert active_tariff.attributes.get(ATTR_ICON) is None
|
||||
assert (
|
||||
active_tariff.attributes.get(ATTR_STATE_CLASS)
|
||||
== SensorStateClass.TOTAL_INCREASING
|
||||
@ -605,7 +599,6 @@ async def test_belgian_meter(hass: HomeAssistant, dsmr_connection_fixture) -> No
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_active_tariff")
|
||||
assert active_tariff.state == "normal"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENUM
|
||||
assert active_tariff.attributes.get(ATTR_ICON) == "mdi:flash"
|
||||
assert active_tariff.attributes.get(ATTR_OPTIONS) == ["low", "normal"]
|
||||
assert active_tariff.attributes.get(ATTR_STATE_CLASS) is None
|
||||
assert active_tariff.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
|
||||
@ -1009,7 +1002,6 @@ async def test_belgian_meter_low(hass: HomeAssistant, dsmr_connection_fixture) -
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_active_tariff")
|
||||
assert active_tariff.state == "low"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENUM
|
||||
assert active_tariff.attributes.get(ATTR_ICON) == "mdi:flash"
|
||||
assert active_tariff.attributes.get(ATTR_OPTIONS) == ["low", "normal"]
|
||||
assert active_tariff.attributes.get(ATTR_STATE_CLASS) is None
|
||||
assert active_tariff.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None
|
||||
@ -1066,7 +1058,6 @@ async def test_swedish_meter(hass: HomeAssistant, dsmr_connection_fixture) -> No
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_energy_consumption_total")
|
||||
assert active_tariff.state == "123.456"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
|
||||
assert active_tariff.attributes.get(ATTR_ICON) is None
|
||||
assert (
|
||||
active_tariff.attributes.get(ATTR_STATE_CLASS)
|
||||
== SensorStateClass.TOTAL_INCREASING
|
||||
@ -1142,7 +1133,6 @@ async def test_easymeter(hass: HomeAssistant, dsmr_connection_fixture) -> None:
|
||||
active_tariff = hass.states.get("sensor.electricity_meter_energy_consumption_total")
|
||||
assert active_tariff.state == "54184.632"
|
||||
assert active_tariff.attributes.get(ATTR_DEVICE_CLASS) == SensorDeviceClass.ENERGY
|
||||
assert active_tariff.attributes.get(ATTR_ICON) is None
|
||||
assert (
|
||||
active_tariff.attributes.get(ATTR_STATE_CLASS)
|
||||
== SensorStateClass.TOTAL_INCREASING
|
||||
|
Loading…
Reference in New Issue
Block a user