diff --git a/homeassistant/components/wled/icons.json b/homeassistant/components/wled/icons.json new file mode 100644 index 0000000000000000000000000000000000000000..65de1d0f98559f1822df6d2623ac457768f2fa29 --- /dev/null +++ b/homeassistant/components/wled/icons.json @@ -0,0 +1,68 @@ +{ + "entity": { + "light": { + "main": { + "default": "mdi:led-strip-variant" + }, + "segment": { + "default": "mdi:led-strip-variant" + } + }, + "number": { + "speed": { + "default": "mdi:speedometer" + } + }, + "select": { + "preset": { + "default": "mdi:playlist-play" + }, + "playlist": { + "default": "mdi:play-speed" + }, + "color_palette": { + "default": "mdi:palette-outline" + }, + "segment_color_palette": { + "default": "mdi:palette-outline" + }, + "live_override": { + "default": "mdi:theater" + } + }, + "sensor": { + "free_heap": { + "default": "mdi:memory" + }, + "wifi_signal": { + "default": "mdi:wifi" + }, + "wifi_channel": { + "default": "mdi:wifi" + }, + "wifi_bssid": { + "default": "mdi:wifi" + }, + "ip": { + "default": "mdi:ip-network" + } + }, + "switch": { + "nightlight": { + "default": "mdi:weather-night" + }, + "sync_send": { + "default": "mdi:upload-network-outline" + }, + "sync_receive": { + "default": "mdi:download-network-outline" + }, + "reverse": { + "default": "mdi:swap-horizontal-bold" + }, + "segment_reverse": { + "default": "mdi:swap-horizontal-bold" + } + } + } +} diff --git a/homeassistant/components/wled/light.py b/homeassistant/components/wled/light.py index 5ca86978f0f94a776eeda2dd911a0565df612447..4327261d4be73c81bb36dbd386bb167a3f3737e6 100644 --- a/homeassistant/components/wled/light.py +++ b/homeassistant/components/wled/light.py @@ -51,7 +51,6 @@ class WLEDMainLight(WLEDEntity, LightEntity): """Defines a WLED main light.""" _attr_color_mode = ColorMode.BRIGHTNESS - _attr_icon = "mdi:led-strip-variant" _attr_translation_key = "main" _attr_supported_features = LightEntityFeature.TRANSITION _attr_supported_color_modes = {ColorMode.BRIGHTNESS} @@ -103,7 +102,7 @@ class WLEDSegmentLight(WLEDEntity, LightEntity): """Defines a WLED light based on a segment.""" _attr_supported_features = LightEntityFeature.EFFECT | LightEntityFeature.TRANSITION - _attr_icon = "mdi:led-strip-variant" + _attr_translation_key = "segment" def __init__( self, @@ -121,7 +120,6 @@ class WLEDSegmentLight(WLEDEntity, LightEntity): if segment == 0: self._attr_name = None else: - self._attr_translation_key = "segment" self._attr_translation_placeholders = {"segment": str(segment)} self._attr_unique_id = ( diff --git a/homeassistant/components/wled/number.py b/homeassistant/components/wled/number.py index 5b88165207ffd889426394c75707af6a12165981..fd734c07fbced55cb0acc983a5417b2a8ac052df 100644 --- a/homeassistant/components/wled/number.py +++ b/homeassistant/components/wled/number.py @@ -50,7 +50,6 @@ NUMBERS = [ WLEDNumberEntityDescription( key=ATTR_SPEED, translation_key="speed", - icon="mdi:speedometer", entity_category=EntityCategory.CONFIG, native_step=1, native_min_value=0, diff --git a/homeassistant/components/wled/select.py b/homeassistant/components/wled/select.py index 7df43a4250d932583c1c1d0151fb3c6721b39a26..36aff0f4536385348240443b05f03486c14fc4b5 100644 --- a/homeassistant/components/wled/select.py +++ b/homeassistant/components/wled/select.py @@ -49,7 +49,6 @@ class WLEDLiveOverrideSelect(WLEDEntity, SelectEntity): """Defined a WLED Live Override select.""" _attr_entity_category = EntityCategory.CONFIG - _attr_icon = "mdi:theater" _attr_translation_key = "live_override" def __init__(self, coordinator: WLEDDataUpdateCoordinator) -> None: @@ -73,7 +72,6 @@ class WLEDLiveOverrideSelect(WLEDEntity, SelectEntity): class WLEDPresetSelect(WLEDEntity, SelectEntity): """Defined a WLED Preset select.""" - _attr_icon = "mdi:playlist-play" _attr_translation_key = "preset" def __init__(self, coordinator: WLEDDataUpdateCoordinator) -> None: @@ -104,7 +102,6 @@ class WLEDPresetSelect(WLEDEntity, SelectEntity): class WLEDPlaylistSelect(WLEDEntity, SelectEntity): """Define a WLED Playlist select.""" - _attr_icon = "mdi:play-speed" _attr_translation_key = "playlist" def __init__(self, coordinator: WLEDDataUpdateCoordinator) -> None: @@ -138,7 +135,6 @@ class WLEDPaletteSelect(WLEDEntity, SelectEntity): """Defines a WLED Palette select.""" _attr_entity_category = EntityCategory.CONFIG - _attr_icon = "mdi:palette-outline" _attr_translation_key = "color_palette" _segment: int diff --git a/homeassistant/components/wled/sensor.py b/homeassistant/components/wled/sensor.py index 709edaf424ffd8df2be78ba5715114613c90f2dd..a2e052eacd90681cd6cf3d34545455685e9a9b77 100644 --- a/homeassistant/components/wled/sensor.py +++ b/homeassistant/components/wled/sensor.py @@ -76,7 +76,6 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = ( WLEDSensorEntityDescription( key="free_heap", translation_key="free_heap", - icon="mdi:memory", native_unit_of_measurement=UnitOfInformation.BYTES, state_class=SensorStateClass.MEASUREMENT, device_class=SensorDeviceClass.DATA_SIZE, @@ -87,7 +86,6 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = ( WLEDSensorEntityDescription( key="wifi_signal", translation_key="wifi_signal", - icon="mdi:wifi", native_unit_of_measurement=PERCENTAGE, state_class=SensorStateClass.MEASUREMENT, entity_category=EntityCategory.DIAGNOSTIC, @@ -107,7 +105,6 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = ( WLEDSensorEntityDescription( key="wifi_channel", translation_key="wifi_channel", - icon="mdi:wifi", entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, value_fn=lambda device: device.info.wifi.channel if device.info.wifi else None, @@ -115,7 +112,6 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = ( WLEDSensorEntityDescription( key="wifi_bssid", translation_key="wifi_bssid", - icon="mdi:wifi", entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, value_fn=lambda device: device.info.wifi.bssid if device.info.wifi else None, @@ -123,7 +119,6 @@ SENSORS: tuple[WLEDSensorEntityDescription, ...] = ( WLEDSensorEntityDescription( key="ip", translation_key="ip", - icon="mdi:ip-network", entity_category=EntityCategory.DIAGNOSTIC, value_fn=lambda device: device.info.ip, ), diff --git a/homeassistant/components/wled/switch.py b/homeassistant/components/wled/switch.py index 1fb300bd01dd777f4ac4b7816a17c07b6f75a002..f42e1cc7f9f270f31fb2e1ce42cbeb0c907c00e8 100644 --- a/homeassistant/components/wled/switch.py +++ b/homeassistant/components/wled/switch.py @@ -53,7 +53,6 @@ async def async_setup_entry( class WLEDNightlightSwitch(WLEDEntity, SwitchEntity): """Defines a WLED nightlight switch.""" - _attr_icon = "mdi:weather-night" _attr_entity_category = EntityCategory.CONFIG _attr_translation_key = "nightlight" @@ -91,7 +90,6 @@ class WLEDNightlightSwitch(WLEDEntity, SwitchEntity): class WLEDSyncSendSwitch(WLEDEntity, SwitchEntity): """Defines a WLED sync send switch.""" - _attr_icon = "mdi:upload-network-outline" _attr_entity_category = EntityCategory.CONFIG _attr_translation_key = "sync_send" @@ -124,7 +122,6 @@ class WLEDSyncSendSwitch(WLEDEntity, SwitchEntity): class WLEDSyncReceiveSwitch(WLEDEntity, SwitchEntity): """Defines a WLED sync receive switch.""" - _attr_icon = "mdi:download-network-outline" _attr_entity_category = EntityCategory.CONFIG _attr_translation_key = "sync_receive" @@ -157,7 +154,6 @@ class WLEDSyncReceiveSwitch(WLEDEntity, SwitchEntity): class WLEDReverseSwitch(WLEDEntity, SwitchEntity): """Defines a WLED reverse effect switch.""" - _attr_icon = "mdi:swap-horizontal-bold" _attr_entity_category = EntityCategory.CONFIG _attr_translation_key = "reverse" _segment: int diff --git a/tests/components/wled/snapshots/test_number.ambr b/tests/components/wled/snapshots/test_number.ambr index 5539f1f450372c628bdfda0042802fa801e4329d..7c05390a04ea3a700d3d32c7cf1d6f9f2617cad4 100644 --- a/tests/components/wled/snapshots/test_number.ambr +++ b/tests/components/wled/snapshots/test_number.ambr @@ -87,7 +87,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Segment 1 speed', - 'icon': 'mdi:speedometer', 'max': 255, 'min': 0, 'mode': <NumberMode.AUTO: 'auto'>, @@ -126,7 +125,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:speedometer', + 'original_icon': None, 'original_name': 'Segment 1 speed', 'platform': 'wled', 'previous_unique_id': None, diff --git a/tests/components/wled/snapshots/test_select.ambr b/tests/components/wled/snapshots/test_select.ambr index 9c8cb52b4a61536cedc52183869d1407e6923fa3..3c96e063738745f10c196bb05890bfc7d8f6898f 100644 --- a/tests/components/wled/snapshots/test_select.ambr +++ b/tests/components/wled/snapshots/test_select.ambr @@ -3,7 +3,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Live override', - 'icon': 'mdi:theater', 'options': list([ '0', '1', @@ -44,7 +43,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:theater', + 'original_icon': None, 'original_name': 'Live override', 'platform': 'wled', 'previous_unique_id': None, @@ -90,7 +89,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Segment 1 color palette', - 'icon': 'mdi:palette-outline', 'options': list([ 'Analogous', 'April Night', @@ -225,7 +223,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:palette-outline', + 'original_icon': None, 'original_name': 'Segment 1 color palette', 'platform': 'wled', 'previous_unique_id': None, @@ -271,7 +269,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGBW Light Playlist', - 'icon': 'mdi:play-speed', 'options': list([ 'Playlist 1', 'Playlist 2', @@ -310,7 +307,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:play-speed', + 'original_icon': None, 'original_name': 'Playlist', 'platform': 'wled', 'previous_unique_id': None, @@ -356,7 +353,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGBW Light Preset', - 'icon': 'mdi:playlist-play', 'options': list([ 'Preset 1', 'Preset 2', @@ -395,7 +391,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:playlist-play', + 'original_icon': None, 'original_name': 'Preset', 'platform': 'wled', 'previous_unique_id': None, diff --git a/tests/components/wled/snapshots/test_switch.ambr b/tests/components/wled/snapshots/test_switch.ambr index 8031624c75bdb7a1f07d270f5549ca060d5b237e..1184f1842ace5c18b5db0e0315b932c6213bd909 100644 --- a/tests/components/wled/snapshots/test_switch.ambr +++ b/tests/components/wled/snapshots/test_switch.ambr @@ -5,7 +5,6 @@ 'duration': 60, 'fade': True, 'friendly_name': 'WLED RGB Light Nightlight', - 'icon': 'mdi:weather-night', 'target_brightness': 0, }), 'context': <ANY>, @@ -36,7 +35,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:weather-night', + 'original_icon': None, 'original_name': 'Nightlight', 'platform': 'wled', 'previous_unique_id': None, @@ -82,7 +81,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Reverse', - 'icon': 'mdi:swap-horizontal-bold', }), 'context': <ANY>, 'entity_id': 'switch.wled_rgb_light_reverse', @@ -112,7 +110,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:swap-horizontal-bold', + 'original_icon': None, 'original_name': 'Reverse', 'platform': 'wled', 'previous_unique_id': None, @@ -158,7 +156,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Sync receive', - 'icon': 'mdi:download-network-outline', 'udp_port': 21324, }), 'context': <ANY>, @@ -189,7 +186,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:download-network-outline', + 'original_icon': None, 'original_name': 'Sync receive', 'platform': 'wled', 'previous_unique_id': None, @@ -235,7 +232,6 @@ StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'WLED RGB Light Sync send', - 'icon': 'mdi:upload-network-outline', 'udp_port': 21324, }), 'context': <ANY>, @@ -266,7 +262,7 @@ 'options': dict({ }), 'original_device_class': None, - 'original_icon': 'mdi:upload-network-outline', + 'original_icon': None, 'original_name': 'Sync send', 'platform': 'wled', 'previous_unique_id': None, diff --git a/tests/components/wled/test_light.py b/tests/components/wled/test_light.py index 2594c228eda43980c7b5ea765774d5d45eb08cd0..fc1d5503c071be4bb32f58f9141577db4341d2a3 100644 --- a/tests/components/wled/test_light.py +++ b/tests/components/wled/test_light.py @@ -43,7 +43,7 @@ async def test_rgb_light_state( assert state.attributes.get(ATTR_BRIGHTNESS) == 127 assert state.attributes.get(ATTR_EFFECT) == "Solid" assert state.attributes.get(ATTR_HS_COLOR) == (37.412, 100.0) - assert state.attributes.get(ATTR_ICON) == "mdi:led-strip-variant" + assert state.attributes.get(ATTR_ICON) is None assert state.state == STATE_ON assert (entry := entity_registry.async_get("light.wled_rgb_light")) @@ -54,7 +54,7 @@ async def test_rgb_light_state( assert state.attributes.get(ATTR_BRIGHTNESS) == 127 assert state.attributes.get(ATTR_EFFECT) == "Blink" assert state.attributes.get(ATTR_HS_COLOR) == (148.941, 100.0) - assert state.attributes.get(ATTR_ICON) == "mdi:led-strip-variant" + assert state.attributes.get(ATTR_ICON) is None assert state.state == STATE_ON assert (entry := entity_registry.async_get("light.wled_rgb_light_segment_1")) diff --git a/tests/components/wled/test_sensor.py b/tests/components/wled/test_sensor.py index d9168d7b6975829511dc31793d292cb3167da517..db68bc2e4540cbe9089118c42832761ff463487b 100644 --- a/tests/components/wled/test_sensor.py +++ b/tests/components/wled/test_sensor.py @@ -61,7 +61,7 @@ async def test_sensors( assert entry.entity_category is EntityCategory.DIAGNOSTIC assert (state := hass.states.get("sensor.wled_rgb_light_free_memory")) - assert state.attributes.get(ATTR_ICON) == "mdi:memory" + assert state.attributes.get(ATTR_ICON) is None assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == UnitOfInformation.BYTES assert state.state == "14600" assert entry.entity_category is EntityCategory.DIAGNOSTIC @@ -71,7 +71,7 @@ async def test_sensors( assert entry.entity_category is EntityCategory.DIAGNOSTIC assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_signal")) - assert state.attributes.get(ATTR_ICON) == "mdi:wifi" + assert state.attributes.get(ATTR_ICON) is None assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE assert state.state == "76" assert entry.entity_category is EntityCategory.DIAGNOSTIC @@ -93,7 +93,7 @@ async def test_sensors( assert entry.entity_category is EntityCategory.DIAGNOSTIC assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_channel")) - assert state.attributes.get(ATTR_ICON) == "mdi:wifi" + assert state.attributes.get(ATTR_ICON) is None assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None assert state.state == "11" @@ -102,7 +102,7 @@ async def test_sensors( assert entry.entity_category is EntityCategory.DIAGNOSTIC assert (state := hass.states.get("sensor.wled_rgb_light_wi_fi_bssid")) - assert state.attributes.get(ATTR_ICON) == "mdi:wifi" + assert state.attributes.get(ATTR_ICON) is None assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None assert state.state == "AA:AA:AA:AA:AA:BB" @@ -111,7 +111,7 @@ async def test_sensors( assert entry.entity_category is EntityCategory.DIAGNOSTIC assert (state := hass.states.get("sensor.wled_rgb_light_ip")) - assert state.attributes.get(ATTR_ICON) == "mdi:ip-network" + assert state.attributes.get(ATTR_ICON) is None assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) is None assert state.state == "127.0.0.1"