Use attrs instead of properties in roku (#51735)
* Use attrs instead of properties in roku. * Update media_player.py * Update remote.py * Update __init__.py * Create entity.py * Update entity.py * Update media_player.py * Update remote.py * Update __init__.py * Update media_player.py * Update remote.py * Update __init__.py * Update __init__.py * Update entity.py
This commit is contained in:
parent
e0013648f6
commit
fa3ae9b83c
4 changed files with 53 additions and 63 deletions
|
@ -6,8 +6,9 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
from . import RokuDataUpdateCoordinator, RokuEntity, roku_exception_handler
|
||||
from . import RokuDataUpdateCoordinator, roku_exception_handler
|
||||
from .const import DOMAIN
|
||||
from .entity import RokuEntity
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
|
@ -28,16 +29,11 @@ class RokuRemote(RokuEntity, RemoteEntity):
|
|||
"""Initialize the Roku device."""
|
||||
super().__init__(
|
||||
device_id=unique_id,
|
||||
name=coordinator.data.info.name,
|
||||
coordinator=coordinator,
|
||||
)
|
||||
|
||||
self._unique_id = unique_id
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return the unique ID for this entity."""
|
||||
return self._unique_id
|
||||
self._attr_name = coordinator.data.info.name
|
||||
self._attr_unique_id = unique_id
|
||||
|
||||
@property
|
||||
def is_on(self) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue