Add icon translations to myuplink (#111466)

pull/113471/head
Åke Strandberg 2024-03-15 00:47:10 +01:00 committed by GitHub
parent 7cdec9aeeb
commit f95d649f44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 58 additions and 11 deletions

View File

@ -20,7 +20,7 @@ CATEGORY_BASED_DESCRIPTIONS: dict[str, dict[str, BinarySensorEntityDescription]]
"NIBEF": {
"43161": BinarySensorEntityDescription(
key="elect_add",
icon="mdi:electric-switch",
translation_key="elect_add",
),
},
}

View File

@ -0,0 +1,45 @@
{
"entity": {
"binary_sensor": {
"elect_add": {
"default": "mdi:electric-switch",
"state": {
"on": "mdi:electric-switch-closed"
}
}
},
"number": {
"degree_minutes": {
"default": "mdi:thermometer-lines"
}
},
"sensor": {
"airflow": {
"default": "mdi:weather-windy"
},
"elect_add": {
"default": "mdi:heat-wave"
},
"fan_mode": {
"default": "mdi:fan"
},
"priority": {
"default": "mdi:priority-high"
},
"status_compressor": {
"default": "mdi:heat-pump-outline"
}
},
"switch": {
"boost_ventilation": {
"default": "mdi:fan-plus"
},
"temporary_lux": {
"default": "mdi:water-alert-outline",
"state": {
"on": "mdi:water-alert"
}
}
}
}
}

View File

@ -18,7 +18,7 @@ from .helpers import find_matching_platform
DEVICE_POINT_UNIT_DESCRIPTIONS: dict[str, NumberEntityDescription] = {
"DM": NumberEntityDescription(
key="degree_minutes",
icon="mdi:thermometer-lines",
translation_key="degree_minutes",
native_unit_of_measurement="DM",
),
}
@ -27,7 +27,7 @@ CATEGORY_BASED_DESCRIPTIONS: dict[str, dict[str, NumberEntityDescription]] = {
"NIBEF": {
"40940": NumberEntityDescription(
key="degree_minutes",
icon="mdi:thermometer-lines",
translation_key="degree_minutes",
native_unit_of_measurement="DM",
),
},

View File

@ -81,10 +81,10 @@ DEVICE_POINT_UNIT_DESCRIPTIONS: dict[str, SensorEntityDescription] = {
),
"m3/h": SensorEntityDescription(
key="airflow",
translation_key="airflow",
device_class=SensorDeviceClass.VOLUME_FLOW_RATE,
state_class=SensorStateClass.MEASUREMENT,
native_unit_of_measurement=UnitOfVolumeFlowRate.CUBIC_METERS_PER_HOUR,
icon="mdi:weather-windy",
),
"s": SensorEntityDescription(
key="seconds",
@ -101,22 +101,22 @@ CATEGORY_BASED_DESCRIPTIONS: dict[str, dict[str, SensorEntityDescription]] = {
"NIBEF": {
"43108": SensorEntityDescription(
key="fan_mode",
icon="mdi:fan",
translation_key="fan_mode",
),
"43427": SensorEntityDescription(
key="status_compressor",
translation_key="status_compressor",
device_class=SensorDeviceClass.ENUM,
icon="mdi:heat-pump-outline",
),
"49993": SensorEntityDescription(
key="elect_add",
translation_key="elect_add",
device_class=SensorDeviceClass.ENUM,
icon="mdi:heat-wave",
),
"49994": SensorEntityDescription(
key="priority",
translation_key="priority",
device_class=SensorDeviceClass.ENUM,
icon="mdi:priority-high",
),
},
"NIBE": {},

View File

@ -21,7 +21,11 @@ CATEGORY_BASED_DESCRIPTIONS: dict[str, dict[str, SwitchEntityDescription]] = {
"NIBEF": {
"50004": SwitchEntityDescription(
key="temporary_lux",
icon="mdi:water-alert-outline",
translation_key="temporary_lux",
),
"50005": SwitchEntityDescription(
key="boost_ventilation",
translation_key="boost_ventilation",
),
},
}

View File

@ -42,7 +42,6 @@ async def test_attributes(
assert state.state == "-875.0"
assert state.attributes == {
"friendly_name": ENTITY_FRIENDLY_NAME,
"icon": "mdi:thermometer-lines",
"min": -3000,
"max": 3000,
"mode": "auto",

View File

@ -47,7 +47,6 @@ async def test_attributes(
assert state.state == STATE_OFF
assert state.attributes == {
"friendly_name": ENTITY_FRIENDLY_NAME,
"icon": "mdi:water-alert-outline",
}