From 7b79c218353a767a8ebdc5fe9994e98756000491 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 1 Mar 2024 12:23:08 +0100 Subject: [PATCH] Add icon translations to EZVIZ (#111532) --- homeassistant/components/ezviz/button.py | 4 --- homeassistant/components/ezviz/icons.json | 32 +++++++++++++++++++++++ homeassistant/components/ezviz/number.py | 5 ++-- homeassistant/components/ezviz/select.py | 1 - 4 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 homeassistant/components/ezviz/icons.json diff --git a/homeassistant/components/ezviz/button.py b/homeassistant/components/ezviz/button.py index abc44419075..98608a15149 100644 --- a/homeassistant/components/ezviz/button.py +++ b/homeassistant/components/ezviz/button.py @@ -41,7 +41,6 @@ BUTTON_ENTITIES = ( EzvizButtonEntityDescription( key="ptz_up", translation_key="ptz_up", - icon="mdi:pan", method=lambda pyezviz_client, serial, run: pyezviz_client.ptz_control( "UP", serial, run ), @@ -50,7 +49,6 @@ BUTTON_ENTITIES = ( EzvizButtonEntityDescription( key="ptz_down", translation_key="ptz_down", - icon="mdi:pan", method=lambda pyezviz_client, serial, run: pyezviz_client.ptz_control( "DOWN", serial, run ), @@ -59,7 +57,6 @@ BUTTON_ENTITIES = ( EzvizButtonEntityDescription( key="ptz_left", translation_key="ptz_left", - icon="mdi:pan", method=lambda pyezviz_client, serial, run: pyezviz_client.ptz_control( "LEFT", serial, run ), @@ -68,7 +65,6 @@ BUTTON_ENTITIES = ( EzvizButtonEntityDescription( key="ptz_right", translation_key="ptz_right", - icon="mdi:pan", method=lambda pyezviz_client, serial, run: pyezviz_client.ptz_control( "RIGHT", serial, run ), diff --git a/homeassistant/components/ezviz/icons.json b/homeassistant/components/ezviz/icons.json new file mode 100644 index 00000000000..89b4747ed69 --- /dev/null +++ b/homeassistant/components/ezviz/icons.json @@ -0,0 +1,32 @@ +{ + "entity": { + "button": { + "ptz_up": { + "default": "mdi:pan" + }, + "ptz_down": { + "default": "mdi:pan" + }, + "ptz_left": { + "default": "mdi:pan" + }, + "ptz_right": { + "default": "mdi:pan" + } + }, + "number": { + "detection_sensibility": { + "default": "mdi:eye" + } + }, + "select": { + "alarm_sound_mode": { + "default": "mdi:alarm" + } + } + }, + "services": { + "set_alarm_detection_sensibility": "mdi:motion-sensor", + "wake_device": "mdi:sleep-off" + } +} diff --git a/homeassistant/components/ezviz/number.py b/homeassistant/components/ezviz/number.py index c922173aa87..856d7fe392b 100644 --- a/homeassistant/components/ezviz/number.py +++ b/homeassistant/components/ezviz/number.py @@ -48,7 +48,6 @@ class EzvizNumberEntityDescription( NUMBER_TYPE = EzvizNumberEntityDescription( key="detection_sensibility", translation_key="detection_sensibility", - icon="mdi:eye", entity_category=EntityCategory.CONFIG, native_min_value=0, native_step=1, @@ -68,8 +67,8 @@ async def async_setup_entry( async_add_entities( EzvizNumber(coordinator, camera, value, entry.entry_id) for camera in coordinator.data - for capibility, value in coordinator.data[camera]["supportExt"].items() - if capibility == NUMBER_TYPE.supported_ext + for capability, value in coordinator.data[camera]["supportExt"].items() + if capability == NUMBER_TYPE.supported_ext if value in NUMBER_TYPE.supported_ext_value ) diff --git a/homeassistant/components/ezviz/select.py b/homeassistant/components/ezviz/select.py index 8110cf61a5c..d0e86cb026c 100644 --- a/homeassistant/components/ezviz/select.py +++ b/homeassistant/components/ezviz/select.py @@ -37,7 +37,6 @@ class EzvizSelectEntityDescription( SELECT_TYPE = EzvizSelectEntityDescription( key="alarm_sound_mod", translation_key="alarm_sound_mode", - icon="mdi:alarm", entity_category=EntityCategory.CONFIG, options=["soft", "intensive", "silent"], supported_switch=DeviceSwitchType.ALARM_TONE.value,