Skip to content

Commit

Permalink
v1
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Sep 24, 2024
1 parent 8a95118 commit c589738
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions custom_components/xiaomi_miot/core/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from miio.miot_device import MiotDevice as MiotDeviceBase

if TYPE_CHECKING:
from . import XEntity
from . import BasicEntity

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -121,7 +121,7 @@ def __init__(self, info: DeviceInfo, entry: HassEntry):
self.info = info
self.hass = entry.hass
self.entry = entry
self.entities: dict[str, 'XEntity'] = {}
self.entities: dict[str, 'BasicEntity'] = {}
self.listeners: list[Callable] = []
self.converters: list[BaseConv] = []

Expand Down Expand Up @@ -266,7 +266,7 @@ def init_converters(self):
for action in srv.get_actions(*als):
self.converters.append(MiotActionConv(action.full_name, d, action=action))

def add_entity(self, entity: 'XEntity'):
def add_entity(self, entity: 'BasicEntity'):
if entity not in self.entities:
self.entities[entity.unique_id] = entity

Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_miot/core/hass_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def new_adder(self, domain, adder: AddEntitiesCallback):
if not cls:
continue
entity = cls(device, conv)
device.entities[key] = entity
device.add_entity(entity)
adder([entity], update_before_add=False)
_LOGGER.info('New entity: %s', entity)

Expand Down

0 comments on commit c589738

Please sign in to comment.