From a13304be5c8c36cfcee307ef4f08fdcdc18c245e Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 5 Mar 2024 14:20:12 +0100 Subject: [PATCH] Add icon translations to Tolo (#112313) --- .../components/tolo/binary_sensor.py | 2 - homeassistant/components/tolo/button.py | 1 - homeassistant/components/tolo/icons.json | 47 +++++++++++++++++++ homeassistant/components/tolo/number.py | 3 -- homeassistant/components/tolo/select.py | 1 - homeassistant/components/tolo/sensor.py | 4 -- 6 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 homeassistant/components/tolo/icons.json diff --git a/homeassistant/components/tolo/binary_sensor.py b/homeassistant/components/tolo/binary_sensor.py index 124cd45d78b..f8cb442c92f 100644 --- a/homeassistant/components/tolo/binary_sensor.py +++ b/homeassistant/components/tolo/binary_sensor.py @@ -34,7 +34,6 @@ class ToloFlowInBinarySensor(ToloSaunaCoordinatorEntity, BinarySensorEntity): _attr_entity_category = EntityCategory.DIAGNOSTIC _attr_translation_key = "water_in_valve" _attr_device_class = BinarySensorDeviceClass.OPENING - _attr_icon = "mdi:water-plus-outline" def __init__( self, coordinator: ToloSaunaUpdateCoordinator, entry: ConfigEntry @@ -56,7 +55,6 @@ class ToloFlowOutBinarySensor(ToloSaunaCoordinatorEntity, BinarySensorEntity): _attr_entity_category = EntityCategory.DIAGNOSTIC _attr_translation_key = "water_out_valve" _attr_device_class = BinarySensorDeviceClass.OPENING - _attr_icon = "mdi:water-minus-outline" def __init__( self, coordinator: ToloSaunaUpdateCoordinator, entry: ConfigEntry diff --git a/homeassistant/components/tolo/button.py b/homeassistant/components/tolo/button.py index 3b81477ab37..82daa79d1c1 100644 --- a/homeassistant/components/tolo/button.py +++ b/homeassistant/components/tolo/button.py @@ -30,7 +30,6 @@ class ToloLampNextColorButton(ToloSaunaCoordinatorEntity, ButtonEntity): """Button for switching to the next lamp color.""" _attr_entity_category = EntityCategory.CONFIG - _attr_icon = "mdi:palette" _attr_translation_key = "next_color" def __init__( diff --git a/homeassistant/components/tolo/icons.json b/homeassistant/components/tolo/icons.json new file mode 100644 index 00000000000..011df5788b2 --- /dev/null +++ b/homeassistant/components/tolo/icons.json @@ -0,0 +1,47 @@ +{ + "entity": { + "binary_sensor": { + "water_in_valve": { + "default": "mdi:water-plus-outline" + }, + "water_out_valve": { + "default": "mdi:water-minus-outline" + } + }, + "button": { + "next_color": { + "default": "mdi:palette" + } + }, + "number": { + "power_timer": { + "default": "mdi:power-settings" + }, + "salt_bath_timer": { + "default": "mdi:shaker-outline" + }, + "fan_timer": { + "default": "mdi:fan-auto" + } + }, + "select": { + "lamp_mode": { + "default": "mdi:lightbulb-multiple-outline" + } + }, + "sensor": { + "water_level": { + "default": "mdi:waves-arrow-up" + }, + "power_timer_remaining": { + "default": "mdi:power-settings" + }, + "salt_bath_timer_remaining": { + "default": "mdi:shaker-outline" + }, + "fan_timer_remaining": { + "default": "mdi:fan-auto" + } + } + } +} diff --git a/homeassistant/components/tolo/number.py b/homeassistant/components/tolo/number.py index b31b5102394..7cc5d6c0591 100644 --- a/homeassistant/components/tolo/number.py +++ b/homeassistant/components/tolo/number.py @@ -41,7 +41,6 @@ NUMBERS = ( ToloNumberEntityDescription( key="power_timer", translation_key="power_timer", - icon="mdi:power-settings", native_unit_of_measurement=UnitOfTime.MINUTES, native_max_value=POWER_TIMER_MAX, getter=lambda settings: settings.power_timer, @@ -50,7 +49,6 @@ NUMBERS = ( ToloNumberEntityDescription( key="salt_bath_timer", translation_key="salt_bath_timer", - icon="mdi:shaker-outline", native_unit_of_measurement=UnitOfTime.MINUTES, native_max_value=SALT_BATH_TIMER_MAX, getter=lambda settings: settings.salt_bath_timer, @@ -59,7 +57,6 @@ NUMBERS = ( ToloNumberEntityDescription( key="fan_timer", translation_key="fan_timer", - icon="mdi:fan-auto", native_unit_of_measurement=UnitOfTime.MINUTES, native_max_value=FAN_TIMER_MAX, getter=lambda settings: settings.fan_timer, diff --git a/homeassistant/components/tolo/select.py b/homeassistant/components/tolo/select.py index 8e4ecb47f48..26480aa3527 100644 --- a/homeassistant/components/tolo/select.py +++ b/homeassistant/components/tolo/select.py @@ -28,7 +28,6 @@ class ToloLampModeSelect(ToloSaunaCoordinatorEntity, SelectEntity): """TOLO Sauna lamp mode select.""" _attr_entity_category = EntityCategory.CONFIG - _attr_icon = "mdi:lightbulb-multiple-outline" _attr_options = [lamp_mode.name.lower() for lamp_mode in LampMode] _attr_translation_key = "lamp_mode" diff --git a/homeassistant/components/tolo/sensor.py b/homeassistant/components/tolo/sensor.py index ec57612a99f..f9ee5e34307 100644 --- a/homeassistant/components/tolo/sensor.py +++ b/homeassistant/components/tolo/sensor.py @@ -48,7 +48,6 @@ SENSORS = ( key="water_level", translation_key="water_level", entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:waves-arrow-up", native_unit_of_measurement=PERCENTAGE, getter=lambda status: status.water_level_percent, availability_checker=None, @@ -66,7 +65,6 @@ SENSORS = ( key="power_timer_remaining", translation_key="power_timer_remaining", entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:power-settings", native_unit_of_measurement=UnitOfTime.MINUTES, getter=lambda status: status.power_timer, availability_checker=lambda settings, status: status.power_on @@ -76,7 +74,6 @@ SENSORS = ( key="salt_bath_timer_remaining", translation_key="salt_bath_timer_remaining", entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:shaker-outline", native_unit_of_measurement=UnitOfTime.MINUTES, getter=lambda status: status.salt_bath_timer, availability_checker=lambda settings, status: status.salt_bath_on @@ -86,7 +83,6 @@ SENSORS = ( key="fan_timer_remaining", translation_key="fan_timer_remaining", entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:fan-auto", native_unit_of_measurement=UnitOfTime.MINUTES, getter=lambda status: status.fan_timer, availability_checker=lambda settings, status: status.fan_on