From 3e59e7f3478c551d563f2a82cc6775f539fa4d1a Mon Sep 17 00:00:00 2001 From: ktnrg45 <38207570+ktnrg45@users.noreply.github.com> Date: Sun, 5 May 2019 16:53:08 -0700 Subject: [PATCH] Add media_type_app to media_player (#23666) * Add media_type_app * Add MEDIA_TYPE_APP * Bump 0.7.3 * Bump 0.7.3 * Bump 0.7.3 * typo --- homeassistant/components/media_player/const.py | 1 + homeassistant/components/ps4/manifest.json | 2 +- homeassistant/components/ps4/media_player.py | 9 ++++++--- requirements_all.txt | 2 +- requirements_test_all.txt | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/media_player/const.py b/homeassistant/components/media_player/const.py index 1e53e6073601..0875df623b3b 100644 --- a/homeassistant/components/media_player/const.py +++ b/homeassistant/components/media_player/const.py @@ -39,6 +39,7 @@ MEDIA_TYPE_PLAYLIST = 'playlist' MEDIA_TYPE_IMAGE = 'image' MEDIA_TYPE_URL = 'url' MEDIA_TYPE_GAME = 'game' +MEDIA_TYPE_APP = 'app' SERVICE_CLEAR_PLAYLIST = 'clear_playlist' SERVICE_PLAY_MEDIA = 'play_media' diff --git a/homeassistant/components/ps4/manifest.json b/homeassistant/components/ps4/manifest.json index fcfcad95c127..087f16183783 100644 --- a/homeassistant/components/ps4/manifest.json +++ b/homeassistant/components/ps4/manifest.json @@ -3,7 +3,7 @@ "name": "Ps4", "documentation": "https://www.home-assistant.io/components/ps4", "requirements": [ - "pyps4-homeassistant==0.7.2" + "pyps4-homeassistant==0.7.3" ], "dependencies": [], "codeowners": [ diff --git a/homeassistant/components/ps4/media_player.py b/homeassistant/components/ps4/media_player.py index a53110b6f0e7..f5360f491dbc 100644 --- a/homeassistant/components/ps4/media_player.py +++ b/homeassistant/components/ps4/media_player.py @@ -7,8 +7,8 @@ import voluptuous as vol from homeassistant.components.media_player import ( ENTITY_IMAGE_URL, MediaPlayerDevice) from homeassistant.components.media_player.const import ( - MEDIA_TYPE_GAME, SUPPORT_SELECT_SOURCE, SUPPORT_STOP, SUPPORT_TURN_OFF, - SUPPORT_TURN_ON) + MEDIA_TYPE_GAME, MEDIA_TYPE_APP, SUPPORT_SELECT_SOURCE, + SUPPORT_STOP, SUPPORT_TURN_OFF, SUPPORT_TURN_ON) from homeassistant.components.ps4 import format_unique_id from homeassistant.const import ( ATTR_COMMAND, ATTR_ENTITY_ID, CONF_HOST, CONF_NAME, CONF_REGION, @@ -222,7 +222,10 @@ class PS4Device(MediaPlayerDevice): self._media_title = app_name or name self._source = self._media_title self._media_image = art - self._media_type = MEDIA_TYPE_GAME + if title.game_type == 'App': + self._media_type = MEDIA_TYPE_APP + else: + self._media_type = MEDIA_TYPE_GAME self.update_list() def update_list(self): diff --git a/requirements_all.txt b/requirements_all.txt index 650c503cbbb3..268c854f8817 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1249,7 +1249,7 @@ pypjlink2==1.2.0 pypoint==1.1.1 # homeassistant.components.ps4 -pyps4-homeassistant==0.7.2 +pyps4-homeassistant==0.7.3 # homeassistant.components.qwikswitch pyqwikswitch==0.93 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index a96e1c5f5062..ac5a70e7e680 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -252,7 +252,7 @@ pyopenuv==1.0.9 pyotp==2.2.7 # homeassistant.components.ps4 -pyps4-homeassistant==0.7.2 +pyps4-homeassistant==0.7.3 # homeassistant.components.qwikswitch pyqwikswitch==0.93