Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix HA MediaType compatibility #145

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions custom_components/smartir/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from homeassistant.components.media_player import MediaPlayerEntity, PLATFORM_SCHEMA
from homeassistant.components.media_player.const import (
MediaPlayerEntityFeature,
MEDIA_TYPE_CHANNEL,
MediaType,
)
from homeassistant.const import CONF_NAME, STATE_OFF, STATE_ON, STATE_UNKNOWN
from homeassistant.core import HomeAssistant, Event, EventStateChangedData, callback
Expand Down Expand Up @@ -219,7 +219,7 @@ def media_title(self):
@property
def media_content_type(self):
"""Content type of current playing media."""
return MEDIA_TYPE_CHANNEL
return MediaType.CHANNEL

@property
def source_list(self):
Expand Down Expand Up @@ -284,7 +284,7 @@ async def async_select_source(self, source):

async def async_play_media(self, media_type, media_id, **kwargs):
"""Support channel change through play_media service."""
if media_type != MEDIA_TYPE_CHANNEL:
if media_type != MediaType.CHANNEL:
_LOGGER.error("invalid media type")
return
if not media_id.isdigit():
Expand Down
Loading