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:
Chris Talkington 2021-06-11 06:51:18 -05:00 committed by GitHub
parent e0013648f6
commit fa3ae9b83c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 63 deletions

View file

@ -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: