diff --git a/homeassistant/components/lametric/button.py b/homeassistant/components/lametric/button.py index 3f894495f4b..f0a452f2d02 100644 --- a/homeassistant/components/lametric/button.py +++ b/homeassistant/components/lametric/button.py @@ -31,28 +31,24 @@ BUTTONS = [ LaMetricButtonEntityDescription( key="app_next", translation_key="app_next", - icon="mdi:arrow-right-bold", entity_category=EntityCategory.CONFIG, press_fn=lambda api: api.app_next(), ), LaMetricButtonEntityDescription( key="app_previous", translation_key="app_previous", - icon="mdi:arrow-left-bold", entity_category=EntityCategory.CONFIG, press_fn=lambda api: api.app_previous(), ), LaMetricButtonEntityDescription( key="dismiss_current", translation_key="dismiss_current", - icon="mdi:bell-cancel", entity_category=EntityCategory.CONFIG, press_fn=lambda api: api.dismiss_current_notification(), ), LaMetricButtonEntityDescription( key="dismiss_all", translation_key="dismiss_all", - icon="mdi:bell-cancel", entity_category=EntityCategory.CONFIG, press_fn=lambda api: api.dismiss_all_notifications(), ), diff --git a/homeassistant/components/lametric/icons.json b/homeassistant/components/lametric/icons.json new file mode 100644 index 00000000000..7e1841272cf --- /dev/null +++ b/homeassistant/components/lametric/icons.json @@ -0,0 +1,45 @@ +{ + "entity": { + "button": { + "app_next": { + "default": "mdi:arrow-right-bold" + }, + "app_previous": { + "default": "mdi:arrow-left-bold" + }, + "dismiss_current": { + "default": "mdi:bell-cancel" + }, + "dismiss_all": { + "default": "mdi:bell-cancel" + } + }, + "number": { + "brightness": { + "default": "mdi:brightness-6" + }, + "volume": { + "default": "mdi:volume-high" + } + }, + "select": { + "brightness_mode": { + "default": "mdi:brightness-auto" + } + }, + "sensor": { + "rssi": { + "default": "mdi:wifi" + } + }, + "switch": { + "bluetooth": { + "default": "mdi:bluetooth" + } + } + }, + "services": { + "chart": "mdi:chart-areaspline-variant", + "message": "mdi:message" + } +} diff --git a/homeassistant/components/lametric/number.py b/homeassistant/components/lametric/number.py index 704a9e7fbe7..cea9debb04b 100644 --- a/homeassistant/components/lametric/number.py +++ b/homeassistant/components/lametric/number.py @@ -31,8 +31,8 @@ class LaMetricNumberEntityDescription(NumberEntityDescription): NUMBERS = [ LaMetricNumberEntityDescription( key="brightness", + translation_key="brightness", name="Brightness", - icon="mdi:brightness-6", entity_category=EntityCategory.CONFIG, native_step=1, native_min_value=0, @@ -43,8 +43,8 @@ NUMBERS = [ ), LaMetricNumberEntityDescription( key="volume", + translation_key="volume", name="Volume", - icon="mdi:volume-high", entity_category=EntityCategory.CONFIG, native_step=1, native_min_value=0, diff --git a/homeassistant/components/lametric/select.py b/homeassistant/components/lametric/select.py index dd81fd69877..bf9872f2791 100644 --- a/homeassistant/components/lametric/select.py +++ b/homeassistant/components/lametric/select.py @@ -32,7 +32,6 @@ SELECTS = [ LaMetricSelectEntityDescription( key="brightness_mode", translation_key="brightness_mode", - icon="mdi:brightness-auto", entity_category=EntityCategory.CONFIG, options=["auto", "manual"], current_fn=lambda device: device.display.brightness_mode.value, diff --git a/homeassistant/components/lametric/sensor.py b/homeassistant/components/lametric/sensor.py index 3e516789dce..f202a77b530 100644 --- a/homeassistant/components/lametric/sensor.py +++ b/homeassistant/components/lametric/sensor.py @@ -33,7 +33,6 @@ SENSORS = [ LaMetricSensorEntityDescription( key="rssi", translation_key="rssi", - icon="mdi:wifi", entity_category=EntityCategory.DIAGNOSTIC, entity_registry_enabled_default=False, native_unit_of_measurement=PERCENTAGE, diff --git a/homeassistant/components/lametric/switch.py b/homeassistant/components/lametric/switch.py index d8afa2d076b..9689bb7b802 100644 --- a/homeassistant/components/lametric/switch.py +++ b/homeassistant/components/lametric/switch.py @@ -33,7 +33,6 @@ SWITCHES = [ LaMetricSwitchEntityDescription( key="bluetooth", translation_key="bluetooth", - icon="mdi:bluetooth", entity_category=EntityCategory.CONFIG, available_fn=lambda device: device.bluetooth.available, is_on_fn=lambda device: device.bluetooth.active, diff --git a/tests/components/lametric/test_button.py b/tests/components/lametric/test_button.py index f1ebbc65e44..e755329b93d 100644 --- a/tests/components/lametric/test_button.py +++ b/tests/components/lametric/test_button.py @@ -9,7 +9,6 @@ from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRE from homeassistant.components.lametric.const import DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, - ATTR_ICON, STATE_UNAVAILABLE, STATE_UNKNOWN, EntityCategory, @@ -33,7 +32,6 @@ async def test_button_app_next( """Test the LaMetric next app button.""" state = hass.states.get("button.frenck_s_lametric_next_app") assert state - assert state.attributes.get(ATTR_ICON) == "mdi:arrow-right-bold" assert state.state == STATE_UNKNOWN entry = entity_registry.async_get("button.frenck_s_lametric_next_app") @@ -80,7 +78,6 @@ async def test_button_app_previous( """Test the LaMetric previous app button.""" state = hass.states.get("button.frenck_s_lametric_previous_app") assert state - assert state.attributes.get(ATTR_ICON) == "mdi:arrow-left-bold" assert state.state == STATE_UNKNOWN entry = entity_registry.async_get("button.frenck_s_lametric_previous_app") @@ -127,7 +124,6 @@ async def test_button_dismiss_current_notification( """Test the LaMetric dismiss current notification button.""" state = hass.states.get("button.frenck_s_lametric_dismiss_current_notification") assert state - assert state.attributes.get(ATTR_ICON) == "mdi:bell-cancel" assert state.state == STATE_UNKNOWN entry = entity_registry.async_get( @@ -176,7 +172,6 @@ async def test_button_dismiss_all_notifications( """Test the LaMetric dismiss all notifications button.""" state = hass.states.get("button.frenck_s_lametric_dismiss_all_notifications") assert state - assert state.attributes.get(ATTR_ICON) == "mdi:bell-cancel" assert state.state == STATE_UNKNOWN entry = entity_registry.async_get( diff --git a/tests/components/lametric/test_number.py b/tests/components/lametric/test_number.py index 5a1b617c24b..d5466abbd41 100644 --- a/tests/components/lametric/test_number.py +++ b/tests/components/lametric/test_number.py @@ -18,7 +18,6 @@ from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, - ATTR_ICON, ATTR_UNIT_OF_MEASUREMENT, PERCENTAGE, STATE_UNAVAILABLE, @@ -42,7 +41,6 @@ async def test_brightness( assert state assert state.attributes.get(ATTR_DEVICE_CLASS) is None assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Frenck's LaMetric Brightness" - assert state.attributes.get(ATTR_ICON) == "mdi:brightness-6" assert state.attributes.get(ATTR_MAX) == 100 assert state.attributes.get(ATTR_MIN) == 0 assert state.attributes.get(ATTR_STEP) == 1 @@ -92,7 +90,6 @@ async def test_volume( assert state assert state.attributes.get(ATTR_DEVICE_CLASS) is None assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Frenck's LaMetric Volume" - assert state.attributes.get(ATTR_ICON) == "mdi:volume-high" assert state.attributes.get(ATTR_MAX) == 100 assert state.attributes.get(ATTR_MIN) == 0 assert state.attributes.get(ATTR_STEP) == 1 diff --git a/tests/components/lametric/test_select.py b/tests/components/lametric/test_select.py index 7e528e26905..bd7bc775714 100644 --- a/tests/components/lametric/test_select.py +++ b/tests/components/lametric/test_select.py @@ -14,7 +14,6 @@ from homeassistant.components.select import ( from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, - ATTR_ICON, ATTR_OPTION, STATE_UNAVAILABLE, EntityCategory, @@ -38,7 +37,6 @@ async def test_brightness_mode( assert ( state.attributes.get(ATTR_FRIENDLY_NAME) == "Frenck's LaMetric Brightness mode" ) - assert state.attributes.get(ATTR_ICON) == "mdi:brightness-auto" assert state.attributes.get(ATTR_OPTIONS) == ["auto", "manual"] assert state.state == BrightnessMode.AUTO diff --git a/tests/components/lametric/test_sensor.py b/tests/components/lametric/test_sensor.py index bb15ebd5aa4..8dff11fb450 100644 --- a/tests/components/lametric/test_sensor.py +++ b/tests/components/lametric/test_sensor.py @@ -7,7 +7,6 @@ from homeassistant.components.sensor import ATTR_STATE_CLASS, SensorStateClass from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_FRIENDLY_NAME, - ATTR_ICON, ATTR_UNIT_OF_MEASUREMENT, PERCENTAGE, EntityCategory, @@ -30,7 +29,6 @@ async def test_wifi_signal( assert state assert state.attributes.get(ATTR_DEVICE_CLASS) is None assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Frenck's LaMetric Wi-Fi signal" - assert state.attributes.get(ATTR_ICON) == "mdi:wifi" assert state.attributes.get(ATTR_STATE_CLASS) is SensorStateClass.MEASUREMENT assert state.attributes.get(ATTR_UNIT_OF_MEASUREMENT) == PERCENTAGE assert state.state == "21" diff --git a/tests/components/lametric/test_switch.py b/tests/components/lametric/test_switch.py index 7ca5c800121..b81428bb402 100644 --- a/tests/components/lametric/test_switch.py +++ b/tests/components/lametric/test_switch.py @@ -15,7 +15,6 @@ from homeassistant.const import ( ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, ATTR_FRIENDLY_NAME, - ATTR_ICON, STATE_OFF, STATE_UNAVAILABLE, EntityCategory, @@ -41,7 +40,6 @@ async def test_bluetooth( assert state assert state.attributes.get(ATTR_DEVICE_CLASS) is None assert state.attributes.get(ATTR_FRIENDLY_NAME) == "Frenck's LaMetric Bluetooth" - assert state.attributes.get(ATTR_ICON) == "mdi:bluetooth" assert state.state == STATE_OFF entry = entity_registry.async_get(state.entity_id)