Add icon translations to iBeacon (#111811)

* Add icon translations to iBeacon

* Add icon translations to iBeacon
This commit is contained in:
Joost Lekkerkerker 2024-03-06 06:32:31 +01:00 committed by GitHub
parent addd957091
commit 8d6205cedd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 6 deletions

View File

@ -49,6 +49,7 @@ class IBeaconTrackerEntity(IBeaconEntity, BaseTrackerEntity):
"""An iBeacon Tracker entity."""
_attr_name = None
_attr_translation_key = "device_tracker"
def __init__(
self,
@ -74,11 +75,6 @@ class IBeaconTrackerEntity(IBeaconEntity, BaseTrackerEntity):
"""Return tracker source type."""
return SourceType.BLUETOOTH_LE
@property
def icon(self) -> str:
"""Return device icon."""
return "mdi:bluetooth-connect" if self._active else "mdi:bluetooth-off"
@callback
def _async_seen(
self,

View File

@ -0,0 +1,17 @@
{
"entity": {
"device_tracker": {
"device_tracker": {
"default": "mdi:bluetooth-off",
"state": {
"home": "mdi:bluetooth-connect"
}
}
},
"sensor": {
"estimated_distance": {
"default": "mdi:signal-distance-variant"
}
}
}
}

View File

@ -56,7 +56,6 @@ SENSOR_DESCRIPTIONS = (
IBeaconSensorEntityDescription(
key="estimated_distance",
translation_key="estimated_distance",
icon="mdi:signal-distance-variant",
native_unit_of_measurement=UnitOfLength.METERS,
value_fn=lambda ibeacon_advertisement: ibeacon_advertisement.distance,
state_class=SensorStateClass.MEASUREMENT,