Add entity translations for PoolSense (#95814)

pull/97063/head
Joost Lekkerkerker 2023-07-22 12:43:51 +02:00 committed by GitHub
parent 4bc57c0466
commit 8495da1964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 11 deletions

View File

@ -17,12 +17,12 @@ from .const import DOMAIN
BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription(
key="pH Status",
name="pH Status",
translation_key="ph_status",
device_class=BinarySensorDeviceClass.PROBLEM,
),
BinarySensorEntityDescription(
key="Chlorine Status",
name="Chlorine Status",
translation_key="chlorine_status",
device_class=BinarySensorDeviceClass.PROBLEM,
),
)

View File

@ -22,55 +22,53 @@ from .const import DOMAIN
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key="Chlorine",
translation_key="chlorine",
native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
icon="mdi:pool",
name="Chlorine",
),
SensorEntityDescription(
key="pH",
translation_key="ph",
icon="mdi:pool",
name="pH",
),
SensorEntityDescription(
key="Battery",
native_unit_of_measurement=PERCENTAGE,
name="Battery",
device_class=SensorDeviceClass.BATTERY,
),
SensorEntityDescription(
key="Water Temp",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
icon="mdi:coolant-temperature",
name="Temperature",
device_class=SensorDeviceClass.TEMPERATURE,
),
SensorEntityDescription(
key="Last Seen",
translation_key="last_seen",
icon="mdi:clock",
name="Last Seen",
device_class=SensorDeviceClass.TIMESTAMP,
),
SensorEntityDescription(
key="Chlorine High",
translation_key="chlorine_high",
native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
icon="mdi:pool",
name="Chlorine High",
),
SensorEntityDescription(
key="Chlorine Low",
translation_key="chlorine_low",
native_unit_of_measurement=UnitOfElectricPotential.MILLIVOLT,
icon="mdi:pool",
name="Chlorine Low",
),
SensorEntityDescription(
key="pH High",
translation_key="ph_high",
icon="mdi:pool",
name="pH High",
),
SensorEntityDescription(
key="pH Low",
translation_key="ph_low",
icon="mdi:pool",
name="pH Low",
),
)

View File

@ -14,5 +14,38 @@
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"binary_sensor": {
"ph_status": {
"name": "pH status"
},
"chlorine_status": {
"name": "Chlorine status"
}
},
"sensor": {
"chlorine": {
"name": "Chlorine"
},
"ph": {
"name": "pH"
},
"last_seen": {
"name": "Last seen"
},
"chlorine_high": {
"name": "Chlorine high"
},
"chlorine_low": {
"name": "Chlorine low"
},
"ph_high": {
"name": "pH high"
},
"ph_low": {
"name": "pH low"
}
}
}
}