From b85963f51ad3843104d9707f2e1733f4b4bb8f07 Mon Sep 17 00:00:00 2001 From: litinoveweedle <15144712+litinoveweedle@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:17:03 +0200 Subject: [PATCH] fix HA MediaType compatibility --- custom_components/smartir/media_player.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/smartir/media_player.py b/custom_components/smartir/media_player.py index 332b8f5c..1e76a2be 100644 --- a/custom_components/smartir/media_player.py +++ b/custom_components/smartir/media_player.py @@ -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 @@ -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): @@ -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():