Add icon translations to Random (#109652)

pull/109883/head
Joost Lekkerkerker 2024-02-04 23:23:10 +01:00 committed by Franck Nijhof
parent d789e83879
commit 02ebf1d7f8
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
3 changed files with 18 additions and 0 deletions

View File

@ -54,6 +54,8 @@ async def async_setup_entry(
class RandomBinarySensor(BinarySensorEntity):
"""Representation of a Random binary sensor."""
_attr_translation_key = "random"
def __init__(self, config: Mapping[str, Any], entry_id: str | None = None) -> None:
"""Initialize the Random binary sensor."""
self._attr_name = config.get(CONF_NAME)

View File

@ -0,0 +1,14 @@
{
"entity": {
"binary_sensor": {
"random": {
"default": "mdi:dice-multiple"
}
},
"sensor": {
"random": {
"default": "mdi:dice-multiple"
}
}
}
}

View File

@ -65,6 +65,8 @@ async def async_setup_entry(
class RandomSensor(SensorEntity):
"""Representation of a Random number sensor."""
_attr_translation_key = "random"
def __init__(self, config: Mapping[str, Any], entry_id: str | None = None) -> None:
"""Initialize the Random sensor."""
self._attr_name = config.get(CONF_NAME)