Add icon translations to Modem callerID (#111929)

pull/112001/head
Joost Lekkerkerker 2024-03-01 20:21:10 +01:00 committed by GitHub
parent 23a1c559b2
commit 694c391c6b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 16 additions and 4 deletions

View File

@ -32,7 +32,6 @@ async def async_setup_entry(
class PhoneModemButton(ButtonEntity):
"""Implementation of USB modem caller ID button."""
_attr_icon = "mdi:phone-hangup"
_attr_translation_key = "phone_modem_reject"
_attr_has_entity_name = True

View File

@ -7,7 +7,6 @@ from serial import SerialException
DATA_KEY_API = "api"
DEFAULT_NAME = "Phone Modem"
DOMAIN = "modem_callerid"
ICON = "mdi:phone-classic"
EXCEPTIONS: Final = (
FileNotFoundError,

View File

@ -0,0 +1,14 @@
{
"entity": {
"button": {
"phone_modem_reject": {
"default": "mdi:phone-hangup"
}
},
"sensor": {
"incoming_call": {
"default": "mdi:phone-classic"
}
}
}
}

View File

@ -10,7 +10,7 @@ from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import CID, DATA_KEY_API, DOMAIN, ICON
from .const import CID, DATA_KEY_API, DOMAIN
async def async_setup_entry(
@ -40,10 +40,10 @@ async def async_setup_entry(
class ModemCalleridSensor(SensorEntity):
"""Implementation of USB modem caller ID sensor."""
_attr_icon = ICON
_attr_should_poll = False
_attr_has_entity_name = True
_attr_name = None
_attr_translation_key = "incoming_call"
def __init__(self, api: PhoneModem, server_unique_id: str) -> None:
"""Initialize the sensor."""