mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Use DeviceInfo in sma (#58521)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
6db7f73032
commit
3b7f620aad
@ -200,18 +200,18 @@ class SMAsensor(CoordinatorEntity, SensorEntity):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_info(self) -> DeviceInfo:
|
def device_info(self) -> DeviceInfo | None:
|
||||||
"""Return the device information."""
|
"""Return the device information."""
|
||||||
if not self._device_info:
|
if not self._device_info:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return {
|
return DeviceInfo(
|
||||||
"identifiers": {(DOMAIN, self._config_entry_unique_id)},
|
identifiers={(DOMAIN, self._config_entry_unique_id)},
|
||||||
"name": self._device_info["name"],
|
manufacturer=self._device_info["manufacturer"],
|
||||||
"manufacturer": self._device_info["manufacturer"],
|
model=self._device_info["type"],
|
||||||
"model": self._device_info["type"],
|
name=self._device_info["name"],
|
||||||
"sw_version": self._device_info["sw_version"],
|
sw_version=self._device_info["sw_version"],
|
||||||
}
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def entity_registry_enabled_default(self) -> bool:
|
def entity_registry_enabled_default(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user