Add icon translations to Ring (#112212)

* Add icon translations to Ring

* Add icon translations to Ring
This commit is contained in:
Joost Lekkerkerker 2024-03-05 08:45:33 +01:00 committed by GitHub
parent 85aedbc200
commit a3a758bd17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 32 additions and 10 deletions

View File

@ -0,0 +1,32 @@
{
"entity": {
"sensor": {
"last_activity": {
"default": "mdi:history"
},
"last_ding": {
"default": "mdi:history"
},
"last_motion": {
"default": "mdi:history"
},
"volume": {
"default": "mdi:bell-ring"
},
"wifi_signal_category": {
"default": "mdi:wifi"
},
"wifi_signal_strength": {
"default": "mdi:wifi"
}
},
"switch": {
"siren": {
"default": "mdi:alarm-bell"
}
}
},
"services": {
"update": "mdi:refresh"
}
}

View File

@ -171,7 +171,6 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = (
key="last_activity",
translation_key="last_activity",
category=["doorbots", "authorized_doorbots", "stickup_cams"],
icon="mdi:history",
device_class=SensorDeviceClass.TIMESTAMP,
cls=HistoryRingSensor,
),
@ -179,7 +178,6 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = (
key="last_ding",
translation_key="last_ding",
category=["doorbots", "authorized_doorbots"],
icon="mdi:history",
kind="ding",
device_class=SensorDeviceClass.TIMESTAMP,
cls=HistoryRingSensor,
@ -188,7 +186,6 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = (
key="last_motion",
translation_key="last_motion",
category=["doorbots", "authorized_doorbots", "stickup_cams"],
icon="mdi:history",
kind="motion",
device_class=SensorDeviceClass.TIMESTAMP,
cls=HistoryRingSensor,
@ -197,14 +194,12 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = (
key="volume",
translation_key="volume",
category=["chimes", "doorbots", "authorized_doorbots", "stickup_cams"],
icon="mdi:bell-ring",
cls=RingSensor,
),
RingSensorEntityDescription(
key="wifi_signal_category",
translation_key="wifi_signal_category",
category=["chimes", "doorbots", "authorized_doorbots", "stickup_cams"],
icon="mdi:wifi",
entity_category=EntityCategory.DIAGNOSTIC,
cls=HealthDataRingSensor,
),
@ -213,7 +208,6 @@ SENSOR_TYPES: tuple[RingSensorEntityDescription, ...] = (
translation_key="wifi_signal_strength",
category=["chimes", "doorbots", "authorized_doorbots", "stickup_cams"],
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
icon="mdi:wifi",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_category=EntityCategory.DIAGNOSTIC,
cls=HealthDataRingSensor,

View File

@ -19,8 +19,6 @@ from .entity import RingEntity
_LOGGER = logging.getLogger(__name__)
SIREN_ICON = "mdi:alarm-bell"
# It takes a few seconds for the API to correctly return an update indicating
# that the changes have been made. Once we request a change (i.e. a light
@ -65,7 +63,6 @@ class SirenSwitch(BaseRingSwitch):
"""Creates a switch to turn the ring cameras siren on and off."""
_attr_translation_key = "siren"
_attr_icon = SIREN_ICON
def __init__(self, device: RingGeneric, coordinator: RingDataCoordinator) -> None:
"""Initialize the switch for a device with a siren."""

View File

@ -45,7 +45,6 @@ async def test_siren_on_reports_correctly(
state = hass.states.get("switch.internal_siren")
assert state.state == "on"
assert state.attributes.get("friendly_name") == "Internal Siren"
assert state.attributes.get("icon") == "mdi:alarm-bell"
async def test_siren_can_be_turned_on(