Skip to content

Commit

Permalink
fix integrate via token (#1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Nov 8, 2024
1 parent 5cc1a18 commit e720ef0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions custom_components/xiaomi_miot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,9 +770,7 @@ def unique_mac(self):

@property
def unique_did(self):
did = self.device.info.unique_id
eid = self._config.get('entry_id')
return f'{did}-{eid}'
return self.device.unique_id

@property
def name(self):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/xiaomi_miot/core/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def model(self):

@cached_property
def mac(self):
return self.data.get('mac') or ''
return self.data.get('mac') or self.miio_info.mac_address or ''

@property
def host(self):
Expand Down Expand Up @@ -210,7 +210,7 @@ def name_model(self):

@cached_property
def unique_id(self):
return f'{self.info.unique_id}-{self.entry.entry_id}'
return f'{self.info.unique_id}-{self.entry.id}'

@cached_property
def app_link(self):
Expand Down
1 change: 1 addition & 0 deletions custom_components/xiaomi_miot/core/hass_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class HassEntry:
cloud: MiotCloud = None

def __init__(self, hass: HomeAssistant, entry: ConfigEntry):
self.id = entry.entry_id
self.hass = hass
self.entry = entry
self.adders: dict[str, AddEntitiesCallback] = {}
Expand Down

0 comments on commit e720ef0

Please sign in to comment.