Skip to content

Commit

Permalink
feat: adding sensors to a devide
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorzin committed Dec 16, 2024
1 parent 983724c commit 41d8751
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions custom_components/aliexpress_openplatform/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType

Expand Down Expand Up @@ -178,13 +179,14 @@ def __init__(self, coordinator: AliexpressOpenPlatformCoordinator) -> None:
)

@property
def device_info(self) -> dict[str, Any]:
def device_info(self) -> DeviceInfo | None:
"""Return device information for this sensor."""
return {
"identifiers": {(DOMAIN, "aliexpress_device")},
"name": "Aliexpress OpenPlatform",
"manufacturer": "Aliexpress",
"model": "OpenPlatform API",
"configuration_url": "https://portals.aliexpress.com",
}

@property
Expand Down Expand Up @@ -221,7 +223,7 @@ def __init__(self, coordinator: AliexpressOpenPlatformCoordinator) -> None:
)

@property
def device_info(self) -> dict[str, Any]:
def device_info(self) -> DeviceInfo | None:
"""Return device information for this sensor."""
return {
"identifiers": {(DOMAIN, "aliexpress_device")},
Expand Down Expand Up @@ -263,7 +265,7 @@ def __init__(self, coordinator: AliexpressOpenPlatformCoordinator) -> None:
)

@property
def device_info(self) -> dict[str, Any]:
def device_info(self) -> DeviceInfo | None:
"""Return device information for this sensor."""
return {
"identifiers": {(DOMAIN, "aliexpress_device")},
Expand Down

0 comments on commit 41d8751

Please sign in to comment.