From 91b2dd4b83b7bede3c9bb1f98f93ade62309f99c Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Mon, 4 Mar 2024 17:20:27 +0100 Subject: [PATCH] Add icon translations to Sensibo (#112222) * Add icon translations to Sensibo * Add icon translations to Sensibo * Add icon translations to Sensibo --- .../components/sensibo/binary_sensor.py | 3 -- homeassistant/components/sensibo/button.py | 1 - homeassistant/components/sensibo/icons.json | 54 +++++++++++++++++++ homeassistant/components/sensibo/select.py | 2 - homeassistant/components/sensibo/sensor.py | 9 ---- homeassistant/components/sensibo/switch.py | 2 - homeassistant/components/sensibo/update.py | 1 - .../sensibo/snapshots/test_sensor.ambr | 1 - 8 files changed, 54 insertions(+), 19 deletions(-) create mode 100644 homeassistant/components/sensibo/icons.json diff --git a/homeassistant/components/sensibo/binary_sensor.py b/homeassistant/components/sensibo/binary_sensor.py index 5cd71a2b0e4..c619bf8a9be 100644 --- a/homeassistant/components/sensibo/binary_sensor.py +++ b/homeassistant/components/sensibo/binary_sensor.py @@ -70,13 +70,11 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionBinarySensorEntityDescription, ...] = ( key="is_main_sensor", translation_key="is_main_sensor", entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:connection", value_fn=lambda data: data.is_main_sensor, ), SensiboMotionBinarySensorEntityDescription( key="motion", device_class=BinarySensorDeviceClass.MOTION, - icon="mdi:motion-sensor", value_fn=lambda data: data.motion, ), ) @@ -86,7 +84,6 @@ MOTION_DEVICE_SENSOR_TYPES: tuple[SensiboDeviceBinarySensorEntityDescription, .. key="room_occupied", translation_key="room_occupied", device_class=BinarySensorDeviceClass.MOTION, - icon="mdi:motion-sensor", value_fn=lambda data: data.room_occupied, ), ) diff --git a/homeassistant/components/sensibo/button.py b/homeassistant/components/sensibo/button.py index 942f7eaeb00..5f7c7a88f41 100644 --- a/homeassistant/components/sensibo/button.py +++ b/homeassistant/components/sensibo/button.py @@ -34,7 +34,6 @@ class SensiboButtonEntityDescription( DEVICE_BUTTON_TYPES = SensiboButtonEntityDescription( key="reset_filter", translation_key="reset_filter", - icon="mdi:air-filter", entity_category=EntityCategory.CONFIG, data_key="filter_clean", ) diff --git a/homeassistant/components/sensibo/icons.json b/homeassistant/components/sensibo/icons.json new file mode 100644 index 00000000000..e26840e48eb --- /dev/null +++ b/homeassistant/components/sensibo/icons.json @@ -0,0 +1,54 @@ +{ + "entity": { + "binary_sensor": { + "is_main_sensor": { + "default": "mdi:connection" + } + }, + "button": { + "reset_filter": { + "default": "mdi:air-filter" + } + }, + "select": { + "horizontalswing": { + "default": "mdi:air-conditioner" + }, + "light": { + "default": "mdi:flashlight" + } + }, + "sensor": { + "filter_last_reset": { + "default": "mdi:timer" + }, + "battery_voltage": { + "default": "mdi:battery" + }, + "sensitivity": { + "default": "mdi:air-filter" + }, + "timer_time": { + "default": "mdi:timer" + }, + "airq_tvoc": { + "default": "mdi:air-filter" + } + }, + "switch": { + "timer_on_switch": { + "default": "mdi:timer" + }, + "climate_react_switch": { + "default": "mdi:wizard-hat" + } + } + }, + "services": { + "assume_state": "mdi:shape-outline", + "enable_timer": "mdi:timer-play", + "enable_pure_boost": "mdi:air-filter", + "full_state": "mdi:shape", + "enable_climate_react": "mdi:wizard-hat" + } +} diff --git a/homeassistant/components/sensibo/select.py b/homeassistant/components/sensibo/select.py index bbac3fbdbd0..9e6179dc1c4 100644 --- a/homeassistant/components/sensibo/select.py +++ b/homeassistant/components/sensibo/select.py @@ -41,7 +41,6 @@ DEVICE_SELECT_TYPES = ( SensiboSelectEntityDescription( key="horizontalSwing", data_key="horizontal_swing_mode", - icon="mdi:air-conditioner", value_fn=lambda data: data.horizontal_swing_mode, options_fn=lambda data: data.horizontal_swing_modes, translation_key="horizontalswing", @@ -50,7 +49,6 @@ DEVICE_SELECT_TYPES = ( SensiboSelectEntityDescription( key="light", data_key="light_mode", - icon="mdi:flashlight", value_fn=lambda data: data.light_mode, options_fn=lambda data: data.light_modes, translation_key="light", diff --git a/homeassistant/components/sensibo/sensor.py b/homeassistant/components/sensibo/sensor.py index 805b888204b..ddbc0561d2f 100644 --- a/homeassistant/components/sensibo/sensor.py +++ b/homeassistant/components/sensibo/sensor.py @@ -69,7 +69,6 @@ FILTER_LAST_RESET_DESCRIPTION = SensiboDeviceSensorEntityDescription( key="filter_last_reset", translation_key="filter_last_reset", device_class=SensorDeviceClass.TIMESTAMP, - icon="mdi:timer", value_fn=lambda data: data.filter_last_reset, extra_fn=None, ) @@ -82,7 +81,6 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = ( entity_category=EntityCategory.DIAGNOSTIC, native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:wifi", value_fn=lambda data: data.rssi, entity_registry_enabled_default=False, ), @@ -93,7 +91,6 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = ( entity_category=EntityCategory.DIAGNOSTIC, native_unit_of_measurement=UnitOfElectricPotential.VOLT, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:battery", value_fn=lambda data: data.battery_voltage, ), SensiboMotionSensorEntityDescription( @@ -101,7 +98,6 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = ( device_class=SensorDeviceClass.HUMIDITY, native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:water", value_fn=lambda data: data.humidity, ), SensiboMotionSensorEntityDescription( @@ -109,7 +105,6 @@ MOTION_SENSOR_TYPES: tuple[SensiboMotionSensorEntityDescription, ...] = ( device_class=SensorDeviceClass.TEMPERATURE, native_unit_of_measurement=UnitOfTemperature.CELSIUS, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:thermometer", value_fn=lambda data: data.temperature, ), ) @@ -119,14 +114,12 @@ PURE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( device_class=SensorDeviceClass.PM25, native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:air-filter", value_fn=lambda data: data.pm25, extra_fn=None, ), SensiboDeviceSensorEntityDescription( key="pure_sensitivity", translation_key="sensitivity", - icon="mdi:air-filter", value_fn=lambda data: data.pure_sensitivity, extra_fn=None, ), @@ -138,7 +131,6 @@ DEVICE_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( key="timer_time", translation_key="timer_time", device_class=SensorDeviceClass.TIMESTAMP, - icon="mdi:timer", value_fn=lambda data: data.timer_time, extra_fn=lambda data: {"id": data.timer_id, "turn_on": data.timer_state_on}, ), @@ -188,7 +180,6 @@ AIRQ_SENSOR_TYPES: tuple[SensiboDeviceSensorEntityDescription, ...] = ( translation_key="airq_tvoc", native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION, state_class=SensorStateClass.MEASUREMENT, - icon="mdi:air-filter", value_fn=lambda data: data.tvoc, extra_fn=None, ), diff --git a/homeassistant/components/sensibo/switch.py b/homeassistant/components/sensibo/switch.py index 0911985ed7d..be56759fb95 100644 --- a/homeassistant/components/sensibo/switch.py +++ b/homeassistant/components/sensibo/switch.py @@ -47,7 +47,6 @@ DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = ( key="timer_on_switch", translation_key="timer_on_switch", device_class=SwitchDeviceClass.SWITCH, - icon="mdi:timer", value_fn=lambda data: data.timer_on, extra_fn=lambda data: {"id": data.timer_id, "turn_on": data.timer_state_on}, command_on="async_turn_on_timer", @@ -58,7 +57,6 @@ DEVICE_SWITCH_TYPES: tuple[SensiboDeviceSwitchEntityDescription, ...] = ( key="climate_react_switch", translation_key="climate_react_switch", device_class=SwitchDeviceClass.SWITCH, - icon="mdi:wizard-hat", value_fn=lambda data: data.smart_on, extra_fn=lambda data: {"type": data.smart_type}, command_on="async_turn_on_off_smart", diff --git a/homeassistant/components/sensibo/update.py b/homeassistant/components/sensibo/update.py index c51d57dd9d1..b2dc31aa068 100644 --- a/homeassistant/components/sensibo/update.py +++ b/homeassistant/components/sensibo/update.py @@ -43,7 +43,6 @@ DEVICE_SENSOR_TYPES: tuple[SensiboDeviceUpdateEntityDescription, ...] = ( key="fw_ver_available", device_class=UpdateDeviceClass.FIRMWARE, entity_category=EntityCategory.DIAGNOSTIC, - icon="mdi:rocket-launch", value_version=lambda data: data.fw_ver, value_available=lambda data: data.fw_ver_available, ), diff --git a/tests/components/sensibo/snapshots/test_sensor.ambr b/tests/components/sensibo/snapshots/test_sensor.ambr index 4522071049d..d645bdbd383 100644 --- a/tests/components/sensibo/snapshots/test_sensor.ambr +++ b/tests/components/sensibo/snapshots/test_sensor.ambr @@ -3,7 +3,6 @@ ReadOnlyDict({ 'device_class': 'pm25', 'friendly_name': 'Kitchen PM2.5', - 'icon': 'mdi:air-filter', 'state_class': , 'unit_of_measurement': 'µg/m³', })