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 = ( BINARY_SENSOR_DESCRIPTIONS = (
DormakabaDkeyBinarySensorDescription( DormakabaDkeyBinarySensorDescription(
key="door_position", key="door_position",
name="Door",
device_class=BinarySensorDeviceClass.DOOR, device_class=BinarySensorDeviceClass.DOOR,
is_on=lambda state: state.door_position == DoorPosition.OPEN, is_on=lambda state: state.door_position == DoorPosition.OPEN,
), ),
DormakabaDkeyBinarySensorDescription( DormakabaDkeyBinarySensorDescription(
key="security_locked", key="security_locked",
name="Deadbolt", translation_key="deadbolt",
device_class=BinarySensorDeviceClass.LOCK, device_class=BinarySensorDeviceClass.LOCK,
is_on=lambda state: state.unlock_status is_on=lambda state: state.unlock_status
not in (UnlockStatus.SECURITY_LOCKED, UnlockStatus.UNLOCKED_SECURITY_LOCKED), not in (UnlockStatus.SECURITY_LOCKED, UnlockStatus.UNLOCKED_SECURITY_LOCKED),

View File

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

View File

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