mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Use enum in roku (#62043)
This commit is contained in:
parent
7506b12277
commit
093202f138
@ -7,9 +7,8 @@ import logging
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.media_player import (
|
from homeassistant.components.media_player import (
|
||||||
DEVICE_CLASS_RECEIVER,
|
|
||||||
DEVICE_CLASS_TV,
|
|
||||||
BrowseMedia,
|
BrowseMedia,
|
||||||
|
MediaPlayerDeviceClass,
|
||||||
MediaPlayerEntity,
|
MediaPlayerEntity,
|
||||||
)
|
)
|
||||||
from homeassistant.components.media_player.const import (
|
from homeassistant.components.media_player.const import (
|
||||||
@ -104,9 +103,9 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
|
|||||||
def device_class(self) -> str | None:
|
def device_class(self) -> str | None:
|
||||||
"""Return the class of this device."""
|
"""Return the class of this device."""
|
||||||
if self.coordinator.data.info.device_type == "tv":
|
if self.coordinator.data.info.device_type == "tv":
|
||||||
return DEVICE_CLASS_TV
|
return MediaPlayerDeviceClass.TV
|
||||||
|
|
||||||
return DEVICE_CLASS_RECEIVER
|
return MediaPlayerDeviceClass.RECEIVER
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self) -> str | None:
|
def state(self) -> str | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user