mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Add entity name translations to LaMetric (#90538)
* Add entity name translations to LaMetric * Consistency
This commit is contained in:
parent
8a99d2a566
commit
9478518937
@ -36,28 +36,28 @@ class LaMetricButtonEntityDescription(
|
|||||||
BUTTONS = [
|
BUTTONS = [
|
||||||
LaMetricButtonEntityDescription(
|
LaMetricButtonEntityDescription(
|
||||||
key="app_next",
|
key="app_next",
|
||||||
name="Next app",
|
translation_key="app_next",
|
||||||
icon="mdi:arrow-right-bold",
|
icon="mdi:arrow-right-bold",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
press_fn=lambda api: api.app_next(),
|
press_fn=lambda api: api.app_next(),
|
||||||
),
|
),
|
||||||
LaMetricButtonEntityDescription(
|
LaMetricButtonEntityDescription(
|
||||||
key="app_previous",
|
key="app_previous",
|
||||||
name="Previous app",
|
translation_key="app_previous",
|
||||||
icon="mdi:arrow-left-bold",
|
icon="mdi:arrow-left-bold",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
press_fn=lambda api: api.app_previous(),
|
press_fn=lambda api: api.app_previous(),
|
||||||
),
|
),
|
||||||
LaMetricButtonEntityDescription(
|
LaMetricButtonEntityDescription(
|
||||||
key="dismiss_current",
|
key="dismiss_current",
|
||||||
name="Dismiss current notification",
|
translation_key="dismiss_current",
|
||||||
icon="mdi:bell-cancel",
|
icon="mdi:bell-cancel",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
press_fn=lambda api: api.dismiss_current_notification(),
|
press_fn=lambda api: api.dismiss_current_notification(),
|
||||||
),
|
),
|
||||||
LaMetricButtonEntityDescription(
|
LaMetricButtonEntityDescription(
|
||||||
key="dismiss_all",
|
key="dismiss_all",
|
||||||
name="Dismiss all notifications",
|
translation_key="dismiss_all",
|
||||||
icon="mdi:bell-cancel",
|
icon="mdi:bell-cancel",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
press_fn=lambda api: api.dismiss_all_notifications(),
|
press_fn=lambda api: api.dismiss_all_notifications(),
|
||||||
|
@ -37,11 +37,10 @@ class LaMetricSelectEntityDescription(
|
|||||||
SELECTS = [
|
SELECTS = [
|
||||||
LaMetricSelectEntityDescription(
|
LaMetricSelectEntityDescription(
|
||||||
key="brightness_mode",
|
key="brightness_mode",
|
||||||
name="Brightness mode",
|
translation_key="brightness_mode",
|
||||||
icon="mdi:brightness-auto",
|
icon="mdi:brightness-auto",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
options=["auto", "manual"],
|
options=["auto", "manual"],
|
||||||
translation_key="brightness_mode",
|
|
||||||
current_fn=lambda device: device.display.brightness_mode.value,
|
current_fn=lambda device: device.display.brightness_mode.value,
|
||||||
select_fn=lambda api, opt: api.display(brightness_mode=BrightnessMode(opt)),
|
select_fn=lambda api, opt: api.display(brightness_mode=BrightnessMode(opt)),
|
||||||
),
|
),
|
||||||
|
@ -38,6 +38,7 @@ class LaMetricSensorEntityDescription(
|
|||||||
SENSORS = [
|
SENSORS = [
|
||||||
LaMetricSensorEntityDescription(
|
LaMetricSensorEntityDescription(
|
||||||
key="rssi",
|
key="rssi",
|
||||||
|
translation_key="rssi",
|
||||||
name="Wi-Fi signal",
|
name="Wi-Fi signal",
|
||||||
icon="mdi:wifi",
|
icon="mdi:wifi",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
@ -45,13 +45,38 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"entity": {
|
"entity": {
|
||||||
|
"button": {
|
||||||
|
"app_next": {
|
||||||
|
"name": "Next app"
|
||||||
|
},
|
||||||
|
"app_previous": {
|
||||||
|
"name": "Previous app"
|
||||||
|
},
|
||||||
|
"dismiss_current": {
|
||||||
|
"name": "Dismiss current notification"
|
||||||
|
},
|
||||||
|
"dismiss_all": {
|
||||||
|
"name": "Dismiss all notifications"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"sensor": {
|
||||||
|
"rssi": {
|
||||||
|
"name": "Wi-Fi signal"
|
||||||
|
}
|
||||||
|
},
|
||||||
"select": {
|
"select": {
|
||||||
"brightness_mode": {
|
"brightness_mode": {
|
||||||
|
"name": "Brightness mode",
|
||||||
"state": {
|
"state": {
|
||||||
"auto": "Automatic",
|
"auto": "Automatic",
|
||||||
"manual": "Manual"
|
"manual": "Manual"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"switch": {
|
||||||
|
"bluetooth": {
|
||||||
|
"name": "Bluetooth"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class LaMetricSwitchEntityDescription(
|
|||||||
SWITCHES = [
|
SWITCHES = [
|
||||||
LaMetricSwitchEntityDescription(
|
LaMetricSwitchEntityDescription(
|
||||||
key="bluetooth",
|
key="bluetooth",
|
||||||
name="Bluetooth",
|
translation_key="bluetooth",
|
||||||
icon="mdi:bluetooth",
|
icon="mdi:bluetooth",
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
available_fn=lambda device: device.bluetooth.available,
|
available_fn=lambda device: device.bluetooth.available,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user