Allow inheriting base component entity descriptions in frozen dataclasses (#105512)
Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
47f8e08261
commit
104bcc64b7
31 changed files with 35 additions and 85 deletions
|
@ -1,7 +1,6 @@
|
|||
"""Component to interface with binary sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import dataclass
|
||||
from datetime import timedelta
|
||||
from enum import StrEnum
|
||||
import logging
|
||||
|
@ -176,8 +175,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
return await component.async_unload_entry(entry)
|
||||
|
||||
|
||||
@dataclass
|
||||
class BinarySensorEntityDescription(EntityDescription):
|
||||
class BinarySensorEntityDescription(EntityDescription, frozen_or_thawed=True):
|
||||
"""A class that describes binary sensor entities."""
|
||||
|
||||
device_class: BinarySensorDeviceClass | None = None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue