Use enum in roku (#62043)

This commit is contained in:
Robert Hillis 2021-12-16 08:41:59 -05:00 committed by GitHub
parent 7506b12277
commit 093202f138
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,9 +7,8 @@ import logging
import voluptuous as vol
from homeassistant.components.media_player import (
DEVICE_CLASS_RECEIVER,
DEVICE_CLASS_TV,
BrowseMedia,
MediaPlayerDeviceClass,
MediaPlayerEntity,
)
from homeassistant.components.media_player.const import (
@ -104,9 +103,9 @@ class RokuMediaPlayer(RokuEntity, MediaPlayerEntity):
def device_class(self) -> str | None:
"""Return the class of this device."""
if self.coordinator.data.info.device_type == "tv":
return DEVICE_CLASS_TV
return MediaPlayerDeviceClass.TV
return DEVICE_CLASS_RECEIVER
return MediaPlayerDeviceClass.RECEIVER
@property
def state(self) -> str | None: