From eaff66477d131c0c0ab5e0eee1d638d0e2ba4af2 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 29 Feb 2024 17:21:00 +0100 Subject: [PATCH] Add icon translations to Intellifire (#111845) --- .../components/intellifire/binary_sensor.py | 6 --- .../components/intellifire/icons.json | 45 +++++++++++++++++++ .../components/intellifire/number.py | 1 - .../components/intellifire/sensor.py | 3 -- .../components/intellifire/switch.py | 1 - 5 files changed, 45 insertions(+), 11 deletions(-) create mode 100644 homeassistant/components/intellifire/icons.json diff --git a/homeassistant/components/intellifire/binary_sensor.py b/homeassistant/components/intellifire/binary_sensor.py index 503b97f183d..b630828d7e9 100644 --- a/homeassistant/components/intellifire/binary_sensor.py +++ b/homeassistant/components/intellifire/binary_sensor.py @@ -39,25 +39,21 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...] IntellifireBinarySensorEntityDescription( key="on_off", # This is the sensor name translation_key="flame", # This is the translation key - icon="mdi:fire", value_fn=lambda data: data.is_on, ), IntellifireBinarySensorEntityDescription( key="timer_on", translation_key="timer_on", - icon="mdi:camera-timer", value_fn=lambda data: data.timer_on, ), IntellifireBinarySensorEntityDescription( key="pilot_light_on", translation_key="pilot_light_on", - icon="mdi:fire-alert", value_fn=lambda data: data.pilot_on, ), IntellifireBinarySensorEntityDescription( key="thermostat_on", translation_key="thermostat_on", - icon="mdi:home-thermometer-outline", value_fn=lambda data: data.thermostat_on, ), IntellifireBinarySensorEntityDescription( @@ -77,7 +73,6 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...] IntellifireBinarySensorEntityDescription( key="error_fan_delay", translation_key="fan_delay_error", - icon="mdi:fan-alert", entity_category=EntityCategory.DIAGNOSTIC, value_fn=lambda data: data.error_fan_delay, device_class=BinarySensorDeviceClass.PROBLEM, @@ -99,7 +94,6 @@ INTELLIFIRE_BINARY_SENSORS: tuple[IntellifireBinarySensorEntityDescription, ...] IntellifireBinarySensorEntityDescription( key="error_fan", translation_key="fan_error", - icon="mdi:fan-alert", entity_category=EntityCategory.DIAGNOSTIC, value_fn=lambda data: data.error_fan, device_class=BinarySensorDeviceClass.PROBLEM, diff --git a/homeassistant/components/intellifire/icons.json b/homeassistant/components/intellifire/icons.json new file mode 100644 index 00000000000..6dca69484b6 --- /dev/null +++ b/homeassistant/components/intellifire/icons.json @@ -0,0 +1,45 @@ +{ + "entity": { + "binary_sensor": { + "flame": { + "default": "mdi:fire" + }, + "timer_on": { + "default": "mdi:camera-timer" + }, + "pilot_light_on": { + "default": "mdi:fire-alert" + }, + "thermostat_on": { + "default": "mdi:home-thermometer-outline" + }, + "fan_delay_error": { + "default": "mdi:fan-alert" + }, + "fan_error": { + "default": "mdi:fan-alert" + } + }, + "number": { + "flame_control": { + "default": "mdi:arrow-expand-vertical" + } + }, + "sensor": { + "flame_height": { + "default": "mdi:fire-circle" + }, + "fan_speed": { + "default": "mdi:fan" + }, + "timer_end_timestamp": { + "default": "mdi:timer-sand" + } + }, + "switch": { + "pilot_light": { + "default": "mdi:fire-alert" + } + } + } +} diff --git a/homeassistant/components/intellifire/number.py b/homeassistant/components/intellifire/number.py index efcafd2acd8..4cedb3de5d9 100644 --- a/homeassistant/components/intellifire/number.py +++ b/homeassistant/components/intellifire/number.py @@ -28,7 +28,6 @@ async def async_setup_entry( description = NumberEntityDescription( key="flame_control", translation_key="flame_control", - icon="mdi:arrow-expand-vertical", ) async_add_entities( diff --git a/homeassistant/components/intellifire/sensor.py b/homeassistant/components/intellifire/sensor.py index c974378fb71..583e2dc22f9 100644 --- a/homeassistant/components/intellifire/sensor.py +++ b/homeassistant/components/intellifire/sensor.py @@ -57,7 +57,6 @@ INTELLIFIRE_SENSORS: tuple[IntellifireSensorEntityDescription, ...] = ( IntellifireSensorEntityDescription( key="flame_height", translation_key="flame_height", - icon="mdi:fire-circle", state_class=SensorStateClass.MEASUREMENT, # UI uses 1-5 for flame height, backing lib uses 0-4 value_fn=lambda data: (data.flameheight + 1), @@ -80,14 +79,12 @@ INTELLIFIRE_SENSORS: tuple[IntellifireSensorEntityDescription, ...] = ( IntellifireSensorEntityDescription( key="fan_speed", translation_key="fan_speed", - icon="mdi:fan", state_class=SensorStateClass.MEASUREMENT, value_fn=lambda data: data.fanspeed, ), IntellifireSensorEntityDescription( key="timer_end_timestamp", translation_key="timer_end_timestamp", - icon="mdi:timer-sand", state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.TIMESTAMP, value_fn=_time_remaining_to_timestamp, diff --git a/homeassistant/components/intellifire/switch.py b/homeassistant/components/intellifire/switch.py index 03e3a2be0a2..161d75de2d8 100644 --- a/homeassistant/components/intellifire/switch.py +++ b/homeassistant/components/intellifire/switch.py @@ -45,7 +45,6 @@ INTELLIFIRE_SWITCHES: tuple[IntellifireSwitchEntityDescription, ...] = ( IntellifireSwitchEntityDescription( key="pilot", translation_key="pilot_light", - icon="mdi:fire-alert", on_fn=lambda control_api: control_api.pilot_on(), off_fn=lambda control_api: control_api.pilot_off(), value_fn=lambda data: data.pilot_on,