Add entity translations to dormakaba (#95230)

This commit is contained in:
Joost Lekkerkerker 2023-06-26 19:02:52 +02:00 committed by GitHub
parent 3f0393154e
commit 1525901ffc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 3 deletions

View file

@ -39,13 +39,12 @@ class DormakabaDkeyBinarySensorDescription(
BINARY_SENSOR_DESCRIPTIONS = (
DormakabaDkeyBinarySensorDescription(
key="door_position",
name="Door",
device_class=BinarySensorDeviceClass.DOOR,
is_on=lambda state: state.door_position == DoorPosition.OPEN,
),
DormakabaDkeyBinarySensorDescription(
key="security_locked",
name="Deadbolt",
translation_key="deadbolt",
device_class=BinarySensorDeviceClass.LOCK,
is_on=lambda state: state.unlock_status
not in (UnlockStatus.SECURITY_LOCKED, UnlockStatus.UNLOCKED_SECURITY_LOCKED),

View file

@ -22,7 +22,6 @@ from .models import DormakabaDkeyData
BINARY_SENSOR_DESCRIPTIONS = (
SensorEntityDescription(
key="battery_level",
name="Battery",
device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,

View file

@ -33,5 +33,12 @@
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]",
"unknown": "[%key:common::config_flow::error::unknown%]"
}
},
"entity": {
"binary_sensor": {
"deadbolt": {
"name": "Deadbolt"
}
}
}
}