Add entity translations to justnimbus (#98235)
This commit is contained in:
parent
11b1a42a1c
commit
398a789ba2
3 changed files with 54 additions and 12 deletions
homeassistant/components/justnimbus
|
@ -13,6 +13,8 @@ class JustNimbusEntity(
|
||||||
):
|
):
|
||||||
"""Defines a base JustNimbus entity."""
|
"""Defines a base JustNimbus entity."""
|
||||||
|
|
||||||
|
_attr_has_entity_name = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
*,
|
*,
|
||||||
|
|
|
@ -46,7 +46,7 @@ class JustNimbusEntityDescription(
|
||||||
SENSOR_TYPES = (
|
SENSOR_TYPES = (
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="pump_flow",
|
key="pump_flow",
|
||||||
name="Pump flow",
|
translation_key="pump_flow",
|
||||||
icon="mdi:pump",
|
icon="mdi:pump",
|
||||||
native_unit_of_measurement=VOLUME_FLOW_RATE_LITERS_PER_MINUTE,
|
native_unit_of_measurement=VOLUME_FLOW_RATE_LITERS_PER_MINUTE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
@ -55,7 +55,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="drink_flow",
|
key="drink_flow",
|
||||||
name="Drink flow",
|
translation_key="drink_flow",
|
||||||
icon="mdi:water-pump",
|
icon="mdi:water-pump",
|
||||||
native_unit_of_measurement=VOLUME_FLOW_RATE_LITERS_PER_MINUTE,
|
native_unit_of_measurement=VOLUME_FLOW_RATE_LITERS_PER_MINUTE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
@ -64,7 +64,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="pump_pressure",
|
key="pump_pressure",
|
||||||
name="Pump pressure",
|
translation_key="pump_pressure",
|
||||||
native_unit_of_measurement=UnitOfPressure.BAR,
|
native_unit_of_measurement=UnitOfPressure.BAR,
|
||||||
device_class=SensorDeviceClass.PRESSURE,
|
device_class=SensorDeviceClass.PRESSURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
@ -73,7 +73,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="pump_starts",
|
key="pump_starts",
|
||||||
name="Pump starts",
|
translation_key="pump_starts",
|
||||||
icon="mdi:restart",
|
icon="mdi:restart",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
@ -81,7 +81,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="pump_hours",
|
key="pump_hours",
|
||||||
name="Pump hours",
|
translation_key="pump_hours",
|
||||||
icon="mdi:clock",
|
icon="mdi:clock",
|
||||||
device_class=SensorDeviceClass.DURATION,
|
device_class=SensorDeviceClass.DURATION,
|
||||||
native_unit_of_measurement=UnitOfTime.HOURS,
|
native_unit_of_measurement=UnitOfTime.HOURS,
|
||||||
|
@ -91,7 +91,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="reservoir_temp",
|
key="reservoir_temp",
|
||||||
name="Reservoir Temperature",
|
translation_key="reservoir_temperature",
|
||||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
@ -100,7 +100,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="reservoir_content",
|
key="reservoir_content",
|
||||||
name="Reservoir content",
|
translation_key="reservoir_content",
|
||||||
icon="mdi:car-coolant-level",
|
icon="mdi:car-coolant-level",
|
||||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||||
device_class=SensorDeviceClass.VOLUME,
|
device_class=SensorDeviceClass.VOLUME,
|
||||||
|
@ -110,7 +110,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="total_saved",
|
key="total_saved",
|
||||||
name="Total saved",
|
translation_key="total_saved",
|
||||||
icon="mdi:water-opacity",
|
icon="mdi:water-opacity",
|
||||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||||
device_class=SensorDeviceClass.VOLUME,
|
device_class=SensorDeviceClass.VOLUME,
|
||||||
|
@ -120,7 +120,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="total_replenished",
|
key="total_replenished",
|
||||||
name="Total replenished",
|
translation_key="total_replenished",
|
||||||
icon="mdi:water",
|
icon="mdi:water",
|
||||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||||
device_class=SensorDeviceClass.VOLUME,
|
device_class=SensorDeviceClass.VOLUME,
|
||||||
|
@ -130,7 +130,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="error_code",
|
key="error_code",
|
||||||
name="Error code",
|
translation_key="error_code",
|
||||||
icon="mdi:bug",
|
icon="mdi:bug",
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
@ -138,7 +138,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="totver",
|
key="totver",
|
||||||
name="Total use",
|
translation_key="total_use",
|
||||||
icon="mdi:chart-donut",
|
icon="mdi:chart-donut",
|
||||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||||
device_class=SensorDeviceClass.VOLUME,
|
device_class=SensorDeviceClass.VOLUME,
|
||||||
|
@ -148,7 +148,7 @@ SENSOR_TYPES = (
|
||||||
),
|
),
|
||||||
JustNimbusEntityDescription(
|
JustNimbusEntityDescription(
|
||||||
key="reservoir_content_max",
|
key="reservoir_content_max",
|
||||||
name="Max reservoir content",
|
translation_key="reservoir_content_max",
|
||||||
icon="mdi:waves",
|
icon="mdi:waves",
|
||||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||||
device_class=SensorDeviceClass.VOLUME,
|
device_class=SensorDeviceClass.VOLUME,
|
||||||
|
|
|
@ -15,5 +15,45 @@
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"pump_flow": {
|
||||||
|
"name": "Pump flow"
|
||||||
|
},
|
||||||
|
"drink_flow": {
|
||||||
|
"name": "Drink flow"
|
||||||
|
},
|
||||||
|
"pump_pressure": {
|
||||||
|
"name": "Pump pressure"
|
||||||
|
},
|
||||||
|
"pump_starts": {
|
||||||
|
"name": "Pump starts"
|
||||||
|
},
|
||||||
|
"pump_hours": {
|
||||||
|
"name": "Pump hours"
|
||||||
|
},
|
||||||
|
"reservoir_temperature": {
|
||||||
|
"name": "Reservoir temperature"
|
||||||
|
},
|
||||||
|
"reservoir_content": {
|
||||||
|
"name": "Reservoir content"
|
||||||
|
},
|
||||||
|
"total_saved": {
|
||||||
|
"name": "Total saved"
|
||||||
|
},
|
||||||
|
"total_replenished": {
|
||||||
|
"name": "Total replenished"
|
||||||
|
},
|
||||||
|
"error_code": {
|
||||||
|
"name": "Error code"
|
||||||
|
},
|
||||||
|
"total_use": {
|
||||||
|
"name": "Total use"
|
||||||
|
},
|
||||||
|
"reservoir_content_max": {
|
||||||
|
"name": "Maximum reservoir content"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue