Add device class to directv devices (#39628)

* add device class to directv devices

* Update test_media_player.py

* Update media_player.py

* Update test_media_player.py

* Update media_player.py
This commit is contained in:
Chris Talkington authored and GitHub committed 2020-09-03 23:27:13 +02:00
1 parent d0120d5e0a
commit f6a3eea7f2
2 files changed
+14 -2

No files matched your search

@@ -1,10 +1,13 @@
"""Support for the DirecTV receivers."""
import logging
from typing import Callable, List
from typing import Callable, List, Optional
from directv import DIRECTV
from homeassistant.components.media_player import MediaPlayerEntity
from homeassistant.components.media_player import (
DEVICE_CLASS_RECEIVER,
MediaPlayerEntity,
)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_CHANNEL,
MEDIA_TYPE_MOVIE,
@@ -137,6 +140,11 @@ class DIRECTVMediaPlayer(DIRECTVEntity, MediaPlayerEntity):
"""Return the name of the device."""
return self._name
@property
def device_class(self) -> Optional[str]:
"""Return the class of this device."""
return DEVICE_CLASS_RECEIVER
@property
def unique_id(self):
"""Return a unique ID to use for this media player."""