Add entity translations to Big Ass Fans (#95136)
This commit is contained in:
parent
c8430e4557
commit
fa334cf2bd
9 changed files with 111 additions and 36 deletions
|
@ -39,7 +39,6 @@ class BAFBinarySensorDescription(
|
|||
OCCUPANCY_SENSORS = (
|
||||
BAFBinarySensorDescription(
|
||||
key="occupancy",
|
||||
name="Occupancy",
|
||||
device_class=BinarySensorDeviceClass.OCCUPANCY,
|
||||
value_fn=lambda device: cast(bool | None, device.fan_occupancy_detected),
|
||||
),
|
||||
|
@ -70,7 +69,7 @@ class BAFBinarySensor(BAFEntity, BinarySensorEntity):
|
|||
def __init__(self, device: Device, description: BAFBinarySensorDescription) -> None:
|
||||
"""Initialize the entity."""
|
||||
self.entity_description = description
|
||||
super().__init__(device, f"{device.name} {description.name}")
|
||||
super().__init__(device)
|
||||
self._attr_unique_id = f"{self._device.mac_address}-{description.key}"
|
||||
|
||||
@callback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue