Use DeviceInfo object s-x (#96281)
* Use DeviceInfo object o-x * Use DeviceInfo object
This commit is contained in:
parent
f25d5a157a
commit
2f6826dbe3
8 changed files with 43 additions and 24 deletions
|
@ -19,6 +19,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import EntityCategory
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from .const import DOMAIN
|
||||
|
@ -100,7 +101,9 @@ class SFRBoxButton(ButtonEntity):
|
|||
self.entity_description = description
|
||||
self._box = box
|
||||
self._attr_unique_id = f"{system_info.mac_addr}_{description.key}"
|
||||
self._attr_device_info = {"identifiers": {(DOMAIN, system_info.mac_addr)}}
|
||||
self._attr_device_info = DeviceInfo(
|
||||
identifiers={(DOMAIN, system_info.mac_addr)},
|
||||
)
|
||||
|
||||
@with_error_wrapping
|
||||
async def async_press(self) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue