mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Add device info to Withings (#99052)
This commit is contained in:
parent
a73f214ead
commit
6e157fef18
@ -38,12 +38,13 @@ from homeassistant.helpers.config_entry_oauth2_flow import (
|
|||||||
AbstractOAuth2Implementation,
|
AbstractOAuth2Implementation,
|
||||||
OAuth2Session,
|
OAuth2Session,
|
||||||
)
|
)
|
||||||
|
from homeassistant.helpers.device_registry import DeviceInfo
|
||||||
from homeassistant.helpers.entity import Entity, EntityDescription
|
from homeassistant.helpers.entity import Entity, EntityDescription
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
from homeassistant.util import dt as dt_util
|
from homeassistant.util import dt as dt_util
|
||||||
|
|
||||||
from . import const
|
from . import const
|
||||||
from .const import Measurement
|
from .const import DOMAIN, Measurement
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(const.LOG_NAMESPACE)
|
_LOGGER = logging.getLogger(const.LOG_NAMESPACE)
|
||||||
_RETRY_COEFFICIENT = 0.5
|
_RETRY_COEFFICIENT = 0.5
|
||||||
@ -561,6 +562,10 @@ class BaseWithingsSensor(Entity):
|
|||||||
description, data_manager.user_id
|
description, data_manager.user_id
|
||||||
)
|
)
|
||||||
self._state_data: Any | None = None
|
self._state_data: Any | None = None
|
||||||
|
self._attr_device_info = DeviceInfo(
|
||||||
|
identifiers={(DOMAIN, str(data_manager.user_id))},
|
||||||
|
name=data_manager.profile,
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user