diff --git a/homeassistant/components/private_ble_device/device_tracker.py b/homeassistant/components/private_ble_device/device_tracker.py index 64e23b25ebe..4f22c9b275c 100644 --- a/homeassistant/components/private_ble_device/device_tracker.py +++ b/homeassistant/components/private_ble_device/device_tracker.py @@ -31,6 +31,7 @@ class BasePrivateDeviceTracker(BasePrivateDeviceEntity, BaseTrackerEntity): _attr_should_poll = False _attr_has_entity_name = True + _attr_translation_key = "device_tracker" _attr_name = None @property @@ -68,8 +69,3 @@ class BasePrivateDeviceTracker(BasePrivateDeviceEntity, BaseTrackerEntity): def source_type(self) -> SourceType: """Return the source type, eg gps or router, of the device.""" return SourceType.BLUETOOTH_LE - - @property - def icon(self) -> str: - """Return device icon.""" - return "mdi:bluetooth-connect" if self._last_info else "mdi:bluetooth-off" diff --git a/homeassistant/components/private_ble_device/icons.json b/homeassistant/components/private_ble_device/icons.json new file mode 100644 index 00000000000..0bab138182d --- /dev/null +++ b/homeassistant/components/private_ble_device/icons.json @@ -0,0 +1,20 @@ +{ + "entity": { + "device_tracker": { + "device_tracker": { + "default": "mdi:bluetooth-off", + "state": { + "home": "mdi:bluetooth-connect" + } + } + }, + "sensor": { + "estimated_distance": { + "default": "mdi:signal-distance-variant" + }, + "estimated_broadcast_interval": { + "default": "mdi:timer-sync-outline" + } + } + } +} diff --git a/homeassistant/components/private_ble_device/sensor.py b/homeassistant/components/private_ble_device/sensor.py index fb094de3d58..1cff006794c 100644 --- a/homeassistant/components/private_ble_device/sensor.py +++ b/homeassistant/components/private_ble_device/sensor.py @@ -65,7 +65,6 @@ SENSOR_DESCRIPTIONS = ( PrivateDeviceSensorEntityDescription( key="estimated_distance", translation_key="estimated_distance", - icon="mdi:signal-distance-variant", native_unit_of_measurement=UnitOfLength.METERS, value_fn=lambda _, service_info: service_info.advertisement and service_info.advertisement.tx_power @@ -79,7 +78,6 @@ SENSOR_DESCRIPTIONS = ( PrivateDeviceSensorEntityDescription( key="estimated_broadcast_interval", translation_key="estimated_broadcast_interval", - icon="mdi:timer-sync-outline", native_unit_of_measurement=UnitOfTime.SECONDS, entity_registry_enabled_default=False, entity_category=EntityCategory.DIAGNOSTIC,