mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Add icon translations to Private BLE Device (#112185)
This commit is contained in:
parent
15fa302c9a
commit
a2b9f59b8c
@ -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"
|
||||
|
20
homeassistant/components/private_ble_device/icons.json
Normal file
20
homeassistant/components/private_ble_device/icons.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user