Skip to content

Commit

Permalink
Add icon translations to myuplink (home-assistant#111466)
Browse files Browse the repository at this point in the history
  • Loading branch information
astrandb authored Mar 14, 2024
1 parent 7cdec9a commit f95d649
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 11 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/myuplink/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"NIBEF": {
"43161": BinarySensorEntityDescription(
key="elect_add",
icon="mdi:electric-switch",
translation_key="elect_add",
),
},
}
Expand Down
45 changes: 45 additions & 0 deletions homeassistant/components/myuplink/icons.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
4 changes: 2 additions & 2 deletions homeassistant/components/myuplink/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
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",
),
}
Expand All @@ -27,7 +27,7 @@
"NIBEF": {
"40940": NumberEntityDescription(
key="degree_minutes",
icon="mdi:thermometer-lines",
translation_key="degree_minutes",
native_unit_of_measurement="DM",
),
},
Expand Down
10 changes: 5 additions & 5 deletions homeassistant/components/myuplink/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
),
"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",
Expand All @@ -101,22 +101,22 @@
"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": {},
Expand Down
6 changes: 5 additions & 1 deletion homeassistant/components/myuplink/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
"NIBEF": {
"50004": SwitchEntityDescription(
key="temporary_lux",
icon="mdi:water-alert-outline",
translation_key="temporary_lux",
),
"50005": SwitchEntityDescription(
key="boost_ventilation",
translation_key="boost_ventilation",
),
},
}
Expand Down
1 change: 0 additions & 1 deletion tests/components/myuplink/test_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion tests/components/myuplink/test_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}


Expand Down

0 comments on commit f95d649

Please sign in to comment.