Add entity translations to Flume (#95350)

This commit is contained in:
Joost Lekkerkerker 2023-06-27 18:54:32 +02:00 committed by GitHub
parent 0b32a6e0d1
commit 09bfb08067
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 11 deletions

View file

@ -33,13 +33,13 @@ from .util import get_valid_flume_devices
FLUME_QUERIES_SENSOR: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key="current_interval",
name="Current",
translation_key="current_interval",
suggested_display_precision=2,
native_unit_of_measurement=f"{UnitOfVolume.GALLONS}/m",
),
SensorEntityDescription(
key="month_to_date",
name="Current Month",
translation_key="month_to_date",
suggested_display_precision=2,
native_unit_of_measurement=UnitOfVolume.GALLONS,
device_class=SensorDeviceClass.WATER,
@ -47,7 +47,7 @@ FLUME_QUERIES_SENSOR: tuple[SensorEntityDescription, ...] = (
),
SensorEntityDescription(
key="week_to_date",
name="Current Week",
translation_key="week_to_date",
suggested_display_precision=2,
native_unit_of_measurement=UnitOfVolume.GALLONS,
device_class=SensorDeviceClass.WATER,
@ -55,7 +55,7 @@ FLUME_QUERIES_SENSOR: tuple[SensorEntityDescription, ...] = (
),
SensorEntityDescription(
key="today",
name="Current Day",
translation_key="today",
suggested_display_precision=2,
native_unit_of_measurement=UnitOfVolume.GALLONS,
device_class=SensorDeviceClass.WATER,
@ -63,21 +63,21 @@ FLUME_QUERIES_SENSOR: tuple[SensorEntityDescription, ...] = (
),
SensorEntityDescription(
key="last_60_min",
name="60 Minutes",
translation_key="last_60_min",
suggested_display_precision=2,
native_unit_of_measurement=f"{UnitOfVolume.GALLONS}/h",
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
key="last_24_hrs",
name="24 Hours",
translation_key="last_24_hrs",
suggested_display_precision=2,
native_unit_of_measurement=f"{UnitOfVolume.GALLONS}/d",
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
key="last_30_days",
name="30 Days",
translation_key="last_30_days",
suggested_display_precision=2,
native_unit_of_measurement=f"{UnitOfVolume.GALLONS}/mo",
state_class=SensorStateClass.MEASUREMENT,