diff --git a/homeassistant/components/opensky/icons.json b/homeassistant/components/opensky/icons.json new file mode 100644 index 000000000000..763e489c4e75 --- /dev/null +++ b/homeassistant/components/opensky/icons.json @@ -0,0 +1,9 @@ +{ + "entity": { + "sensor": { + "flights": { + "default": "mdi:airplane" + } + } + } +} diff --git a/homeassistant/components/opensky/sensor.py b/homeassistant/components/opensky/sensor.py index 9cae03663574..449f17cefbbb 100644 --- a/homeassistant/components/opensky/sensor.py +++ b/homeassistant/components/opensky/sensor.py @@ -38,7 +38,7 @@ class OpenSkySensor(CoordinatorEntity[OpenSkyDataUpdateCoordinator], SensorEntit ) _attr_has_entity_name = True _attr_name = None - _attr_icon = "mdi:airplane" + _attr_translation_key = "flights" _attr_native_unit_of_measurement = "flights" _attr_state_class = SensorStateClass.MEASUREMENT diff --git a/tests/components/opensky/snapshots/test_sensor.ambr b/tests/components/opensky/snapshots/test_sensor.ambr index a57b438df672..ab39746a93f0 100644 --- a/tests/components/opensky/snapshots/test_sensor.ambr +++ b/tests/components/opensky/snapshots/test_sensor.ambr @@ -4,7 +4,6 @@ 'attributes': ReadOnlyDict({ 'attribution': 'Information provided by the OpenSky Network (https://opensky-network.org)', 'friendly_name': 'OpenSky', - 'icon': 'mdi:airplane', 'state_class': , 'unit_of_measurement': 'flights', }), @@ -20,7 +19,6 @@ 'attributes': ReadOnlyDict({ 'attribution': 'Information provided by the OpenSky Network (https://opensky-network.org)', 'friendly_name': 'OpenSky', - 'icon': 'mdi:airplane', 'state_class': , 'unit_of_measurement': 'flights', }),