mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Add icon translations to Tractive (#110138)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
This commit is contained in:
parent
57bec29266
commit
c2818dcb8e
@ -36,7 +36,6 @@ async def async_setup_entry(
|
||||
class TractiveDeviceTracker(TractiveEntity, TrackerEntity):
|
||||
"""Tractive device tracker."""
|
||||
|
||||
_attr_icon = "mdi:paw"
|
||||
_attr_translation_key = "tracker"
|
||||
|
||||
def __init__(self, client: TractiveClient, item: Trackables) -> None:
|
||||
|
58
homeassistant/components/tractive/icons.json
Normal file
58
homeassistant/components/tractive/icons.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"entity": {
|
||||
"device_tracker": {
|
||||
"tracker": {
|
||||
"default": "mdi:paw"
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
"activity": {
|
||||
"default": "mdi:run"
|
||||
},
|
||||
"activity_time": {
|
||||
"default": "mdi:clock-time-eight-outline"
|
||||
},
|
||||
"calories": {
|
||||
"default": "mdi:fire"
|
||||
},
|
||||
"daily_goal": {
|
||||
"default": "mdi:flag-checkered"
|
||||
},
|
||||
"minutes_day_sleep": {
|
||||
"default": "mdi:sleep"
|
||||
},
|
||||
"minutes_night_sleep": {
|
||||
"default": "mdi:sleep"
|
||||
},
|
||||
"rest_time": {
|
||||
"default": "mdi:clock-time-eight-outline"
|
||||
},
|
||||
"sleep": {
|
||||
"default": "mdi:sleep"
|
||||
},
|
||||
"tracker_state": {
|
||||
"default": "mdi:radar"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
"tracker_buzzer": {
|
||||
"default": "mdi:volume-high",
|
||||
"state": {
|
||||
"off": "mdi:volume-off"
|
||||
}
|
||||
},
|
||||
"tracker_led": {
|
||||
"default": "mdi:led-on",
|
||||
"state": {
|
||||
"off": "mdi:led-off"
|
||||
}
|
||||
},
|
||||
"live_tracking": {
|
||||
"default": "mdi:map-marker-path",
|
||||
"state": {
|
||||
"off": "mdi:map-marker-off"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -111,7 +111,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
translation_key="tracker_state",
|
||||
signal_prefix=TRACKER_HARDWARE_STATUS_UPDATED,
|
||||
hardware_sensor=True,
|
||||
icon="mdi:radar",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
options=[
|
||||
@ -124,7 +123,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_MINUTES_ACTIVE,
|
||||
translation_key="activity_time",
|
||||
icon="mdi:clock-time-eight-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
signal_prefix=TRACKER_ACTIVITY_STATUS_UPDATED,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
@ -132,7 +130,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_MINUTES_REST,
|
||||
translation_key="rest_time",
|
||||
icon="mdi:clock-time-eight-outline",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
@ -140,7 +137,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_CALORIES,
|
||||
translation_key="calories",
|
||||
icon="mdi:fire",
|
||||
native_unit_of_measurement="kcal",
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
@ -148,14 +144,12 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_DAILY_GOAL,
|
||||
translation_key="daily_goal",
|
||||
icon="mdi:flag-checkered",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
signal_prefix=TRACKER_ACTIVITY_STATUS_UPDATED,
|
||||
),
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_MINUTES_DAY_SLEEP,
|
||||
translation_key="minutes_day_sleep",
|
||||
icon="mdi:sleep",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
@ -163,7 +157,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_MINUTES_NIGHT_SLEEP,
|
||||
translation_key="minutes_night_sleep",
|
||||
icon="mdi:sleep",
|
||||
native_unit_of_measurement=UnitOfTime.MINUTES,
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
state_class=SensorStateClass.TOTAL,
|
||||
@ -171,7 +164,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_SLEEP_LABEL,
|
||||
translation_key="sleep",
|
||||
icon="mdi:sleep",
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
value_fn=lambda state: state.lower() if isinstance(state, str) else state,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
@ -184,7 +176,6 @@ SENSOR_TYPES: tuple[TractiveSensorEntityDescription, ...] = (
|
||||
TractiveSensorEntityDescription(
|
||||
key=ATTR_ACTIVITY_LABEL,
|
||||
translation_key="activity",
|
||||
icon="mdi:run",
|
||||
signal_prefix=TRACKER_WELLNESS_STATUS_UPDATED,
|
||||
value_fn=lambda state: state.lower() if isinstance(state, str) else state,
|
||||
device_class=SensorDeviceClass.ENUM,
|
||||
|
@ -46,21 +46,18 @@ SWITCH_TYPES: tuple[TractiveSwitchEntityDescription, ...] = (
|
||||
TractiveSwitchEntityDescription(
|
||||
key=ATTR_BUZZER,
|
||||
translation_key="tracker_buzzer",
|
||||
icon="mdi:volume-high",
|
||||
method="async_set_buzzer",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
TractiveSwitchEntityDescription(
|
||||
key=ATTR_LED,
|
||||
translation_key="tracker_led",
|
||||
icon="mdi:led-on",
|
||||
method="async_set_led",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
TractiveSwitchEntityDescription(
|
||||
key=ATTR_LIVE_TRACKING,
|
||||
translation_key="live_tracking",
|
||||
icon="mdi:map-marker-path",
|
||||
method="async_set_live_tracking",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user