mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 20:27:08 +00:00
Add icon translations to iBeacon (#111811)
* Add icon translations to iBeacon * Add icon translations to iBeacon
This commit is contained in:
parent
addd957091
commit
8d6205cedd
@ -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,
|
||||
|
17
homeassistant/components/ibeacon/icons.json
Normal file
17
homeassistant/components/ibeacon/icons.json
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user