Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions custom_components/meross_cloud/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from homeassistant.exceptions import ConfigEntryNotReady, ConfigEntryAuthFailed
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, format_mac
from meross_iot.controller.device import BaseDevice
from meross_iot.http_api import MerossHttpClient, ErrorCodes
from meross_iot.manager import MerossManager
Expand Down Expand Up @@ -270,14 +271,19 @@ def name(self) -> str:

@property
def device_info(self):
return {
'identifiers': {(DOMAIN, self._device.internal_id)},
'name': self._device.name,
'manufacturer': 'Meross',
'model': self._device.type + " " + self._device.hardware_version,
'sw_version': self._device.firmware_version
info = {
"identifiers": {(DOMAIN, self._device.internal_id)},
"name": self._device.name,
"manufacturer": "Meross",
"model": self._device.type + " " + self._device.hardware_version,
"sw_version": self._device.firmware_version,
}

if mac := self._device.mac_address:
info["connections"] = {(CONNECTION_NETWORK_MAC, format_mac(mac))}

return info

@property
def available(self) -> bool:
return self._coordinator.last_update_success and self.online
Expand Down