Skip to content

Commit

Permalink
Merge pull request #145 from litinoveweedle/fix_mediatype_compat
Browse files Browse the repository at this point in the history
fix HA MediaType compatibility
  • Loading branch information
litinoveweedle authored Oct 11, 2024
2 parents eebca77 + b85963f commit 40f6532
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit 40f6532

Please sign in to comment.