diff --git a/homeassistant/components/kef/manifest.json b/homeassistant/components/kef/manifest.json index a2769cd8eb6..135f8e1cf54 100644 --- a/homeassistant/components/kef/manifest.json +++ b/homeassistant/components/kef/manifest.json @@ -4,5 +4,5 @@ "documentation": "https://www.home-assistant.io/integrations/kef", "dependencies": [], "codeowners": ["@basnijholt"], - "requirements": ["aiokef==0.2.6", "getmac==0.8.1"] + "requirements": ["aiokef==0.2.7", "getmac==0.8.1"] } diff --git a/homeassistant/components/kef/media_player.py b/homeassistant/components/kef/media_player.py index dc91b94f5ef..d4a1d7a4df3 100644 --- a/homeassistant/components/kef/media_player.py +++ b/homeassistant/components/kef/media_player.py @@ -11,6 +11,10 @@ import voluptuous as vol from homeassistant.components.media_player import ( PLATFORM_SCHEMA, + SUPPORT_NEXT_TRACK, + SUPPORT_PAUSE, + SUPPORT_PLAY, + SUPPORT_PREVIOUS_TRACK, SUPPORT_SELECT_SOURCE, SUPPORT_TURN_OFF, SUPPORT_TURN_ON, @@ -214,6 +218,10 @@ class KefMediaPlayer(MediaPlayerDevice): | SUPPORT_VOLUME_MUTE | SUPPORT_SELECT_SOURCE | SUPPORT_TURN_OFF + | SUPPORT_NEXT_TRACK # only in Bluetooth and Wifi + | SUPPORT_PAUSE # only in Bluetooth and Wifi + | SUPPORT_PLAY # only in Bluetooth and Wifi + | SUPPORT_PREVIOUS_TRACK # only in Bluetooth and Wifi ) if self._supports_on: support_kef |= SUPPORT_TURN_ON @@ -280,3 +288,19 @@ class KefMediaPlayer(MediaPlayerDevice): await self._speaker.set_source(source) else: raise ValueError(f"Unknown input source: {source}.") + + async def async_media_play(self): + """Send play command.""" + await self._speaker.play_pause() + + async def async_media_pause(self): + """Send pause command.""" + await self._speaker.play_pause() + + async def async_media_previous_track(self): + """Send previous track command.""" + await self._speaker.prev_track() + + async def async_media_next_track(self): + """Send next track command.""" + await self._speaker.next_track() diff --git a/requirements_all.txt b/requirements_all.txt index 87a2b0d8f1c..a0ef25566ff 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -172,7 +172,7 @@ aioimaplib==0.7.15 aiokafka==0.5.1 # homeassistant.components.kef -aiokef==0.2.6 +aiokef==0.2.7 # homeassistant.components.lifx aiolifx==0.6.7